Giter Club home page Giter Club logo

cucumber-reports-plugin's Introduction

Build Status

Popularity Live Demo

Publish pretty cucumber reports on Jenkins

This is a Java Jenkins plugin which publishes pretty html reports showing the results of cucumber runs. To use with regular cucumber just make sure to run cucumber like this: cucumber --plugin json -o cucumber.json

Background

Cucumber is a test automation tool following the principles of Behavioural Driven Design and living documentation. Specifications are written in a concise human readable form and executed in continuous integration.

This plugin allows Jenkins to publish the results as pretty html reports hosted by the Jenkins build server. In order for this plugin to work you must be using the JUnit runner and generating a json report. The plugin converts the json report into an overview html linking to separate feature file htmls with stats and results.

Install

  1. Get Jenkins.
  2. Install the Cucumber Reports plugin.
  3. Restart Jenkins.

Read this if you need further detailed install and configuration instructions

Use

You must use a Freestyle project type in jenkins.

With the cucumber-reports plugin installed in Jenkins, you simply check the "Publish cucumber results as a report" box in the publish section of the build config:

If you need more control over the plugin you can click the Advanced button for more options:

  1. Report title can be used to publish multiple reports from the same job - reports with different titles are stored separately; or leave blank for a single report with no title
  2. Leave empty for the plugin to automagically find your json files, or enter a base folder relative to the workspace if for some reason the automagic doesn't work for you
  3. Leave default, or specify an ant-style pattern for report json files in case you need to select only specific files
  4. Specify which json files should be excluded from prior selection
  5. If you would like to include .properties files containing metadata to be displayed in the report's top right corner, specify them via ant-style pattern here. Attention: Equal to File Include/Exclude Pattern, files are searched only below JSON Reports Path
  6. Configure how many historical reports to keep (0 = no limit)

Advanced Configuration Options

There are 4 advanced configuration options that can affect the outcome of the build status. Click on the Advanced tab in the configuration screen:

Advanced Configuration

The first setting is Skipped steps fail the build - so if you tick this any steps that are skipped during executions will be marked as failed and will cause the build to fail:

If you check both skipped and not implemented fails the build then your report will look something like this:

Make sure you have configured cucumber to run with the JUnit runner and to generate a json report: (note - you can add other formatters in if you like e.g. pretty - but only the json formatter is required for the reports to work)

  import cucumber.junit.Cucumber;
  import org.junit.runner.RunWith;
  
  @RunWith(Cucumber.class)
  @Cucumber.Options(format = {"json:target/cucumber.json"})
  public class MyTest {
  
  }

Automated configuration

Pipeline usage

Typical step for report generation:

node {
    stage('Generate HTML report') {
        cucumber buildStatus: 'UNSTABLE',
                reportTitle: 'My report',
                fileIncludePattern: '**/*.json',
                trendsLimit: 10,
                classifications: [
                    [
                        'key': 'Browser',
                        'value': 'Firefox'
                    ]
                ]
    }
}

or post action when the build completes with some fancy features for the Gerrit integraion:

post {
    always {
        cucumber buildStatus: 'UNSTABLE',
                failedFeaturesNumber: 1,
                failedScenariosNumber: 1,
                skippedStepsNumber: 1,
                failedStepsNumber: 1,
                classifications: [
                        [key: 'Commit', value: '<a href="${GERRIT_CHANGE_URL}">${GERRIT_PATCHSET_REVISION}</a>'],
                        [key: 'Submitter', value: '${GERRIT_PATCHSET_UPLOADER_NAME}']
                ],
                reportTitle: 'My report',
                fileIncludePattern: '**/*cucumber-report.json',
                sortingMethod: 'ALPHABETICAL',
                trendsLimit: 100
    }
}

Raw DSL - This should be utilized after build steps (note that the title is not specified in this example)

configure { project ->
  project / 'publishers' << 'net.masterthought.jenkins.CucumberReportPublisher' {
    fileIncludePattern '**/*.json'
    fileExcludePattern ''
    jsonReportDirectory ''
    failedStepsNumber '0'
    skippedStepsNumber '0'
    pendingStepsNumber '0'
    undefinedStepsNumber '0'
    failedScenariosNumber '0'
    failedFeaturesNumber '0'
    buildStatus 'FAILURE'  //other option is 'UNSTABLE' - if you'd like it left unchanged, don't provide a value
    trendsLimit '0'
    sortingMethod 'ALPHABETICAL'
  }
}

When a build runs that publishes cucumber results it will put a link in the sidepanel to the cucumber reports. There is a feature overview page:

feature overview page

And there are also feature specific results pages:

feature specific page passing

And useful information for failures:

feature specific page failing

If you have tags in your cucumber features you can see a tag overview:

Tag overview

And you can drill down into tag specific reports:

Tag report

Develop

Interested in contributing to the Jenkins cucumber-reports plugin? Great! Start here.

cucumber-reports-plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cucumber-reports-plugin's Issues

Can you add screenshots support

Hi,
Great plugin , I'm using it on our jenkins and I wounder can you add support for screenshots. When the test scenario fails the framework can make a screenshot and when the plugin generate the report it could include it in the html , so the user can see it.

Br,
Ceco

Embedded images are not supported for hooks

Hi there. First thank you for an awesome plugin. It makes logs much easier to see and digest.

The only issue I'm having at the moment is that images that are embedded in the results are not viewable from the report. Those same images are viewable via a normal cucumber html output though.

Any thoughts?

cucumber-jvm reports are not showing the latest results

I am not getting the latest test results in Cucumber-jvm reports. Previous execution results was shown.
Cucumber-jvm reports version: 2.6.3
Below is my Cucumber runner file,
@RunWith(Cucumber.class)
@CucumberOptions(
features="classpath:",
glue=
{"stepdefinitions","helpers"}
,
// plugin =
{"pretty", "html:target/cucumber","json:target/cucumber.json"}
,
plugin =
{"pretty", "json:target/cucumber.json"}
,
tags=
{"@registrationform"}
)
public class Runnertest
{
}
Attachment containing the actual json file created.
But you could see two feature files are executed, though i have configured only one feature in above.
jenkins
cucumber.txt

CSS inline error with reports

Hi!

We get the following error when viewing these reports on either Firefox or chrome

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-e3PTf-8JkKrhRPBrS7V8Iocbz9X5jIld6OXpK8Cbo2Y='), or a nonce ('nonce-...') is required to enable inline execution.

arrrgh

Stackoverflow points to some operations done in iframe or replace calls on DOM elements, kind of picking it up as an XSS attack.

NullPointerException whilst generating reports

Relates to #120 on the obsolete fork.

Getting very similar looking results on version 1.0.0. Has only occurred since upgrading from 0.0.19. Project is being built on the master node.
The issue seems to resolved when a file include pattern **/cucumber-report.json is manually specified. If the include pattern is left blank, then **/*.json should be the default according to the field info, however I'm unable to confirm this. Our file exclude pattern is also left blank.

Build snippet:

[CucumberReportPublisher] Found 6 json files.
...
[CucumberReportPublisher] Generating HTML reports
[CucumberReportPublisher] there was an error generating the reports: java.lang.NullPointerException
net.masterthought.cucumber.ReportBuilder.getBuildStatus(ReportBuilder.java:136)
net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:139)
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
hudson.model.Run.execute(Run.java:1757)
hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
hudson.model.ResourceController.execute(ResourceController.java:88)
hudson.model.Executor.run(Executor.java:234)
Build step 'Publish cucumber results as a report' changed build result to FAILURE

Cannot see the pie in the html report, cannot access the attachments from the report generated by the Cucumber jvm plugin

I have some scripts to automate UI test cases, I'm using ruby and cucumber. A job was created in jenkins to execute these scripts and is set up to generate cucumber reports as a post build actions. I can see the results but the pie at the top of the report is not displayed at all (see image). Also, my scripts are set to take screenshots when failing, the attachment is displayed as a link in the report but the link is broken, and the screenshots were not save.
Any suggestion/advice please?
image

image

Cannot view embedded images

It sounds like we're experiencing a similar issue as Embedded images #29, but I don't see an actually solution.

"Rather than link to the file it's including the actual file output. In Ruby in order to embed the image I had to encode it as base64. Could that be the issue?"

What does this mean? How do we fix the issue?

Plugin Support for Cucumber Reports Column on Jenkins Dashboard

It would be useful for the Jenkins plugin to offer functionality whereby "Cucumber Status" is available as a dashboard column:

Edit View -> Add Column

At a very basic level, this would allow the viewer to see which jobs have cucumber reports at a glance... when there are 50 or 60 jobs and only 1 or 2 use Cucumber then it can be laborious to navigate through all the jobs individually to establish which have Cucumber reports.

If the plugin were enhanced to offer support for a column then perhaps some sort of status info could be displayed. Say "235/1" to indicate 235 passing scenarios and 1 failure.

Sorting of Duration and Average Columns

The usability of the plugin's reports has been much improved by the introduction of sortable columns in tables.

However, the Duration column (all reports) and Average column (Steps report only) have a "broken" sort. For instance, sorting Duration for one of my Feature reports:

15m 17s 527ms
18s 939ms
19s 671ms
1m 04s 430ms
1m 11s 669ms
28m 39s 304ms

This sort is out of order.

Is it possible for sort to be performed using consistent units (such as milliseconds) whilst still displaying in minutes, seconds, etc?

CannotResolveClassException: CucumberReportBuildAction

Hi,
we tried to upgrade cucumber-report-plugin from 2.2.0 to 2.6.3 and we ended with CannotResolveClassException: CucumberReportBuildAction in our old builds and the Cucumber-JVM reports link was not working.
Downgrade of the plugin fixed it.
There was nothing in the jenkins log.
Does anybody have idea where might be the problem or how to debug jenkins classloader?

CSP settings in versions 2.4 and 2.5

In version 2.4 the CSP settings have been changed to:
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP",
"sandbox; script-src 'self' 'unsafe-inline'; default-src 'self'; img-src 'self'; style-src 'self';");
https://github.com/jenkinsci/cucumber-reports-plugin/blob/cucumber-reports-2.5.0/src/main/java/net/masterthought/jenkins/CucumberReportBaseAction.java#L38

This causes the reports to fail to display and various warnings in the browser console:

Blocked script execution in <snip>...feature-overview.html because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-j/f2UKtjBQylWfAd5G37rBG4+XD7tRKxQodoTIMdjF4='), or a nonce ('nonce-...') is required to enable inline execution
...etc...

However, the CSP settings should not be changed at all by this plugin. These are end-user settings. If I try to correct the incorrect settings myself (either through Jenkins startup options or via the script console) and then use this plugin, this code changes the setting back, undoing my correction.

This can also cause conflicts with other plugins that may need different CSP settings and/or may change a user's deliberate CSP configurations.

I would advise removing this setProperty line altogether and have a note in the Readme to tell users to configure their Jenkins accordingly.

Add Option: `Ignore failed tests (mark build as passed)`

Sorry if the title is confusing. And thank you so much for the work you do!

I am currently using TestNG with Cucumber (for multi-threaded concurrency) and the TestNG plugin for Jenkins supports configurable Pass, Unstable, and Failure thresholds. So I am wanting to use that to judge whether or not a Build Passed, is Unstable or Failed.

Since the only option for the the cucumber-reports-plugin is to Ignore failed tests (which marks the build as unstable), I am proposing an option be added to Ignore failed tests (mark build as passed)

Hopefully the screenshot below illustrates what I'm talking about:

ignore_failed_tests_mark_build_passed

Plugin failed build if report-directory/cucumber-json-files doesn't exist

Hello,
our builds are failing if the plugin doesn't find report directory. I think this is happend if we don't have any cucumber tests in the current execution. (We have configured some generic builds to be executed as part of a build-pipeiline). Plugin tries to find it to copy-> nothing is found-> no directory is created -> failure.

Can you make it more tolerant in such case? I think just doing nothing if there are no cucumber json files is ok.

ERROR: Build step failed with exception
java.lang.IllegalArgumentException: /var/lib/jenkins/jobs/PCP-Pipeline/jobs/local-AT/builds/5288/cucumber-html-reports listing returned null
    at net.masterthought.jenkins.SafeArchiveServingAction.processDirectory(SafeArchiveServingAction.java:111)
    at net.masterthought.jenkins.SafeArchiveServingAction.processDirectory(SafeArchiveServingAction.java:138)
    at net.masterthought.jenkins.SafeArchiveServingRunAction.onAttached(SafeArchiveServingRunAction.java:25)
    at hudson.model.Run.addAction(Run.java:393)
    at hudson.model.AbstractBuild.addAction(AbstractBuild.java:972)
    at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:74)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Build step 'Cucumber-JVM reports' marked build as failure

Feature request - Include original feature file content with link to unrolled example

Hi, firstly apologies if this is not the right place for this as I know this isn't an "issue" as such, but rather a request for a feature I think would be very useful.

I would LOVE it if it were possible to include the original unrolled ScenarioOutline + examples tables at the top of the cucumber report, with example rows highlighted based on whether they passed or failed with links to follow on each row which would take you to the full unrolled test if you wanted to see it.

The reason I think this would be so great is that I would like to use these reports to share with non developers what the specification for the system is and the unrolled test examples from a ScenarioOutline make it difficult to quickly get an understanding compared to the original feature file.

I'd be more than happy to help out in developing this if given a few pointers to get started.

Thanks

Tom

Include Report Date in Report

The plugin report identifies Build Number and Project Name.

I would also like to see the report include a timestamp for the Build.

Thus, when clicking (say) "Previous Build", it would be immediately apparent that one is looking at a report that was generated an hour ago, last night (daily build), or a long time in the past (build on demand).

Feature Request: Want 2 JVM reports - one for 1st run, and one for 2nd run

Context:
As an SDET, I want to run tests twice.
The 1st run of tests will run the entire test suite - generates a .json report at path "A:
The 2nd run of tests will run all tests which failed during the 1st run (if applicable) - also generates a .json report at path "B"

Problem:
There is no way to generate 2 separate JVM reports. Instead, the only option is to provide both .json files as input for the jvm report. Additionally, I can only create a single Cucumber-JVM report post build action per job

Proposed Solution:
Option 1 - Make it so the plugin could be added to the Jenkins Job multiple times and make the report link editable (can say which report it is). 1st report would look at the 1st run data and 2nd report would look at the rerun data.
Option 2 - Give the plugin an option to "generate multiple reports" which would allow me to add the paths to the .json files for each report. 1st report uses path "A", and 2nd report uses path "B". These reports should be name-able

Missing xml tags in feature file inputs

This is what the feature file looks like
feature-file

This is what the generated json looks like
"cells": [ "<instrument><instrumentId>TEST1</instrumentId><version>1</version></instrument>" ],

This is what the jenkins plugin produces. Notice the xml tags are missing and it just leave the body.
jnkins

Support for xml

Hi,
by default cucumber & junit create xml reports. Are you planning to support this?

Thanks

Ugly reports in 1.3.0

I updated from 1.2.0 to 1.3.0 last night and the reports have horizontal scroll bars for each feature step outcome. This is annoying when you have a long report and having to scroll for each step outcome. I much prefer the old format where the step outcomes were just wrapped within the frame its in.

1.2.0:
before

1.3.0:
after

cannot display the cucumber reports

Hello,

after upgrading to version 2.6.2 the link to the cucumber reports html file no more works. It redirects me to build page. I tried 2.6.3 without success. Now I am look how to downgrade to 2.5.1

cheers

Report showing twice number of scenario

Report showing twice number of scenario, Suppose 22 scenario ran then report will show 44 scenario ran. It is making double scenario for each feature file.

Please find attached screen shot.

image

Feature file named in Korean directs to wrong feature report page

Hi.

My feature file is named in Korean. The initial Feature Statistics page displays my features correctly, but when I click the feature to view the 'Feature Report Page', it directs to a wrong html page.

The URL goes like below. I think the plugin replaces Korean characters into dash(-), which leads to same feature report for same length (but different) of Korean feature file names.

.../cucumber-html-reports/feature-calendar------_outline-feature.html

Jenkins Folder Plugin support

Support for jenkins folders is a bit erratic. The reports generally work however the links "Jenkins", "Previous results" and "Last results" have incorrect URLs
e.g. For the job TEST_V3 in the folder TEST
The job url is:
/job/TEST/job/TEST_V3/

The url to the reports is:
http://jenkins:8080/job/TEST/job/TEST_V3/259/cucumber-html-reports/

however the links in the navbar are:

      <ul class="nav navbar-nav navbar-right">
                  <li role="presentation"><a href="/job/TEST_V3/259">Jenkins</a></li>
                      <li role="presentation"><a href="/job/TEST_V3/258/cucumber-html-reports/features-dummy-feature.html">Previous results</a></li>
                    <li role="presentation"><a href="/job/TEST_V3/cucumber-html-reports/features-dummy-feature.html">Last results</a></li>
                <li role="presentation" ><a href="feature-overview.html">Features</a></li>
        <li role="presentation" ><a href="tag-overview.html">Tags</a></li>
        <li role="presentation" ><a href="step-overview.html">Steps</a></li>
        <li role="presentation" ><a href="failures-overview.html">Failures</a></li>
      </ul>

instead of /job/TEST_V3/xxx

Empty report file results in failed report generation

I'm running tests in parallel using Parallel Cucumber, but I'm finding that if I skip a certain feature, it will still create a report file with an empty report. This plugin then reports it as "not having any features", and then fails to generate a report at all. It would be really nice if the plugin could ignore empty files or files without features and still generate the report.

I've included a snippet of the error that's thrown when "report5.json" has a size of 0.

java.lang.IllegalArgumentException: File '{removed}.../builds/388/cucumber-html-reports/ruby-cucumber/reports/report5.json' does not contan features!
    at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:37)
    at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:48)
    at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:133)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:408)

Can't generate reports for rerun and 1st attempt

so cucumber generates a rerun report which allows developers to run all the tests which failed.

In my case, I run all my tests, compile all tests which failed into rerun.txt which I then use to rerun all the failed tests. If all the failed tests then pass the 2nd time around, I want Jenkins to mark the job as a success instead of failure.

Right now, there is no way to do this and generate both reports. If I could add the plugin twice, and make one optional, I believe my problem would be solved (In Theory, 1st generation of the report causes the build to fail. The 2nd generation of the report marks the build from failed to passing. In the case where I do not need a 2nd run, then by saying the 2nd report is optional, the build would still be marked as passing)

Support to pipeline needs to be added

It seems that when I do more than one call to step([$class: 'CucumberReportPublisher' it breaks the Cucumber html report. I get several links on the build page, but when clicking anyone of them I get a HTTP 403 Forbidden.

What's interesting is that the report works for a time when it's first generated, before the second step has run in the pipeline. Also, everything looks fine in the logs, it's copied fine to the master and I can't see any difference on the file system there between a working and non-working example.

I am not really expecting you to fix this if it's complicated. I know that Jenkins publishers in classical Jenkins jobs only run once. But I would like to get a clarification that I will not indeed be able to make it work, maybe an idea for workaround in that case, or some suggestions on what I'm doing wrong if not the case.

One idea I had was to run the step only once at the end (this was mentioned in #28) but that wont work for me since I run the steps in different stages on different nodes.

Didn't show complete step in reports

I am using this "Cucumber-jvm reports" plugin(version 2.5.1) with jenkins for reporting test execution of rest api test cases.

In feature file,I am passing json(highlighted in red color) to rest api in step "When createpursuitsteps post request to create pursuit with one level with valid input json as:"
Refer FeatureFileScreenShot.png for feature file.

However,after test execution I can't see the json that I am passing in step.
Refer Report.png for feature file.

featurefilescreenshot

report

Attaching "cucumber.json" that get generated after running test cases for more information.
Please rename cucumber.json.txt to cucumber.json
cucumber.json.txt

Incomplete AssertionErrors in

I noticed that when using org.junit.Assert.assertEquals, at failure, the expected and actual values are missing.

assertmessage

This is a screenshot from the console log. I was expecting to see the same message in the report:

assertlog

Can you include JSON file name as one extra column in the report ?

Hi,

I love the plugin and thank you for the work. I have a situation that I use cucumber rake to run same feature and scenario for many different configs or clients. The only place I can tell which report is for which config/client is from the file name of the JSON report.

Example:

report_config_a.json ( with login scenario/feature)
report_config_b.json ( with login scenario/feature)
report_config_c.json ( with login scenario/feature)
...

Without including the file name in the report table, I can't tell which report line is for which config/client, and the feature being run is exactly same.

thanks
Yulin
[email protected]
cucumber_report

Error: IllegalArgumentException when build got killed by timeout

Hi, we are setting 20 minutes as timeout for a TEST job in our jenkins, and we run test in parallel using parallel_tests gem. However, when build got killed by timeout, the Cucumber Report can render a final report as usual due to this error:
2016-02-02_1654
I have checked the report json and find that the report4.json is corrupted and got 0K size.
So can we ignore the corrupted files and render reports based on other files?

Version Information in Page Footer

As can be seen in this screenshot, plugin version information has been removed from the footers of reports.

cucumber-jenkins-plugin-footer

I would like to see version information displayed in the footer... it provides a quick and easy way of being sure that a particular Jenkins project is using an up-to-date plugin. Sure, the footer does display the build date of the plugin - but that is not quite as easy to work with when (especially when github reports that the most recent version v1.4.0 was "13 days ago" - which (at time of writing) is before "23-02-2016".

Error ValidationException - JsonSyntaxException with gherkin-language

Hi!

I'm trying to access 'cucumber-jvm reports' link on Jenkins and it shows this error message:

net.masterthought.cucumber.ValidationException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 449 path $[0].elements[0].before[0].match.location
at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:41)
at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:47)
at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:134)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 449 path $[0].elements[0].before[0].match.location
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
at com.google.gson.Gson.fromJson(Gson.java:879)
at com.google.gson.Gson.fromJson(Gson.java:817)
at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:33)
... 11 more
Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 449 path $[0].elements[0].before[0].match.location
at com.google.gson.stream.JsonReader.nextString(JsonReader.java:831)
at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:422)
at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:410)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
... 26 more

Trying to generate report from following files. Make sure they are valid cucumber report files:

The file was generated using the shell step with the command:
cucumber -f pretty -f json -o cucumber.json

The generated json file is here:
cucumber.json.zip

I'm using gherkin-language to write cucumber features in pt.

Jenkins Version: 1.654
Cucumber-jvm reports plugin: 2.0.0

Anyone knows what is going on?

Scenarios with failed Background are counted as Passed Scenarios

I noticed that when I have a scenario with a failed Background, in the summary table the scenario is counted as Passed and the status of the feature is Failed (which is expected). I was wondering if is it possible to count a scenario with a failed Background as Failed and not Passed so it matches the feature status?

IllegalStateException exception on projects having a space in the Job name

After updating the Cucumber Reports Plugin from 0.1.0 to 1.0.0 reports no longer work for projects that have a space in the name.
Hinted by the error message using unescaped path as /My Test/ I tried replacing the spaces with underscores and that indeed resolved the problem. Reporting worked with jobs having spaces in older versions

The error message (if any) is below:

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:873)
at com.google.gson.Gson.fromJson(Gson.java:799)
at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:27)
at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:146)
at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:137)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:351)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70)
at com.google.gson.Gson.fromJson(Gson.java:861)
... 13 more

Trying to generate report from following files.
Make sure they are valid cucumber report files:
/var/lib/jenkins/jobs/My Test/builds/22/cucumber-html-reports/functional/smoketest/target/cucumber.json

cucumber ruby support

I noticed these two issues are closed:

From what I can tell, they are duplicates, and address JSON parsing for cucumber-ruby based JSON files. I am currently running into what seems like the same error trace. The issues are closed, but, I can't tell if the problem has been resolved.

I am running cucumber-jvm-reports plugin v2.3.0, and am seeing an error like this:

net.masterthought.cucumber.ValidationException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 340 path $[0].elements[0].before[0].match.location
    at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:41)

Is 2.3.0 expected to parse cucumber results from ruby? If so, might I be observing a new error?

Colour scheme in HTML reports are not proper

We are using cucumber JVM plugin on Jenkins with version 2.1.0.

The HTML reports which this plugin publishes have improper colour schemes. Colours are too bright and contrast is not perfectly balanced. In some cases, it is even difficult to read the step at which test failed (Black on dark Red).
screen shot 2016-04-07 at 8 27 28 am

It will be good if we can improve colour schemes of the HTML reports to make them look more pleasant.

Test result trend graph

The only way to view the results of tests over time is to skip between different builds. Would be great to have a trend graph like jenkins provides for unit test trends. I will look to provide something

Broken formatting

Jenkins ver. 1.644
Plugin ver. 1.1.0
All pages: feature view, tag view, overview...
Please see the attachment.
cucumber

API support

Hi,

This plug-in works very well from Jenkins.

By chance, is there way to have API or code to invoke this report?

When we run automation a test suite, it generate cucumber.json.

Do we have API/methods which converts 'cucumber.json' to Cucumber reports?

API's are great way to help in this regard.

Thanks,
Uday

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.