gherkin

Is it possible to write a gherkin step on multiple lines?

前提是你 提交于 2020-02-03 03:03:27
问题 I am new to the Gherkin language and this seems to me like very basic question but I could not find answer to it. I am aware that it is possible to write multi-line step argument in Gherking, like this: Given a blog post named "Random" with Markdown body """ Some Title, Eh? ============== Here is the first paragraph of my blog post. Lorem ipsum dolor sit amet, consectetur adipiscing elit. """ My question is about writing single step on multiple lines, something like this: Given that Gherkin

Test class not found in selected project

拈花ヽ惹草 提交于 2020-01-24 09:00:06
问题 Currently I am developing a simple program using Cucumber that will test logging in of a user on a website. Here is my TestRunner file: package cucumberTest; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions(features = "Feature") public class TestRunner { } I also have the cucumber file as LogIn_Test.feature as follows: Feature: Login Action Scenario: Successful Login with Valid Credentials Given

When writing a BDD feature, should I put previous user interaction into a Given step, or a When step?

家住魔仙堡 提交于 2020-01-22 20:34:18
问题 I am trying to write requirements for a multi-step business process (via a wizard). I have many scenarios where user interactions with one screen will change whether you are allowed to pick options on another screen. For example (I've obscured the actual business, but the process and form of the steps is nearly identical): Feature: Personal Diagnostic Search Filter In order to select a Technician who offers Personal Diagnostics, when I've asked for a Personal Diagnostic As a Business Customer

How to test filters based on authorization using Gherkin?

一曲冷凌霜 提交于 2020-01-05 05:55:51
问题 I don't understand how should scenario look like when there is no actual business action to test something. Is the following scenario good enough? I don't understand how it can be converted into Past, Action, Future sequence. Scenario: Given The system contains the following users | email | role | | admin@example.com | ADMIN | | user@example.com | USER | And The system contains the following Products | Name | Active | | Product1 | true | | Product2 | false | Then The list of Products for

NoSuchMethodError after run JUnit test with Cucumber

天大地大妈咪最大 提交于 2020-01-04 14:12:23
问题 I'm using Intellij IDEA IDE. I wrote 2 java classes and 1 feature cucumber file in project. feature structure is: Feature: First test with Cucumber Scenario: Testing Given file.xml from ext When take project path Then run test Also I wrote 1 jUnit java class for RunTest with Cucumber.class: import cucumber.api.junit.Cucumber; import org.junit.runner.RunWith; import org.hamcrest.SelfDescribing; import gherkin.util.FixJava; import cucumber.deps.com.thoughtworks.xstream.converters

cucumber tags based on maven profile

≯℡__Kan透↙ 提交于 2020-01-02 19:12:01
问题 I am trying to run specific Gherkin scenarios based on the variable @tags(if it is possible). For example, if my profile is "dev" I want to run scenario 1 and if profile is "qa" I want to run scenario 2. I can get the profile value in my java class. I can also pass the tags in the command line and run it as mentioned here. But that is not something I am looking for. For example: @QA Scenario:I do x and check y Given I do abc Then the response is 200 @DEV Scenario:I do y and check x Given I do

cucumber tags based on maven profile

会有一股神秘感。 提交于 2020-01-02 19:11:22
问题 I am trying to run specific Gherkin scenarios based on the variable @tags(if it is possible). For example, if my profile is "dev" I want to run scenario 1 and if profile is "qa" I want to run scenario 2. I can get the profile value in my java class. I can also pass the tags in the command line and run it as mentioned here. But that is not something I am looking for. For example: @QA Scenario:I do x and check y Given I do abc Then the response is 200 @DEV Scenario:I do y and check x Given I do

Cannot add new Given/When/Then, getting error `SyntaxError: Invalid regular expression: missing /`

て烟熏妆下的殇ゞ 提交于 2019-12-25 16:56:16
问题 I had configured cucumber + protractor, and I firstly was splitting stepDefinitions into different files like this: When I created new features files, and started running, cucumber/protractor did not recognized these new steps I was adding to the other files. So I decided to move all the new steps into the same file. But when I run, although they are well written (checked and compared thousands of times) I getting this error: [launcher] Error: /Users/brunosoko/Documents/Dev/Personal/test2

Can't execute feature in cucumber jvm

梦想与她 提交于 2019-12-24 01:45:29
问题 I am very new to using cucumber (started today). It seems simple enough but I am having issues running a basic feature. Feature: Proof of concept that my framework works Scenario: My first test Given this is my first step When this is my second step Then this is my final step I know there is no code for it to test, but I wanted it to return the fact that the scenarios are undefined. I did some research and realised I had a .jar file which was unnecessary, I have since removed that. I still

Should Gherkin scenario always have When step?

老子叫甜甜 提交于 2019-12-23 09:49:17
问题 When defining scenarios in Gherkin sometimes there is no clear distinction between Given and When steps, i.e. there is no active interaction with the system from the user and the purpose of the validation is to verify how the system should look under certain circumstances. Consider the following: Scenario: Show current balance Given user is on account page Then user should see his balance vs Scenario: Show current balance When user goes to account page Then user should see his balance I am