gherkin

Codeception, write acceptance tests with the pageObject design pattern and gherkin

拜拜、爱过 提交于 2019-11-30 16:57:56
I'm looking for a simple example of code with the pageObject design pattern and gherkin because when I follow the codeception BDD documentation , all examples written in the tests/ support/AcceptanceTester.php. I don't understand (poor english skills - -) how not concentrate all code in the AcceptanceTester.php file. By example, I have a sample home page with two buttons A and B. If the user click on the button A, the page A is loaded else if the user click on button B, the page B is loaded. Currently, my AcceptanceTester : <?php // tests/_support/AcceptanceTester.php /** * Inherited Methods *

SpecFlow/Cucumber/Gherkin - Using tables in a scenario outline

ぃ、小莉子 提交于 2019-11-30 08:19:10
Hopefully I can explain my issue clearly enough for others to understand, here we go, imagine I have the two following hypothetical scenarios: Scenario: Filter sweets by king size and nut content Given I am on the "Sweet/List" Page When I filter sweets by | Field | Value | | Filter.KingSize | True | | Filter.ContainsNuts | False | Then I should see : | Value | | Yorkie King Size | | Mars King Size | Scenario: Filter sweets by make Given I am on the "Sweet/List" Page When I filter sweets by | Field | Value | | Filter.Make | Haribo | Then I should see : | Value | | Starmix | These scenarios are

How do I disable a feature in specflow (Gherkin) without deleting the feature?

筅森魡賤 提交于 2019-11-30 04:36:07
I have some SpecFlow features (using the Gherkin syntax) and I would like to temporarily disable the feature to prevent its tests from running? Is there an attribute I can mark the feature with to do this? I'm guessing that something that works with Cucumber might also work with SpecFlow. You can mark the feature with the tag @ignore: @ignore @web Scenario: Title should be matched When I perform a simple search on 'Domain' Then the book list should exactly contain book 'Domain Driven Design' In the recent version of Specflow, you now also have to provide a reason with the tag, like so: @ignore

Is it possible to reuse a feature as the “Given” for another feature?

感情迁移 提交于 2019-11-30 02:59:02
问题 Is it possible to reuse a feature as the "Given" for another feature? Or am I trying to do something I shouldn't be trying to do basically my features look like: Scenario: Creating a basic account with valid details (happy path) Given I am on the "signup" page And I enter all the right details #this is shortened of about 20 steps for your reading ease When I press the button labelled "Sign up" Then I should see the text "Thanks for signing up" And I should have an email from "confirmation

Is it acceptable to write a “Given When Then When Then” test in Gherkin?

元气小坏坏 提交于 2019-11-29 23:05:35
Is it acceptable to write a "Given When Then When Then" test in Gherkin? A real-life example is as follows all AllPlayers.com Scenario: Successfully register a user Given I am on homepage And I am not logged into an account When I follow "create a new account" And I fill in "First Name" with "Bobby" And I fill in "Last Name" with "Bricks" And I fill in "E-mail" with "bbricks@example.com" And I select "Jun" from "Birthday Month" And I select "22" from "Birthday Day" And I select "1985" form "Birthday Year" And I select "Male" from "Gender" And I fill in "Password" with "123testing" And I fill

Centralizing XPath in resource file, how to pass arguement from robot file?

≯℡__Kan透↙ 提交于 2019-11-29 16:40:48
I am centralizing all particular XPath strings to a resource file and importing the variables in that resource file in my test suite (robot framework). This way, they can be maintained in one place and I can use variable names that make the robot file readable. Is that something that is good practice? Sometimes I want to pass an argument to the variable, to make it more dynamic. However, the value of the variable contains and XPath, which sometimes has //div[path...etc][text()='MyString']. Question: In the robot file, how to pass an argument ('MyString') to the Click Element method that is

SpecFlow/Cucumber/Gherkin - Using tables in a scenario outline

浪子不回头ぞ 提交于 2019-11-29 11:28:08
问题 Hopefully I can explain my issue clearly enough for others to understand, here we go, imagine I have the two following hypothetical scenarios: Scenario: Filter sweets by king size and nut content Given I am on the "Sweet/List" Page When I filter sweets by | Field | Value | | Filter.KingSize | True | | Filter.ContainsNuts | False | Then I should see : | Value | | Yorkie King Size | | Mars King Size | Scenario: Filter sweets by make Given I am on the "Sweet/List" Page When I filter sweets by |

What's the best way to organize feature files?

耗尽温柔 提交于 2019-11-29 03:05:00
问题 I'm a huge fan of Specflow and BDD. It worked out great for me on a variety of projects. One challenge I haven't solved yet is organizing my feature files and scenarios in a way, which makes it easy to navigate and explore. Imagine one year later someone else wants to come along and learn about the system. Where to start? What's most important, what's less important? Any relations between features? Does the system handle a particular scenario? Has the author thought about this problem? Can

How do I disable a feature in specflow (Gherkin) without deleting the feature?

橙三吉。 提交于 2019-11-29 02:01:18
问题 I have some SpecFlow features (using the Gherkin syntax) and I would like to temporarily disable the feature to prevent its tests from running? Is there an attribute I can mark the feature with to do this? I'm guessing that something that works with Cucumber might also work with SpecFlow. 回答1: You can mark the feature with the tag @ignore: @ignore @web Scenario: Title should be matched When I perform a simple search on 'Domain' Then the book list should exactly contain book 'Domain Driven

continue running cucumber steps after a failure

情到浓时终转凉″ 提交于 2019-11-28 12:53:15
Is there any way to continue executing Cucumber Steps even when one of the steps fails. In my current setup when a step fails , cucumber skips remaining steps....I wonder if there is some way to twick cucumber runner setup.. I could comment out failing steps but its not practical when you dont know which step will fail...If i could continue with remaining step i would know complete set of failing Tests in one shot....rather than going in cycle over cycle... Environment: Cucumber JVM , R , Java , Ibatis , Spring Framework, Maven joshuanapoli It is not a good idea to continue executing steps