cucumber-jvm

Cucumber options annotation

坚强是说给别人听的谎言 提交于 2019-11-30 08:27:54
The cucumber-jvm javadocs states that purpose of the glue element is to specify the location of the stepdefinitions and hooks. However, this doesn't seem to work for me. Lets say I have my features in directory a, and my step definitions in directory b. Then, @Cucumber.Options( features= "directory_a", glue="directory_b" ) will load my feature files from directory_a, but, it doesn't load my step definitions from directly_b. However, if I use @Cucumber.Options( features= {"directory_a", "directory_b"} ) then my features from directory_a is loaded, and my step definitions from directory_b are

SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()? (Selenium)

天涯浪子 提交于 2019-11-30 05:52:12
I am trying to write some selenium automated UI tests using Cucumber/Java. If I have only one test in my feature file, everything works fine. But if I add a second test, I get this error on driver.get() : org.openqa.selenium.remote.SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()? Build info: version: '2.51.0', revision: '1af067dbcaedd7d2ab9af5151fc471d363d97193', time: '2016-02-05 11:20:57' Basically, I am initializing the webdriver variable on the InitializeWebdriver class in one package, and then referencing it in the other (step definition) classes. I did

Cucumber Test a Spring Boot Application

大城市里の小女人 提交于 2019-11-30 03:01:40
Does anyone know where I can find a sample application where Cucumber is used to test a Spring Boot application through Gradle? I can run the tests fine starting the server on the cmd line and using my IDE, but I need to be able to run them all programmatically on the CI server. I saw the answer on here but that solution did not work for me, most likely because I have multiple step def files. Here is my setup build.grade (Mentioned in the other question) testCompile ("org.springframework.boot:spring-boot-starter-test", ... "info.cukes:cucumber-spring:${cucumberVersion}") CucumberTest.java

Dcucumber.options, how to have multiple tags

喜夏-厌秋 提交于 2019-11-30 02:05:41
I am trying run cucumber tests using maven with following command mvn test -Dcucumber.options="--tag @debug1" This command works fine, however if i try something like following, i get error mvn test -Dcucumber.options="--tag @debug1 @debug2" Is there a way to pass in multiple tag names with cucumber run-time options? To run scenarios with @debug1 and @debug2 : mvn test -Dcucumber.options="--tags @debug1 --tags @debug2" To run scenarios with @debug1 or @debug2 : mvn test -Dcucumber.options="--tags @debug1,@debug2" Little late to the party, but I am using something like: mvn test -D tags="debug1

Cucumber-JVM 3 - io.cucumber.datatable.UndefinedDataTableTypeException

[亡魂溺海] 提交于 2019-11-29 11:33:07
I updated from Cucumber-JVM 2.4.0 to 3.0.2 in my pom.xml and DataTables started throwing this exception: io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to List< jcucumberng.steps.pojos.Income >. Please register a DataTableType with a TableEntryTransformer or TableRowTransformer for class jcucumberng.steps.pojos.Income I changed all my imports to import io.cucumber.datatable.DataTable; I did an mvn clean install and compilation was successful but steps involving DataTables no longer work after the update. Current code: // Feature When I Enter My Regular Income

How to install Cucumber-JVM on Eclipse

跟風遠走 提交于 2019-11-29 09:46:45
I have searched all over the internet but a newbie on java I cant figure out how to simply install Cucumber-jvm on Eclipse. What files do I need to download? I already installed Eclipse. What do I need to do to get Cucumber-JVM on Eclipse? Chris If you mean the Cucumber plugin for Eclipse you can do this by: Open Eclipse, Click Help → Install New Software. Click Add button at right side of 'Work with' field. Give the Name say cucumber-eclipse and input the URL http://cucumber.github.com/cucumber-eclipse/update-site ' at Location field -> Click OK. Check the box 'Cucumber Eclipse Plugin'.

Exception in thread “main” cucumber.runtime.CucumberException: No backends were found

久未见 提交于 2019-11-29 09:31:24
I am developing my Selenium-JVM framework with Cucumber and while running my first feature got below error. Please help. How did I launch the feature - Right click on feature file Select Run As -> Cucumber Feature Immediate Exception - Exception in thread "main" cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.<init>(Runtime.java:78) at cucumber.runtime.Runtime.<init>(Runtime.java:67) at cucumber.runtime.Runtime.<init>(Runtime.java:63) at cucumber.api.cli.Main.run(Main.java:24) at cucumber.api

Cucumber JVM undefined step

霸气de小男生 提交于 2019-11-29 09:26:43
I can't execute a simple test with cucumber for a project. I am on Intellij 13 Community, with cucumber plugin. I wrote my feature file in my features directory, I have also implemented my steps, creating them with the help of the plugin. And my steps in the feature files are recognized by intellij, which can navigate and go to the step implementation. But when I try to run my scenario, it always fails because for each step, it says "Undefined step : ". Here is how is organized my project : And as I said before, you can see that my steps are recognized by Intellij : How is that possible, and

How to get a HTML table row with Capybara

断了今生、忘了曾经 提交于 2019-11-29 09:09:04
问题 I am trying to scan rows in a HTML table using partial href xpath and perform further tests with that row's other column values. <div id = "blah"> <table> <tr> <td><a href="afile?key=HONDA">link</a></td> <td>29 33 485</td> <td>45.2934,00 EUR</td> </tr> <tr> <td><a href="afile?key=HONDA">link</a></td> <td>22 93 485</td> <td>38.336.934,123 EUR</td> </tr> <tr> <td><a href="afile?key=something_else">link</a></td> <td>394 27 3844</td> <td>3.485,2839 EUR</td> </tr> </table> </div> In cucumber-jvm

Execute Cucumber step before/after a specific feature

落爺英雄遲暮 提交于 2019-11-29 05:27:55
I want to specify certain setup and tear down steps for each specific feature file. I've seen hooks that allows code to execute before every scenario, and hooks to execute code before each feature, but I want to specify code to run once before and after all scenarios run for one specific feature. Is this possible? Do you use cucumber-jvm? I found an article that fits your requirement. http://zsoltfabok.com/blog/2012/09/cucumber-jvm-hooks/ Basically, do not use JUnit @BeforeClass and @AfterClass for this, as they are unaware of Cucumber Hook Tags. You would want Init and Teardown methods to run