Questions tagged [cucumber-jvm]

1

votes
1

answer
68

Views

Parse integer list from Scenario outline's example table in cucumber java

I have to write a BDD test using cucumber with java and I would like to parse an integer list from every line of my example table and pass this list to my step method using the latest version of cucumber (4.2.6). So I got the following step definition in my feature file: Scenario Outline: Some scen...
Krisztián Józsa
1

votes
2

answer
27

Views

Cucumber-Why my step definition is not getting identified

I have written a step definition file but still its not getting identified,below is my feature,step definition,Runner file. Feature: Google Search feature Scenario: To verify search bar functionality Given user is on google search page When user enters a search keyword in a search bar And user click...
Good Vibes
1

votes
0

answer
444

Views

Donut report (donut-maven-plugin) is not getting generated when some of the tests fails

I am using Donut report (donut-maven-plugin) for aggregating a report for parallel cucumber tests ran using cucumber-jvm-parallel-plugin from github.temyers team. Here is my POM snippet: TestSuite1 true //src//test//java//envConfig//localGridConfig.properties @android @dummy browserstack.ios TestSui...
user2451016
1

votes
0

answer
293

Views

How to skip a scenario with Cucumber-JVM at run-time in JAVA

I need to skip a scenario from running based on a flag which I obtain from the application dynamically in run-time, which tells whether the feature to be tested is enabled. I don't want to throw any exception. Sample code: if (JIRA_Integration.equalsIgnoreCase('yes')) { status = zapi.getTestExecutio...
Deena P
1

votes
0

answer
95

Views

Maven-plugin execution in gradle

I've implemented an automated appium test for a mobile application using cucumber and a JUnit runner. In order to generate pretty reports, I'd like to use net.masterthought's maven-cucumber-reporting artifact. net.masterthought 3.9.0 execution verify generate TestingNo1 ${project.build.direc...
beware_bear
1

votes
1

answer
411

Views

Cucumber - global transform or expression

I would like to be able to map string from step to DTO in java. I found that I can do this with @Transform(DtoTransformer.class) annotation before each step definition where i need this (e.g. public void theDtoOfSomethingIs(@Transform(DtoTransformer.class) Dto currentDto) {...). The problem here is...
Bojan Vukasovic
1

votes
2

answer
1.2k

Views

Multiple Scenario outline and Example in two different features file. How can I reuse the Java steps from one feature file to another?

Multiple Scenario outline and Example in two different features file. How can I reuse the Java steps from one feature file to another? Feature -- > ANPost.feature ** Scenario outline : Verify csv file accept When User perform the post request with localhost Then Response contains 201 and response...
sri
1

votes
0

answer
1.2k

Views

Cucumber dependency injection @Scope(“cucumber-glue”) is not registered

Problem: I am trying to have a number of classes scoped once for every scenario of my cucumber parallel tests, as of right now I am getting data contamination because the data in which these 3 objects manage is leaking into subsequent scenarios. Firstly, I am configuring spring using the following d...
SimonK
1

votes
0

answer
53

Views

Cucumber step repeat NullPointerException

I am trying to run the feature a and feature b which has same steps like below feature a: Scenario Outline: Verify correct entity values When Performing the get request to localhost:''/'' Then The response status should be 200 and json body containing 'Apps is running' feature b: Scenario Outlin...
sri
1

votes
1

answer
258

Views

Uploading files using Karate REST API tool

I'm trying to upload images on specific slack channel using Karate but no luck, I tried multiple times with different steps but still have 200 response and the image is not displayed in the channel. Tried to post text content and successfully found the text on the channel. Bellow are 2 of my tries f...
1

votes
0

answer
282

Views

cucumber rerun failed tests java jenkins

How to clean cucumber report.json before rerun failed test with using maven-failsafe-plugin? I use jenkins + maven + cucumber-jvm-parallel-plugin + maven-failsafe-plugin. In case of using retry of maven-failsafe-plugin: ${rerunFailingTestsCount} It works pretty well, but in case of rerunFailingTest...
Dmitry K
1

votes
0

answer
427

Views

Serenity - Cucumber - Java - Aggregate Report is not being created (Maven)

I'm trying to generate the Serenity Reports in IntelliJ IDEA with Maven in Java with Cucumber and Serenity. This is my runner: import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; import org.junit.runner.RunWith; @RunWith(CucumberWithSerenity.class) @CucumberOpt...
nosequeweaponer
1

votes
0

answer
235

Views

Gradle Plugin to generate cucumber report not compiling

I am writing Cucumber Automated Test Cases in java, using REST Assured. All the tests run as JUnit tests, & as Gradle tests, & they all pass successfully. The next step I need to take is to generate a Cucumber Report based on these test results. I've been told that I need to find a gradle plugin for...
1

votes
0

answer
128

Views

Activity clean up in AndroidTest with Cucmber and RxJava

I observe a weird stack trace at the end of my cucumber test. I base my test on the cucumber-jvm android example. I do some async process in a @Then method with RxJava2. Without async process all is fine. The test is a sucess but something happened during the @After cucumber method. It seems that...
colin aygalinc
1

votes
0

answer
272

Views

Test Runner class is not running but able to execute the feature file

I have given correct step definition class, but when I tried to execute the Test Runner class , it not executing. But when I run the feature file, the test is getting executed. Also my code was working before with my existing code and all on a sudden it is not getting executed when I try to run the...
Baburaj V
1

votes
0

answer
257

Views

How to attach screenshot in detailed cucumber report (mkolisnyk)

I was able to see the screenshot when i was using info.cukes but after upgrading to io.cucumber 3.0.1 screenshot disappear. I can see its embedded in json report file but not showing in html report generated by mkolisnyk library. it stop generating screenshot folder. public void generateCucumberRepo...
bugCracker
1

votes
0

answer
204

Views

How do I retrieve scenario failure message (cucumber jvm) in the After hook?

I have been able to get scenario failure status using scenario.isFailed() but not the error message that gets displayed in the stacktrace.
Safari Gisa
1

votes
1

answer
103

Views

access scenario object in cucumber in a particular step in cucumber java

I want to access the current scenario object in a particular step and write specific dynamic data into report. @Before public void before(Scenario scenario) { this.scenario = scenario; } And in step: this.scenario.write(dynamicValue); but when I am using this method and trying to access the scenari...
13th Ghost
1

votes
1

answer
265

Views

Karate: how to pass dynamic path parameters?

Suppose I have test scenario with exact same requirements but one path variable change as follows: Scenario: Some scenario Given path /mypath/param1 When method get Then status 200 I need to run the same test for /mypath/param2, /mypath/param3 as well. Is there a simpler way to do it without requi...
1

votes
0

answer
291

Views

NoClassDefFoundError:gherkin/IGherkinDialectProvider in cucmber while running as junit. why do we receive this error and how to resolve this?

NoClassDefFoundError:gherkin/IGherkinDialectProvider was observed while running a cucumber program can anyone help me to understand reason of this error and how to resolve this. refer screenshot. Thank you.enter image description here
SuperShazam
1

votes
3

answer
260

Views

How to change the Cucumber Scenario result into the @After hook

I want to change the scenario status for known issues into the After hook. Something like: @After public void afterScenario(Scenario scenario) { if(scenario.isFailed() && scenario.getSourceTagNames().contains('knownIssue')){ //scenario.add(Result.SKIPPED) } } The idea is tests, which fail because o...
Nayden Tatarliev
1

votes
0

answer
100

Views

Cucumber: Running features parallely in 4.2

As announced, cucumber had released parallel feature on version 4.0 but I could not find any sample code regard this. Can anyone provide a sample cucumber-jvm testng implementation in 4.0 onward. Thanks.
nicholas
1

votes
1

answer
198

Views

Cucumber 4 with Spring Boot and JPA

I am using cucumber + cucumber-spring 4.1 for testing a SpringBoot 2.1 application. This has scenarios that require the database to be rolled back between each scenario, but for the life of me cannot get it to work. I have tried: A base class with several annotations ` @Transactional @RunWith(Sprin...
Rollo Tomassi
1

votes
0

answer
101

Views

How to run scenario outline multiple time for list of data

I want to run my scenario outline examples more than once with different set of data and data is dynamic for examples. For eg: I am having java List say L which contains values of country like USA, INDIA UK and so on.(which will generated dynamically) and I want to run my examples with set of data f...
Sumit Bhardwaj
1

votes
0

answer
126

Views

cucumber-jvm-parallel-plugin error with glue parameter

I'm trying to use the cucumber-parallel-plugin for the first time. When I try to run the generateRunners goal I always get an error that my glue-Parameter is missing or have an error... By the way I try to use this plugin with kotlin. Here are some relevant pom-snippets: src/test/kotlin com.github.t...
Boris
1

votes
1

answer
39

Views

Dynamically load step definition file from jar

I have a Gherkin executor where I execute my feature files. What I would like to do would be to add a StepDefinition file from an other jar. The user would be able to use my project with the step def that I have already wrote but he would also be able to add custom definitions from his own jar file....
Gersi Tuzi
1

votes
2

answer
113

Views

Unable to invoke Cucumber Tests for Android app in Java

I wanted to run cucumber tests. I am unable to invoke or to run these tests. This is what I have done: In app/build.gradle defaultConfig { testApplicationId 'com.my.app.test' testInstrumentationRunner 'com.my.app.test.CucumberInstrumentation' } sourceSets { androidTest { assets.srcDirs = ['src/andro...
Sajid Zeb
1

votes
0

answer
103

Views

cucumber-testng 4.0 parallel execution defaults to 10 always

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...
Bhuvanesh Mani
1

votes
1

answer
42

Views

If one scenario fails continue with next Scenario in a cucumber feature file

How can I continue running a feature on failure of 1 scenario to next? Currently if first Scenario fails out of 10 (lets say) next 9 will not execute and it quits current session on driver/browser (WebDriver). I am using Cucumber with Java, Junit, Serenity on Windows 7.
paul
1

votes
0

answer
26

Views

TestNG Assertion doesn't seem to be working with Cucumber / Gherkin Doc Strings?

Iam currently attempt to use Cucumber Doc Strings, more information here: https://docs.cucumber.io/gherkin/reference/#gherkin-dialects however my code seems to be failing using a TestNG assertion to compare the feature file String against the String which is housed within my step file, any ideas? M...
SamP
1

votes
1

answer
23

Views

Cucumber JVM - get reference to all scenarios

is there possibility to get reference to ALL scenarios in Cucumber JVM? Problem: I need to pragmatically count some statistics about scenarios (failed, total count, etc) For failed, I could create @After hook, and bump variable that holds number of failed scenarios: @After(order = 1) public void onS...
Matthewek
1

votes
0

answer
18

Views

Implement Cucumber “cucumber.api.java8.En” interface by step definition class

What is the purpose of implementing 'cucumber.api.java8.En' interface by cucumber step definition classes?.
1

votes
1

answer
78

Views

How to get the Cucumber steps and attachments in Allure report?

I am able to generate allure report in a java-cucumber-Junit based Project. However, I am unable to get the cucumber steps in the execution section. Also, The attachments are not getting attached to the reports. I am able to generate the Allure report based on the steps given on Allure site. Howeve...
user7645022
1

votes
1

answer
53

Views

loop a feature file on the given data

Background: There are more than 500 users. Their user name and password are stored in a CSV file. Each user must pass this .feature file which consists of 18 scenarios. Problem: I know we can use data tables, scenario outline, but data mentioned here will be limited to associated scenarios only not...
paul
1

votes
1

answer
2.2k

Views

cucumber-jvm with html formatter producing blank page

The HTML formatter for cucumber-jvm was working for me yesterday. Today, when I run the tests, I get the following content in the index.html that gets produced. All of the other supporting files (style.css, formatter.js, etc.) are there: Cucumber Features The report.js file contains the correct cont...
Lee
1

votes
2

answer
1.6k

Views

cucumber-jvm java not generating step skeletons

Running in Eclipse Juno. @RunWith(Cucumber.class) @Cucumber.Options(format={'pretty', 'html:target/cucumber'}) public class RunTests { } In the console window I see: Feature: Depositing money Scenario: Sunny day [90m# deposit.feature:3[0m Given: I have an Account with a balance of $100 When: I depos...
Bob
1

votes
1

answer
669

Views

resultset is closed exception on first iteration of .next()

i cant figure out why my resultset is throwing the exception.. Resultset object is not null in debugging, however it cannot enter the if statement if(resultset.next()) I'm not sure what i'm doing wrong.. Thanks for any help. by the way, i'm accessing this class through a cucumber test, however at...
cianBuckley
1

votes
1

answer
325

Views

cucumber-jvm: how to use the same window instance across all the tests

I am using cucumber-jvm with groovy and fest to test a Swing application. Every time a scenario is run the main window app is created (and destroyed at the end). How can I avoid it? How can I run the same instance of the window across all the features?
Randomize
1

votes
1

answer
895

Views

Accessing the cucumber test from StepDefs

When creating a cucumber test, one defines a featurefile with the defined tests and a classfile with the exact same name in the same package to run the test. (I'll leave the Cucumber.options for what they are at the moment). As far as I understood it correctly, Cucumber will look in that same packag...
1

votes
1

answer
1.6k

Views

Cucumber Reports Plugin for Jenkins: Not handling steps and tags properly

I have a Jenkins build that takes JSON output from a jruby/cucumber test and generates reports using the Cucumber Reports plugin. The plugin is only giving me sensible reports on a feature file basis: that is, it can tell me whether a feature file passed or not, but not any given step. When I expect...
David West

View additional questions