cucumber-junit

Cucumber - How to configure QAF Gherkin Scenario Factory?

╄→гoц情女王★ 提交于 2020-07-22 14:48:08
问题 I have a Cucumber project running thanks to JUnit with the following class: @RunWith(Cucumber.class) @CucumberOptions( features = "src/test/resources/features", glue = "com.steps", plugin = {"pretty", "json:target/cucumber-report/cucumber.json"}) public class RunCucumber { } I want to use QAF Gherkin Scenario Factory in order to put some scenario examples in external files in order to reuse them (ex : Cucumber: Scenario Outline reusing examples table or CustomDataProvider for feature file

Cucumber - How to configure QAF Gherkin Scenario Factory?

拥有回忆 提交于 2020-07-22 14:46:52
问题 I have a Cucumber project running thanks to JUnit with the following class: @RunWith(Cucumber.class) @CucumberOptions( features = "src/test/resources/features", glue = "com.steps", plugin = {"pretty", "json:target/cucumber-report/cucumber.json"}) public class RunCucumber { } I want to use QAF Gherkin Scenario Factory in order to put some scenario examples in external files in order to reuse them (ex : Cucumber: Scenario Outline reusing examples table or CustomDataProvider for feature file

Cucumber-java-maven: Is it possible to add a tag to the ones defined in the test class?

前提是你 提交于 2020-07-20 06:05:57
问题 Say I have a cucumber feature file having tags @Crucial-tests , @Smoke-subset1 and @Smoke-subset2 for the scenarios. As I understand, I can run just @Smoke-subset1 during maven execution as(say) mvn clean install -Pcucumber-test -Dcucumber.options="--tags @Smoke-subset1" Now I modify my runner class to have a tag which I want to run by default everytime as @CucumberOptions(.. tags = {"@Crucial-tests"}..) If I run the same maven command again, then the tags specified in the runner class gets

Cucumber-java-maven: Is it possible to add a tag to the ones defined in the test class?

跟風遠走 提交于 2020-07-20 06:05:32
问题 Say I have a cucumber feature file having tags @Crucial-tests , @Smoke-subset1 and @Smoke-subset2 for the scenarios. As I understand, I can run just @Smoke-subset1 during maven execution as(say) mvn clean install -Pcucumber-test -Dcucumber.options="--tags @Smoke-subset1" Now I modify my runner class to have a tag which I want to run by default everytime as @CucumberOptions(.. tags = {"@Crucial-tests"}..) If I run the same maven command again, then the tags specified in the runner class gets

I am unable to post an Add Place API when using POST http method

喜欢而已 提交于 2020-06-17 09:10:48
问题 io.restassured.path.json.exception.JsonPathException: Failed to parse the JSON document It is throwing error in the code written for these Feature file steps: Given Add new location with "<name>" "<language>" "<address>" parameters Then user calls "AddPlaceAPI" with http "POST" method Then API successful response with "status" as "OK" The stepDefinition code for these steps @Given("Add new location with {string} {string} {string} parameters") public void Add_new_location_with_three_parameters

I am unable to post an Add Place API when using POST http method

送分小仙女□ 提交于 2020-06-17 09:10:07
问题 io.restassured.path.json.exception.JsonPathException: Failed to parse the JSON document It is throwing error in the code written for these Feature file steps: Given Add new location with "<name>" "<language>" "<address>" parameters Then user calls "AddPlaceAPI" with http "POST" method Then API successful response with "status" as "OK" The stepDefinition code for these steps @Given("Add new location with {string} {string} {string} parameters") public void Add_new_location_with_three_parameters

How do I specify a separate maven goal for running (Cucumber) acceptance tests?

偶尔善良 提交于 2020-03-17 10:34:41
问题 I have the following project structure: MyProject --src --test --acceptance --step_definitions --features --unit I would like to be able to run my cucumber tests (in test/acceptance) separately in Maven from the unit tests declared in test/unit, so that they can be run in different CI build plans etc. I am using cucumber-junit so the 'runners' for each acceptance test are written with JUnit. Is this possible? 回答1: Is this possible? Yes, it is possible. I believe you should separate your unit

How do I specify a separate maven goal for running (Cucumber) acceptance tests?

試著忘記壹切 提交于 2020-03-17 10:34:14
问题 I have the following project structure: MyProject --src --test --acceptance --step_definitions --features --unit I would like to be able to run my cucumber tests (in test/acceptance) separately in Maven from the unit tests declared in test/unit, so that they can be run in different CI build plans etc. I am using cucumber-junit so the 'runners' for each acceptance test are written with JUnit. Is this possible? 回答1: Is this possible? Yes, it is possible. I believe you should separate your unit

How to suppress Cucumber/Junit assertion stack trace

让人想犯罪 __ 提交于 2020-01-05 02:11:06
问题 I have a cucumber scenario and the step uses assertEquals . My results report shows the stack trace which is not end user friendly. How can I suppress it Scenario: Add two numbers Given I have two inputs "3" and "2" When I add them Then the output should be "15" 回答1: You're correct in observing that the default XML output (assuming you're not outputting to JSON or text, but you didn't say) from a Junit tests show stack traces for failed steps. This isn't actually a Cucumber thing.

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