prashant-ramcharan / courgette-jvm

Multiprocess | Parallel Cucumber-JVM | Parallelize your Java Cucumber tests on a feature level or on a scenario level.
MIT License
131 stars 38 forks source link

Courgette-report is not getting generated properly #203

Closed ashwinsgm closed 4 years ago

ashwinsgm commented 4 years ago

Hi Team

Cucumber report and extent report is getting generated, but Courgette jvm report is not getting generated properly. I have attached the screenshot and runner file. Is there anything we are missing in the report file. Build tool used is gradle. Do I need to add any dependencies for report to get generated.
Courgette-version:: courgette-jvm:5.0.0 cucumber-jvm:6.5.0 snip1

Here is Courgette Runner file I am using

package com.ford.auto.testRunners;

import org.junit.runner.RunWith;

import courgette.api.CourgetteOptions; import courgette.api.junit.Courgette; //import io.cucumber.junit.CucumberOptions; import courgette.api.CourgetteRunLevel; import courgette.api.CucumberOptions;

@RunWith(Courgette.class) @CourgetteOptions( threads = 4, runLevel = CourgetteRunLevel.SCENARIO, rerunFailedScenarios = false, rerunAttempts = 1, showTestOutput = true, reportTitle = "Courgette-JVM Example", reportTargetDir = "build", plugin = { "extentreports" }, cucumberOptions = @CucumberOptions( glue = "com.example.stepDefinitions", plugin = {"pretty","json:build/cucumber-report/cucumber.json", "html:build/cucumber-report/cucumber.html", "junit:build/cucumber-report/cucumber.xml" }, features = "src/test/resources/feature") ) public class CourgetteJunitRunner { }

prashant-ramcharan commented 4 years ago

Hello @ashwinsgm

Are you connected to the internet when opening the report? The javascript and css files are loaded using a CDN so it's likely these files are not being loaded when the report is opened.

Could you please attach your Courgette html report file here?

ashwinsgm commented 4 years ago

I have connected to the internet. But i am connecting from the office network and I tried disconnecting from VPN as well. Works Same. Attached the files index.zip

I could not see any CSS files or JS file getting downloaded to my folder

prashant-ramcharan commented 4 years ago

Hi,

Courgette version 4.6.0 upwards uses a CDN to deliver the CSS and Javascript files which results in a single html Courgette report.

The report that you attached suggests that you using a different version of Courgette as the CSS and Javascript files (below) should not be relative to the index.html if using version 4.6.0 upwards.

Having said that, older versions should still work as expected where the CSS and Javascript files are downloaded.

Screenshot 2020-08-27 at 10 29 21

Can you double check the version that you using?

You can also try with the example project here: https://github.com/prashant-ramcharan/courgette-jvm-example

ashwinsgm commented 4 years ago

I am using the latest version 5.0.0

prashant-ramcharan commented 4 years ago

This is not possible as the CDN is explicitly added in the index.html

https://github.com/prashant-ramcharan/courgette-jvm/blob/master/src/main/resources/report/index.html#L199-L212

Does the report load up fine using the example project ?

ashwinsgm commented 4 years ago

Report is getting loaded properly with example project. But not sure why it does not load for the cod I have written. Does it need to be specific cucumber version. I am currently using cucumber jvm version 6.5 package com.ford.auto.testRunners;

import org.junit.runner.RunWith;

import courgette.api.CourgetteOptions; import courgette.api.junit.Courgette; //import io.cucumber.junit.CucumberOptions; import courgette.api.CourgetteRunLevel; import courgette.api.CucumberOptions;

@RunWith(Courgette.class) @CourgetteOptions( threads = 10, runLevel = CourgetteRunLevel.FEATURE, rerunFailedScenarios = false, showTestOutput = true, reportTargetDir = "build", cucumberOptions = @CucumberOptions( features = "src/test/resources/feature/WSL", glue = "com.example.stepDefinitions", //tags = {"@regression", "not @excluded"}, plugin = { "pretty", "json:build/cucumber-report/cucumber.json", "html:build/cucumber-report/cucumber.html", "junit:build/cucumber-report/cucumber.xml", "message:build/cucumber-report/cucumber.ndjson"} ))

public class CourgetteJunitRunner { }

prashant-ramcharan commented 4 years ago

You just need to have the Courgette dependancy in your build.gradle as this will automatically pull down the Cucumber dependancies for you.

The Cucumber version is managed by Courgette so you do not need to specify any Cucumber dependencies in your project.

For example, the latest version of Courgette 5.1.0 (at the time of comment) uses Cucumber version 6.6.0 You do not need to specify the cucumber dependency in your project.

Did you try refreshing your project dependencies to check this is not a caching issue?

To assist further, please provide a project (github link or zipped) which can replicate this issue.

prashant-ramcharan commented 4 years ago

@ashwinsgm

I will be releasing a new version shortly to remove the CDN and embed the CSS and JS directly in the report. This should resolve any caching issues which is causing your report to not load the CSS and JS files.

prashant-ramcharan commented 4 years ago

@ashwinsgm You can now try Courgette version 5.2.1 which should resolve caching issues.

aravindkesavarapu commented 3 years ago

16265884250194904836157494949728 Hi @prashant-ramcharan ,

I am also facing same issue. Css and js was not loading even though I added html publisher in Jenkins.

Extent html report - working Courgette html report - not working

And some times report.json & cucumber.json file was not updating with rerun(passed after rerun) scenarios in this case html file was also not generating

Courgette jvm version - latest(present version)

prashant-ramcharan commented 3 years ago

Hello,

Does the CSS and JS just not load in Jenkins or is it locally too?

Can your Jenkins server access the following URL:

https://cdn.jsdelivr.net/gh/prashant-ramcharan/courgette-jvm/src/main/resources/report/css/chartjs.min.css

Perhaps, download the report from your Jenkins server and try opening it locally. If the report opens fine, this would suggest you need to update your Jenkins configuration.

https://www.jenkins.io/doc/book/security/configuring-content-security-policy/