A user
A user

Reputation: 1108

Unable to generate cucumber reports in jenkins. net.masterthought.cucumber.ValidationException: None report file was added

I am using jenkins to run jobs that uses maven with cucumber . my jobs are running succesfully. I have also managed the plugin Cucumber report in jenkins. But when i view the report i am getting the message as shown in below picture.

I have tried to install various plugins like Jenkins plugin, standalone but with no joy. These are shown as options in the bottom right of the report.

Any clue is helpful. I have tried to check this error in stackover flow also. I didnt get any clue

enter image description here

I could see the reports file in xml which is created by surefire plugin. Any way i can achive reporting part in my project

enter image description here

Upvotes: 3

Views: 42113

Answers (6)

Dharmesh N
Dharmesh N

Reputation: 3

In TestRunner file you need to provide following plugin in @CucumberOptions:

plugin = {"pretty", "json:target/CucumberTestReport.json",
                    "html:target/CucumberTestReport.html"},

Html report generate for individual report after tests run, and json report to generate details reports in Jenkins.

Now in Jenkins job, while configuration select cucumber reports in post build section, click on advanced option and provide 'FULL ABSOLUTE PATH OF YOUR JSON FILE' in "JSON Reports Path" text field. Save the job, it will absolutely work fine.

To know more : https://plugins.jenkins.io/cucumber-reports/

Upvotes: 0

Čamo
Čamo

Reputation: 4163

I my case the problem was in two jobs over the same test repository (one for Chrome one for Firefox), where one deletes report files after the job while second job was already running and vice versa.

Upvotes: 0

prince batra
prince batra

Reputation: 11

First of all in runner file we need to provide following plugin as follows: plugin= {"json:target/cucumber.json" }

Now in Jenkins job, in "post build" section during configuration, add cucumber reports, click on advanced option and provide 'target' text in "JSON Reports Path" text field. Save the job, it will run and will work fine.

Note: target text is the name of folder which we have provided in runner file for generating reports in Json, also cucumber report plugin works on json so need to generate report in json.

Upvotes: 0

Cloudravi
Cloudravi

Reputation: 63

I am able to solve by providing **/*.json under Post-build Actions/Cucumber Report/JSON Report Location/ File Include Pattern = **/*.json

Upvotes: 1

user11718067
user11718067

Reputation: 31

This might help for those who are looking for answer.

@CucumberOptions(
        features= "C:\\Users\\dd pc\\workspace\\PracticeCucumber\\src\\main\\java\\com\\qa\\feature\\Test.feature",
        glue= {"com\\qa\\stepDefinition"},
        format= {"pretty","html:test-output_1",
                "json:target/cucumber-reports/CucumberTestReport.json"},
        plugin = ("json:target/cucumber-reports/CucumberTestReport.json"),
        monochrome= true,
        dryRun= false

        )

Upvotes: 3

A user
A user

Reputation: 1108

I managed to get reports in jenkins now.

Previously Jenkins is unable to find the json file in my project.

I have set the path of json file as target and i could able to see the reports.

Upvotes: 2

Related Questions