cucumber-jvm

Cucumber does not read data from scenario outline

心已入冬 提交于 2019-12-11 12:34:29
问题 I have following scenario outline Background: Given customer is in hot or not page Scenario Outline: Hot article And customer enters <name> And submits And customer clicks thumbs up Then ensure the TBD Examples: | name | | Elliot | | Florian | and following step implementation - @And("customer enters <name>") public void customer_enters_name(String name) throws Throwable { // Express the Regexp above with the code you wish you had Thread.sleep(10000); } But when I execute test then I get

How to run more then one feature into one junit test with cucumber-jvm

随声附和 提交于 2019-12-11 11:56:49
问题 I have 2 feature files with different tags(@tag_1 and @tag_2). Also, I have junit test class: @RunWith(Cucumber.class) @CucumberOptions(features = path/to/features, tags = {"@tag_1", "@tag_2"}) But if I run junit test, in console I see this: 0 scenarios 0 steps None of the features at [path/to/features] matched the filters: [@tag_1, @tag_2] But in features I see these tags before Feature word What's wrong? 回答1: If you have a look to cucumber tags specifications: Tags which are comma separated

Cucumber-Jvm produces empty Json file when any of the test Fails

纵然是瞬间 提交于 2019-12-11 11:29:29
问题 I have about 50 feature files running on Jenkin Server and it produces .JSON file which will be fed into Cucumber Pie chart generator. Jenkin produces file when All Tests Succeeds, and produces Pie chart as well When any of the Test Step fails , It generates file with zero size (empty file) My project is setup using surefire plug in...I dont know if that matters... Thanks 回答1: The Way Cucumber exits..... //System.exit(stats.hadErrors() || stats.hadFailures() ? 1 : 0); System.exit(0); 来源:

running all cucumber scenarios for a feature in one browser session

本秂侑毒 提交于 2019-12-11 08:18:19
问题 I have below feature which have 2 scenarios when one scenario finish executing i want cucumbe to run 2nd scenario.Right now it when it finish executing one scenario it open another thread of browser and does not execute 2nd scenario. I dont want to open another thread, I want to execute the 2nd scenario after 1st in single browser thread. Feature: Add New Contact As a user, I want to insert new contact using Contacts link Scenario Outline: Insert a New Contact Given user clicks on contacts

Maven cucumber reporting with multi-module maven project

不羁的心 提交于 2019-12-11 03:55:53
问题 Background info: Maven version: 3.2.5 Java version: 1.8 Cucumber reporting version: 3.8.0 I have a multi-module maven java project. I have cucumber tests and the maven-cucumber-reporting plugin running and working for each module. Question: I would like to generate one large report with all cucumber.json files from the child modules included after all child modules have built. Can I: Run a maven plugin in the parent pom after all child modules have built and tested (with cucumber.json files

How to match these steps unambiguously in Cucumber-JVM?

冷暖自知 提交于 2019-12-11 03:33:34
问题 Is there any way to match the following steps unambiguously? And I should have 2 alerts And I should have 2 alerts with param 71 I have implemented them as: @And("^I should have (\\d+) alerts") @And("^I should have (\\d+) alerts with param (\\d+)") When Cucumber evaluates the second step it says that it is ambiguous because it could have matched either of the two step definitions, even though it has the extra words 'with param'. Thanks in advance. 回答1: And I should have 2 alerts with param 71

cucumber-testng 4.0 parallel execution defaults to 10 always

泄露秘密 提交于 2019-12-11 02:43:46
问题 Here is my cuke runner. I am trying to use inbuilt parallelism built in cucumber-jvm 4.0.0 by overriding dataprovider method. I see that my scenarios are invoked in parallel however the thread count defaults to 10 always. I tried executing with --threads options as state in GitHub but it doesnt work. mvn test -Dcucumber.options="--tags @test --threads 3" mvn test -Dcucumber.options="--threads 3" Tried both but still 10 threads are spawned by default. What am i missing here? I know there are

Cucumber-jvm @after with Appium driver

China☆狼群 提交于 2019-12-11 02:42:17
问题 I'm using cucumber-jvm , and trying to implement global @After method which should be executed only once after all scenario's execution was completed. The @After method should quit the appium driver. Currently @After hook being executed after each running scenario , and it means that the driver should be created each time from scratch , but I do want to reuse it. Any help will be much appreciated 回答1: You can try using QAF which support Gherkin, where driver management is taken care by the

How to execute Cucumber Spring Boot Packaged Jar from command line?

自闭症网瘾萝莉.ら 提交于 2019-12-11 02:34:36
问题 I am fairly new to cucumber-jvm world. Trying to package cucumber spring boot app as Jar. app runs fine from Eclipse. But when I package as executable jar it fails with Exception : Exception in Main Thread, No backend Module found. Make sure that you have backend module on CLASSPATH. Kindly help. Thank you. 回答1: From: https://github.com/cucumber/cucumber-jvm/issues/1320 SpringBoot uses a nested jar structure that requires the use of ApplicationContext.getResources to access it transparently.

How to invoke the Cucumber runner class from a different main method

白昼怎懂夜的黑 提交于 2019-12-11 01:43:45
问题 I'm new to using Command Line Interface. So I just have a question on how to invoke the runner class of the cucumber using CLI technique. I have a Java program which contains a main method. When testers pass the argument which is test case, it will fetch the feature file. The java program invoke a custom made API which will fetch the correct feature file. Next I'll have to invoke the Cucumber runner class to execute the test case. I need to pass this particular feature file as the argument.