Hi Niraj, I followed your steps to generate a Cucumber-JVM report using TestNG and Maven. My Cucumber tests ran fine through Maven. The report got generated but it says there are no features in your cucumber report. When I check my cucumber.json file, it is empty. Please assist.
Hi Niraj, with 3.15.0 maven-cucumber-reporting I am unable to generate the report. The jar does not appear/download in maven dependency. Do you have any resent update on this ?
Is there a way we can edit the titles of the Cucumber Report table?(i.e in this one it says Steps, Scenaros and Features but I want to change the string for those)
1. You can embed the screen shot using scenario.embed in @After tag @After public void teardown(Scenario scenario){ scenario.embed(screnshot,filetype) } 2yes you can change the name of the report according to your need
1. you can embed the screen shot in @After Anotation if (scenario.isFailed()) { System.out.println("################### i am inside screen shot after fail ####################"); final byte[] screenshot = ((TakesScreenshot) seleniumUtil.getDriver()).getScreenshotAs(OutputType.BYTES); scenario.embed(screenshot, "image/png"); // stick it in the report } 2.Report in Desired naming format not possible.you can point to the folder where to generate
Thanks for the video. Very useful comparing to default cucumber html visualization. Do you kno if there is a way to mark feature as successfull when some steps are pending?
Hi Niraj, I received compilation error for maven-compiler-plugin:3.5.1:test compile. I added as true for both surefire and compiler but still I am getting the error. Project is running on jdk 1.8 Please help
build.gradle--/* * This file was generated by the Gradle 'init' task. * * This generated file contains a sample Java Library project to get you started. * For more details take a look at the Java Libraries chapter in the Gradle * User Manual available at docs.gradle.org/6.0/userguide/java_library_plugin.html */ plugins { // Apply the java-library plugin to add support for Java Library id 'java-library' //id "net.masterthought.maven-cucumber-reporting" version "5.0.0" //id "com.github.spacialcircumstances.gradle-cucumber-reporting" id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.0.11" } repositories { // Use jcenter for resolving dependencies. // You can declare any Maven/Ivy/file repository here. mavenLocal() jcenter() gradlePluginPortal() mavenCentral() //maven { url 'plugins.gradle.org/m2/' } maven { url "plugins.gradle.org/m2/" } } dependencies { // This dependency is exported to consumers, that is to say found on their compile classpath. api 'org.apache.commons:commons-math3:3.6.1' // This dependency is used internally, and not exposed to consumers on their own compile classpath. implementation 'com.google.guava:guava:28.0-jre' // mvnrepository.com/artifact/net.masterthought/cucumber-reporting //compile group: 'net.masterthought', name: 'maven-cucumber-reporting', version: '5.0.0' //compile group: 'gradle.plugin.com.github.spacialcircumstances', name: 'gradle-cucumber-reporting', version: '0.1.15' // Use JUnit test framework testImplementation 'junit:junit:4.12' testImplementation 'io.cucumber:cucumber-java:4.8.0' testImplementation 'io.cucumber:cucumber-junit:4.8.0' }
But the question is how to send this report in gmail as it create multiple html file and cs files which are interdependent. We could not send a single html file in Gmail, we need to send a whole folder. After creating a zip for this folder gmail not allow to send it... So what's the solution, how can we send this report in Gmail?
Hello Niraj Thnak you for the quality of explanation. Can you Share with me the Maven project . I was blocked for many days trying to find a solution on cucumber jenkins reports. Kindly
Hello Niraj I have followed your same process exactly as you explained but json file is not generating but the JVM report is there with an error and out of any data. can you please help this the error failed to execute goal net.masterthought:maven-cucumber-reporting:5.0.0:generate (execution) on project kh-cucumber-labs: Error Found:
@@nadaaljohani5432 look like your test is failing due to which cucumber.json is not generating in target folder.please use-- org.apache.maven.plugins maven-surefire-plugin 2.19.1
You can send the html report in jenkin Follow below steps to embed html file in emailcontent: Go to your jenkins job and click on Configure. Go to Post Build Actions and then select Editable Email Notifications. Select Content Type as HTML(text/plain) In the default content section replace $DEFAULT_CONTENT with following.
You can email your report-Click the ‘Add post-build action’ drop-down and select the ‘Editable Email Notification’ value. Fill the ‘Editable Email Notification’ fields. Project Recipient List : email_id@gmail.com
Hi Niraj, Thanks for the video.I followed the same procedure adding the below plugin to my pom but report is not getting generated and I can see warning not able to find cucumber.jsion file.could you please help me .I think after giving clean install command it is deleting all the files in the target folder and in this process it is deleting cucumber.json file so report is not getting generated.could you please help me. . net.masterthought maven-cucumber-reporting 2.8.0
what is the path of your cucumber.json report it shoul be in target folder.Please check your runner class is your test is failing then you need to add this testfailureIgnore in testNg-- org.apache.maven.plugins maven-surefire-plugin 2.20
true
if you are using latest version of maven cucumber report then use below configuration posted in comment
Good Morning How are you ... You are doing a great job yours videos are user friendly .... Question : I have 35 test case in my frame work and i wanted to run smoke test . So what I did i have put all test cases in a new feature file name smoke.feature and now when i am running this feature file I am getting an error " Invalid Session Id " . I will appreciate if you please help me fix this error ..... All of my test cases are working great individually ...... Thank you You have a nice day Frank
I will suggest you to not create separate feature file for smoke.Better you tag all your smoke scenario in feature file as @smoke and run your test using same tag.
Failed to execute goal net.masterthought:maven-cucumber-reporting:4.10.0:generate (execution) on project BDD: Execution execution of goal net.masterthought:maven-cucumber-reporting:4.10.0:generate failed: A required class was missing while executing net.masterthought:maven-cucumber-reporting:4.10.0:generate: org/apache/commons/configuration/ConfigurationException
plugins { // Apply the java-library plugin to add support for Java Library id 'java-library' //id "net.masterthought.maven-cucumber-reporting" version "5.0.0" //id "com.github.spacialcircumstances.gradle-cucumber-reporting" id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.0.11" } repositories { // Use jcenter for resolving dependencies. // You can declare any Maven/Ivy/file repository here. mavenLocal() jcenter() gradlePluginPortal() mavenCentral() //maven { url 'plugins.gradle.org/m2/' } maven { url "plugins.gradle.org/m2/" } } dependencies { // This dependency is exported to consumers, that is to say found on their compile classpath. api 'org.apache.commons:commons-math3:3.6.1' // This dependency is used internally, and not exposed to consumers on their own compile classpath. implementation 'com.google.guava:guava:28.0-jre' // mvnrepository.com/artifact/net.masterthought/cucumber-reporting //compile group: 'net.masterthought', name: 'maven-cucumber-reporting', version: '5.0.0' //compile group: 'gradle.plugin.com.github.spacialcircumstances', name: 'gradle-cucumber-reporting', version: '0.1.15' // Use JUnit test framework testImplementation 'junit:junit:4.12' testImplementation 'io.cucumber:cucumber-java:4.8.0' testImplementation 'io.cucumber:cucumber-junit:4.8.0' }
Niraj Gupta 9 months ago Little bit of change in pom .xml for maven cucumber report version greater then 3.16.0 -- net.masterthought maven-cucumber-reporting 5.0.0
I tried with above code on version 4.9.0 but i am getting error as About to generate cucumber report Net.masterthought.cucumber.reportbuilder generate error page Info unexpected error Can you please help with solution
We need only the runner class and pom.xml to generate this report.Please find the Pom.xml Please add this plugin in ypur pom.xml net.masterthought maven-cucumber-reporting 3.6.0
execution verify
generate
cucumber-jvm-example this is similar report as jenkins report ${project.build.directory}/cucumber-JVM-reports
plugins { // Apply the java-library plugin to add support for Java Library id 'java-library' //id "net.masterthought.maven-cucumber-reporting" version "5.0.0" //id "com.github.spacialcircumstances.gradle-cucumber-reporting" id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.0.11" } repositories { // Use jcenter for resolving dependencies. // You can declare any Maven/Ivy/file repository here. mavenLocal() jcenter() gradlePluginPortal() mavenCentral() //maven { url 'plugins.gradle.org/m2/' } maven { url "plugins.gradle.org/m2/" } } dependencies { // This dependency is exported to consumers, that is to say found on their compile classpath. api 'org.apache.commons:commons-math3:3.6.1' // This dependency is used internally, and not exposed to consumers on their own compile classpath. implementation 'com.google.guava:guava:28.0-jre' // mvnrepository.com/artifact/net.masterthought/cucumber-reporting //compile group: 'net.masterthought', name: 'maven-cucumber-reporting', version: '5.0.0' //compile group: 'gradle.plugin.com.github.spacialcircumstances', name: 'gradle-cucumber-reporting', version: '0.1.15' // Use JUnit test framework testImplementation 'junit:junit:4.12' testImplementation 'io.cucumber:cucumber-java:4.8.0' testImplementation 'io.cucumber:cucumber-junit:4.8.0' }
Niraj Gupta thank you sir. One more question . My mgmt wanted to change the title in the report change feature in report to test case .is it possible to edit the jar and can u please give me an idea please
Hi Niraj. Thank you for the video. It helps me to configure the Cucumber Reporting for Karate Framework. I need one help. The import files are not visible in your video in RUNNER file 'TestRunner.java.' It will be helpful if you can share the TestRunner.java file
Niraj very simple and best explaination
Little bit of change in pom .xml for maven cucumber report version greater then 3.16.0 --
net.masterthought
maven-cucumber-reporting
5.0.0
execution
verify
generate
cucumber-jvm-example
${project.build.directory}/cucumber-JVM-reports
true
42
false
${project.build.directory}
**/*.json
true
true
hello Sir, There s a duration problem while compared to JUnit.Junit shows in seconds, while this one takes half of the time from Junit
Hi Niraj,
I followed your steps to generate a Cucumber-JVM report using TestNG and Maven. My Cucumber tests ran fine through Maven. The report got generated but it says there are no features in your cucumber report. When I check my cucumber.json file, it is empty. Please assist.
Please this line in you pom.xml-true under surefire plugin like this--
org.apache.maven.plugins
maven-surefire-plugin
2.22.2
true
Please send me your execution console
Hi Niraj, with 3.15.0 maven-cucumber-reporting I am unable to generate the report. The jar does not appear/download in maven dependency. Do you have any resent update on this ?
yes small changes hs been done after 3.15.0
net.masterthought
maven-cucumber-reporting
5.0.0
execution
verify
generate
cucumber-jvm-example
${project.build.directory}/cucumber-JVM-reports
true
42
false
${project.build.directory}
**/*.json
true
true
Is there a way we can edit the titles of the Cucumber Report table?(i.e in this one it says Steps, Scenaros and Features but I want to change the string for those)
No it's not possible. you can change only title
Hi Niraj,
1. How did you get the screenshot added in the report?
2. Also is there a possibility that i get the reports in my desired naming format?
1. You can embed the screen shot using scenario.embed in @After tag
@After
public void teardown(Scenario scenario){
scenario.embed(screnshot,filetype)
}
2yes you can change the name of the report according to your need
1. you can embed the screen shot in @After Anotation
if (scenario.isFailed()) {
System.out.println("################### i am inside screen shot after fail ####################");
final byte[] screenshot = ((TakesScreenshot) seleniumUtil.getDriver()).getScreenshotAs(OutputType.BYTES);
scenario.embed(screenshot, "image/png"); // stick it in the report
}
2.Report in Desired naming format not possible.you can point to the folder where to generate
@@NirajGupta Is it possible to create a new folder each time when a report is generated?
@@gokulvenugopal6991 yes you can.
@@gokulvenugopal6991 yes we can configure the new folder when each time test execute
hello is there any way I can embed the overview feature.html to email notiications? i tired to do it but the formatting and colors are gone
If you attached other folder like css, image, js and front and download all in single folder then formatting and colors will display
Thanks for the video. Very useful comparing to default cucumber html visualization. Do you kno if there is a way to mark feature as successfull when some steps are pending?
Remove throw new PendingException(); from your steps.
Hi Niraj,
I received compilation error for maven-compiler-plugin:3.5.1:test compile.
I added as true for both surefire and compiler but still I am getting the error. Project is running on jdk 1.8
Please help
can you please copy paste the error you are getting
@@NirajGupta problem resolved. I was using JRE! Changed to JDK
Hi sir, could you please share entire pom file?
@Niraj Gupta Could you please provide the equivalent gradle script please(gradle.build)
Hello Sandeep, have you cracked this? I
am also looking for Gradle implementation of this report
I am also looking for grader.
build.gradle--/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at docs.gradle.org/6.0/userguide/java_library_plugin.html
*/
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
//id "net.masterthought.maven-cucumber-reporting" version "5.0.0"
//id "com.github.spacialcircumstances.gradle-cucumber-reporting"
id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.0.11"
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
jcenter()
gradlePluginPortal()
mavenCentral()
//maven { url 'plugins.gradle.org/m2/' }
maven {
url "plugins.gradle.org/m2/"
}
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:28.0-jre'
// mvnrepository.com/artifact/net.masterthought/cucumber-reporting
//compile group: 'net.masterthought', name: 'maven-cucumber-reporting', version: '5.0.0'
//compile group: 'gradle.plugin.com.github.spacialcircumstances', name: 'gradle-cucumber-reporting', version: '0.1.15'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
testImplementation 'io.cucumber:cucumber-java:4.8.0'
testImplementation 'io.cucumber:cucumber-junit:4.8.0'
}
cucumberReports {
//doLast {
//println 'tutorialspoint'
outputDir = file('target/cucumber-JVM-reports')
//buildId = '0'
reports = files('target/cucumber.json')
//}
}
buildNumber how to get dynamically if two reports generated?
you need to write code to parse the html report to get build number
HI Niraj,
I'm getting this error "Failed to parse plugin descriptor for net.masterthought:cucumber-reporting". Can you help me to resolve this issue?
Please paste your pom.xml and runner class
But the question is how to send this report in gmail as it create multiple html file and cs files which are interdependent. We could not send a single html file in Gmail, we need to send a whole folder. After creating a zip for this folder gmail not allow to send it... So what's the solution, how can we send this report in Gmail?
You can zip and send in gmail.its possible send zip file in gmail
Hello Niraj
Thnak you for the quality of explanation.
Can you Share with me the Maven project .
I was blocked for many days trying to find a solution on cucumber jenkins reports.
Kindly
Just add the below plugin in your pom.xml.i will post the full ppm.xml if you required.nothing else is required
Hello Niraj
I have followed your same process exactly as you explained but json file is not generating but the JVM report is there with an error and out of any data. can you please help
this the error
failed to execute goal net.masterthought:maven-cucumber-reporting:5.0.0:generate (execution) on project kh-cucumber-labs: Error Found:
Yes I wil help you.send me your pom.xml and runner class
@@NirajGupta pom.xml
com.bryandollery
kh-cucumber-labs
1.0-SNAPSHOT
UTF-8
11
11
net.masterthought
maven-cucumber-reporting
5.0.0
execution
verify
generate
cucumber-jvm-example
${project.build.directory}/cucumber-JVM-reports
true
42
false
${project.build.directory}
target/cucumber.json
true
true
com.vimalselvam
cucumber-extentsreport
3.1.1
test
io.cucumber
cucumber-java
5.6.0
test
io.cucumber
cucumber-junit
5.6.0
test
org.seleniumhq.selenium
selenium-java
3.141.59
test
byte-buddy
net.bytebuddy
org.mockito
mockito-core
3.3.3
test
junit
junit
4.12
test
com.aventstack
extentreports
3.1.2
com.aventstack
extentreports-cucumber4-adapter
1.0.12
net.masterthought
cucumber-reporting
5.3.0
4.0.0
/----------------------------------------classRunner----------------------------------/
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "summary","html:target/cucumber-reports", "junit:target/cucumber.xml", "json:target/cucumber.json"},
strict = true,
snippets = CAMELCASE,
tags = "not @wip",
features = "src/test/resources")
public class TestRunner {
static {
System.setProperty("webdriver.chrome.driver", "/chromedriver.exe");
System.setProperty("webdriver.chrome.silentOutput", "true");
getLogger("org.openqa.selenium").setLevel(SEVERE);
}
}
@@NirajGupta I'm waiting for your help
@@nadaaljohani5432 look like your test is failing due to which cucumber.json is not generating in target folder.please use--
org.apache.maven.plugins
maven-surefire-plugin
2.19.1
**/TestRunner*.class
true
use same code in .pom.xml--
net.masterthought
maven-cucumber-reporting
5.0.0
execution
verify
generate
cucumber-jvm-example
${project.build.directory}/cucumber-JVM-reports
true
42
false
${project.build.directory}
**/*.json
true
true
Good Explanation in detail. How can I email this overview-feature.html from Jenkins?
You can send the html report in jenkin Follow below steps to embed html file in emailcontent:
Go to your jenkins job and click on Configure.
Go to Post Build Actions and then select Editable Email Notifications.
Select Content Type as HTML(text/plain)
In the default content section replace $DEFAULT_CONTENT with following.
You can email your report-Click the ‘Add post-build action’ drop-down and select the ‘Editable Email Notification’ value.
Fill the ‘Editable Email Notification’ fields.
Project Recipient List : email_id@gmail.com
@@NirajGupta hi sir ,, what should i need to mention to send html report in jenkins
@@naani55 post build section you need to add action to sen mail notification just configure the cucumber.json file path. put path as **/*.json
How to do this in Katalon Studio?
When I run project with Maven and put Clean Install appear the message "ERROR StatusLogger No log4j2 configuration file found."
Please place your log4j.xml file under sec/test/resources
I don't know where is located log4j2.xml file.
@@pv9835 add the log4j.xml file under resiurce .I mean src/test/resorces
@@NirajGupta r u saying log4j.properties file? i dont see any log4j.xml in my project folder
@@raghurao300 please add the log4j.properties file
Hi Niraj,
Thanks for the video.I followed the same procedure adding the below plugin to my pom but report is not getting generated and I can see warning not able to find cucumber.jsion file.could you please help me .I think after giving clean install command it is deleting all the files in the target folder and in this process it is deleting cucumber.json file so report is not getting generated.could you please help me.
.
net.masterthought
maven-cucumber-reporting
2.8.0
execution
verify
generate
workflow
${project.build.directory}/cucumber-report-html
${project.build.directory}/cucumber-reports/cucumber.json
what is the path of your cucumber.json report it shoul be in target folder.Please check your runner class is your test is failing then you need to add this testfailureIgnore in testNg--
org.apache.maven.plugins
maven-surefire-plugin
2.20
true
if you are using latest version of maven cucumber report then use below configuration posted in comment
Good Morning
How are you ... You are doing a great job yours videos are user friendly ....
Question : I have 35 test case in my frame work and i wanted to run smoke test .
So what I did i have put all test cases in a new feature file name smoke.feature and now when i am running this feature file I am getting an error " Invalid Session Id " .
I will appreciate if you please help me fix this error .....
All of my test cases are working great individually ......
Thank you
You have a nice day
Frank
I will suggest you to not create separate feature file for smoke.Better you tag all your smoke scenario in feature file as @smoke and run your test using same tag.
Failed to execute goal net.masterthought:maven-cucumber-reporting:4.10.0:generate (execution) on project BDD: Execution execution of goal net.masterthought:maven-cucumber-reporting:4.10.0:generate failed: A required class was missing while executing net.masterthought:maven-cucumber-reporting:4.10.0:generate: org/apache/commons/configuration/ConfigurationException
I have added cucumber reporting dependency 4.10 and i am getting this error
Can we attach screenshots of failed scenarios with this report?
yes.Please watch this video-ruclips.net/video/_4z2F5_wW6k/видео.html
Hi Niraj, can you please share the configuration with gradle
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
//id "net.masterthought.maven-cucumber-reporting" version "5.0.0"
//id "com.github.spacialcircumstances.gradle-cucumber-reporting"
id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.0.11"
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
jcenter()
gradlePluginPortal()
mavenCentral()
//maven { url 'plugins.gradle.org/m2/' }
maven {
url "plugins.gradle.org/m2/"
}
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:28.0-jre'
// mvnrepository.com/artifact/net.masterthought/cucumber-reporting
//compile group: 'net.masterthought', name: 'maven-cucumber-reporting', version: '5.0.0'
//compile group: 'gradle.plugin.com.github.spacialcircumstances', name: 'gradle-cucumber-reporting', version: '0.1.15'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
testImplementation 'io.cucumber:cucumber-java:4.8.0'
testImplementation 'io.cucumber:cucumber-junit:4.8.0'
}
cucumberReports {
//doLast {
//println 'tutorialspoint'
outputDir = file('target/cucumber-JVM-reports')
//buildId = '0'
reports = files('target/cucumber.json')
//}
}
Could you please share your Github repository
which code do you need?
@@NirajGupta BDD cucumber framework, including cucumber reporting
@@MuraliRajamanickam github.com/callnirajgupta/CucumberSelenium
Hi niraj its giving me error as jvm not found
please send me entire error message
Niraj gupta
Jvm report local is not generating please can u help
Please send me pom dependencies
Test runner class as well
Niraj Gupta
9 months ago
Little bit of change in pom .xml for maven cucumber report version greater then 3.16.0 --
net.masterthought
maven-cucumber-reporting
5.0.0
execution
verify
generate
cucumber-jvm-example
${project.build.directory}/cucumber-JVM-reports
true
42
false
${project.build.directory}
**/*.json
true
true
I tried with above code on version 4.9.0 but i am getting error as
About to generate cucumber report
Net.masterthought.cucumber.reportbuilder generate error page
Info unexpected error
Can you please help with solution
Can u share the pom.xml file
Can we do similarly for pychram ?
Are you trying in python or java
@@NirajGupta Python. if you already have content how to do in python. please share me the link
@@satishtesting19 Python I am working on it.
@@NirajGupta Can you do a presentation using pycharm comunity version. how to execute BDD framework
@@satishtesting19 sure
How to generate reports for python BDD, Please help
I am work on it.Give me some time
Could you share with us the source code ?
We need only the runner class and pom.xml to generate this report.Please find the Pom.xml
Please add this plugin in ypur pom.xml
net.masterthought
maven-cucumber-reporting
3.6.0
execution
verify
generate
cucumber-jvm-example
this is similar report as jenkins report
${project.build.directory}/cucumber-JVM-reports
${project.build.directory}/cucumber.json
true
true
42
you can change the path of cucumber.json report and cucumber JVM report according to your need
@@NirajGupta Could you please provide the equivalent gradle script please(gradle.build)
@@rebekamontana7656 Please watch this video-- for merging multiple report in single report
ruclips.net/video/wFNHFKuxSEw/видео.html
how can i use this using gradle
Please comment for gradle
Please look comment for gradle
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
//id "net.masterthought.maven-cucumber-reporting" version "5.0.0"
//id "com.github.spacialcircumstances.gradle-cucumber-reporting"
id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.0.11"
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
jcenter()
gradlePluginPortal()
mavenCentral()
//maven { url 'plugins.gradle.org/m2/' }
maven {
url "plugins.gradle.org/m2/"
}
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:28.0-jre'
// mvnrepository.com/artifact/net.masterthought/cucumber-reporting
//compile group: 'net.masterthought', name: 'maven-cucumber-reporting', version: '5.0.0'
//compile group: 'gradle.plugin.com.github.spacialcircumstances', name: 'gradle-cucumber-reporting', version: '0.1.15'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
testImplementation 'io.cucumber:cucumber-java:4.8.0'
testImplementation 'io.cucumber:cucumber-junit:4.8.0'
}
cucumberReports {
//doLast {
//println 'tutorialspoint'
outputDir = file('target/cucumber-JVM-reports')
//buildId = '0'
reports = files('target/cucumber.json')
//}
}
Niraj Gupta thank you sir. One more question . My mgmt wanted to change the title in the report change feature in report to test case .is it possible to edit the jar and can u please give me an idea please
@@kowsalyavijayan2024 Feature can't be renamed because in cucumber we refere as feature
Hi Niraj. Thank you for the video. It helps me to configure the Cucumber Reporting for Karate Framework. I need one help. The import files are not visible in your video in RUNNER file 'TestRunner.java.' It will be helpful if you can share the TestRunner.java file
Sure I will shortly
package com.AbstractSubmission.action;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources/Featurefile/", tags = {
"@table1" }, plugin = {"pretty", "html:target/cucumber-html-report",
"json:target/cucumber.json", "junit:target/cucumber.xml"}, glue = { "com.learn" })
public class TestRunner {
@BeforeClass
public static void beforeall(){
System.out.println("Before all suit");
}
@AfterClass
public static void all(){
System.out.println("After All Suit");
}
}
@@NirajGupta what is the relevance of property buildSuccessOnTestFailure?
@@rkiran416 if test fail then also report will generate .if you have used attribute in surefire then no need to mention
Hi Niraj,Is there a way to merge multupe cucumber jvm report into one.Please share if any.Thanks in Advance.
Just update the plugin it will merge multiple json into single JVM report
net.masterthought
maven-cucumber-reporting
5.0.0
execution
verify
generate
cucumber-jvm-example
${project.build.directory}/cucumber-JVM-reports
true
42
false
${project.build.directory}
**/*.json
true
true
@@NirajGupta Many thanks Niraj.