Questions tagged [scenarios]

In Behavior-driven development (i.e. BDD), a scenario (also known as acceptance criteria) is a description of each specific case of the narrative.

See the Wikipedia entry for Behavior-driven development for more information about scenarios.

279 questions
22
votes
3 answers

How to write stories / scenarios in BDD ( Behavior Driven Design )

I am about to use BDD (Behavior Driven Design) for the first time and am trying to get used to this different way of approaching a problem. Can you give some stories / scenarios that you would write for say a simple login application using BDD?…
Lill Lansey
19
votes
6 answers

How to pass List of strings from Cucumber Scenario

I need to pass the List of strings from cucumber scenario which works fine as below Scenario Outline: Verify some scenario Given something When user do something Then user should have some "" Examples: Some example |data| |Test1, Test2,…
Yogiraj
  • 223
  • 1
  • 4
  • 15
13
votes
1 answer

How to teardown a specflow scenario

I'm trying to create a new set of tests for testing a legacy web site that I'm working on. The site uses a database at the back end. I'm planning on using SpecFlow and Selenium, however I'm a bit stumped on what the best way to deal with cleaning…
Martin Brown
  • 24,692
  • 14
  • 77
  • 122
10
votes
3 answers

Unable to resolve activity for Intent robolectric ActivityScenarioRule

In my robolectric test i wrote a @Rule public ActivityScenarioRule activityScenarioRule = new ActivityScenarioRule<>(AppCompatActivity.class); @Rule public ActivityScenarioRule
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
10
votes
4 answers

Running certain steps once before a scenario outline - Python Behave

As the title suggests, I wish to run some certain configuration / environment setup steps before a scenario outline. I know there is Background to do this for scenarios, but Behave splits a scenario outline into multiple scenarios and thus runs the…
Nightsreach
  • 101
  • 1
  • 1
  • 7
10
votes
1 answer

Updating the name of SpecFlow scenario outline variations

I have this feature file: Scenario Outline: Example Given I am a user When I enter as an amount Then the result should be Examples: | x | result | | 3 | 3 | | 1 | 1 | My issue is that…
CaffGeek
  • 21,856
  • 17
  • 100
  • 184
9
votes
4 answers

SpecFlow - Retry failed tests

Is there a way to implement an AfterScenario hook to re-run the current test in case of Fail? Something like this: [AfterScenario("retry")] public void Retry() { if (ScenarioContext.Current.TestError != null) { // ? } } Note:…
LeeWay
  • 793
  • 3
  • 16
  • 28
8
votes
1 answer

Specflow Given When Then BUT?

I have been using SpecFlow for a while, without making use of the "but" logic. Considering the following scenario: Scenario: Kiran logs into the system but doesn't click remember me Given I have a username of 'Kiran' And a password of…
K-Dawg
  • 3,013
  • 2
  • 34
  • 52
8
votes
3 answers

How to get the current executing step information in Specflow

We are trying to take screenshots for each step. Everything works fine. But we are not able to correlate the screenshots to the steps which created them. What we would like is something like FeatureContext.FeatureInfo and…
NotAgain
  • 1,927
  • 3
  • 26
  • 42
7
votes
9 answers

Good examples for teaching database design

Does anyone have any good scenarios for teaching relational databases and SQL? All the examples I can find are either trivial or have improbable domain constraints (like full name being unique). I'm especially trying to find some good examples for…
Mark
  • 6,269
  • 2
  • 35
  • 34
6
votes
1 answer

How can i get cucumber scenario variables in title?

I would expect to be able to have my scenario outline title have more information by using the examples within the title itself: Scenario Outline: A step is When a step Then I get Examples: | some…
tijnn
  • 406
  • 1
  • 8
  • 24
6
votes
1 answer

How to improve the auto generated name in specflow when use scenario outline

I'm just a newbie in testing with Specflow and I have an issue when I use Scenario Outline. My feature file as following: feature file and below is the name is auto generated name. I just want to append the Test case ID for each row in the table…
Ken
  • 207
  • 3
  • 9
6
votes
5 answers

Multithreading - Avoiding and dealing with database deadlocks

I am looking for a good strategy of dealing with database deadlocks from within a Java 6 application; several parallel threads could, potentially, write into the same table at the same time. The database (Ingres RDMBS) will randomly kill one of the…
Adrian
  • 6,013
  • 10
  • 47
  • 68
5
votes
3 answers

How to terminate a python 2 doctest file in the middle?

Sometimes it can be useful to run only the first part of a large doctests file. There are many situations when the first part breaks after a code change, I would like to run only the first part, until it passes, and then run the whole file again. I…
mit
  • 11,083
  • 11
  • 50
  • 74
5
votes
3 answers

How can I get the Scenario Outline Example iteration number

I have the following test, using Specflow, Selenium WebDriver and C#: Scenario Outline: Verify query result Given I'm logged in When I enter "" Then I should see the correct result Examples: | query | | Query1 | …
1
2 3
18 19