Open p00rni opened 3 years ago
I DO HAVE THE FOLLOWING DEPENDANCIES IN POM AND HAVE THE EXTENT-CONFIG.XML AND PROPERTIES FILE
What is the dialect or language? The PDF uses an open source font family - Liberation for display and some languages are not supported. U can refer to this this comment for more details - https://ghchirp.tech/2224/#comment-2035
Have u tried the reference project to create the pdf report? https://github.com/grasshopper7/cuke6-extent-adapter-report
U just need to add the extentreports-cucumber6-adapter dependency in POM. Rest are transitive dependencies ( extentreports and extent-pdf-report).
Hi, Thank you for a quick response. having got the right dependancies i see pdf report generates fine now.
I am running 3 tests simultaniously (in 3 diff browser platforms) - the html report gives a consolidated view of all the 3 tests. this is where the pdf generating crashes.
when we run only one test - (in only one browser) - pdf generation works
but not when multiple tests are run . any directions to this would be helpful. (is ther anyway to do tis without having to change my framework towards parallel execution approach? )
If there are multiple runners then do not use the adapter plugin method for creating PDF report. Multiple threads cannot access a single PDF file for writing. This is also mentioned in the article - https://ghchirp.tech/2098/, search for 'PDF Extent Report' section for more details.
Two other ways of creating the PDF report.
First method - Generate the PDF report by using a Maven plugin which will execute in the 'post-integration-test' phase. This uses the cucumber JSON report. The other extent report like Spark can be generated by the existing adpater plugin. Refer to https://ghchirp.tech/2224/, section 'Cucumber Maven Report Plugin'.
Second method - Generate all reports by using a Maven plugin which will execute in the 'post-integration-test' phase. This also uses the cucumber JSON report. No need for adding the adapter plugin to the runners. Refer to https://ghchirp.tech/2114/.
thank you
i have the following tests in my testng.xml and only 1 runner class to call this xml file. but as it runs 3 tests pdf overriding issue is happening . so trying to create json and using
If there is only one runner instance, then the PDF report should be generated correctly. Is the setup in the testng.xml creating multiple instances of the runner class?
Can u share the settings? I have never used testng.xml to trigger cucumber runners so will have to understand what you are attempting. Using Maven lifecycle is much simpler.
this is my testNG file. im running same runner class in 3 diff browsers via testNG
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
i have extent.config and extent.properties as per guidance. and here is my runnerclass method
@RunWith(Cucumber.class) @CucumberOptions( features = "src/test/resources/features",
glue = {"com.stepDefs" },
monochrome = true,
tags = "@linkedState",
publish = true,
plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",
"json:target/json-report/cucumber.json"})
xml version.docx pom plugin
You are basically triggering three instances of the runner class. The PDF report will not work correctly. U will need to use the alternate techniques I had mentioned in the previous comment. The testng.xml will have to be added to the surefire or failsafe plugin settings.
hi , I have dropped including pdf as the html report looks good . and for html report - i only addded the plugin adapter "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" to the runner class .. and jave config file and properties file added to resourches. the dependancies in the pom.xml .
could you help with if thre is a any repo reference to add screenshots with the reports please ? without creating too many additional classes? thanks
@grasshopper7 Any update on this issue. I facing the same issue for my framework. I have multiple @test in my testng.xml file and each test is executing the same TestRunner class to achieve parallel testing. In this case, pdf report is generating with 0KB size and not opening. Earlier mentioned link for alternate solutiuon is not opening as well.
Hi, The links are updated below.
First method - Generate the PDF report by using a Maven plugin (https://github.com/grasshopper7/cucumber-pdf-plugin) which will execute in the 'post-integration-test' phase. This uses the cucumber JSON report. The other extent report like Spark can be generated by the existing adapter plugin. Refer to https://ghchirp.site/2224/, section 'Maven plugin configuration'.
Second method - Generate all reports by using a Maven plugin which will execute in the 'post-integration-test' phase. This also uses the cucumber JSON report. No need for adding the adapter plugin to the runners. Refer to https://ghchirp.site/2114/.
You will need to pass different values for the cucumber json report in testng.xml. Refer to these links - https://stackoverflow.com/questions/74703840/can-we-pass-cucumber-options-values-like-features-and-tags-values-dynamically-fr https://github.com/cucumber/cucumber-jvm/tree/main/cucumber-core#cucumber-core
Hi I am working on a web proj.. wih extend report the html report is all gud but pdf gets generated in the location as mentioned in properties file but doesnt open. and the below error msgs are displayed when run as testNG suite.
should i add any dependency or yaml file? - note i do have these dependencies in my pom (