gradle-cucumber-reporting icon indicating copy to clipboard operation
gradle-cucumber-reporting copied to clipboard

Is there a way to have the plugin generate an `index.html`?

Open noel-yap opened this issue 5 years ago • 7 comments

Is there a way to have the plugin generate an index.html? Or, even better, create a section in the index.html that Gradle produces that points to the overview-*.html that the plugin produces?

noel-yap avatar May 23 '20 18:05 noel-yap

Alternatively, have the plugin set the outputs of the task generateCucumberReports.

noel-yap avatar May 23 '20 18:05 noel-yap

How is that index.html generated by gradle? By which plugin?

SpacialCircumstances avatar May 23 '20 21:05 SpacialCircumstances

It's part of the java plugin: https://docs.gradle.org/current/userguide/java_testing.html#test_reporting.

noel-yap avatar May 23 '20 23:05 noel-yap

Alright, I see. I will look into it.

SpacialCircumstances avatar May 23 '20 23:05 SpacialCircumstances

FYI and FWIW, the following is enough for my needs (since only Cucumber tests are run in functionalTest):

generateCucumberReports {
  doLast {
    new File("${buildDir}/reports/functionalTest/index.html").text = '<meta http-equiv="refresh" content="0; URL=\'cucumber-html-reports/overview-features.html\'"/>'
  }
}

noel-yap avatar May 24 '20 03:05 noel-yap

That's generated by the Java Plugin: https://docs.gradle.org/current/userguide/java_testing.html#test_reporting

FYI and FWIW, the following does what I need (since only Cucumber tests run under the functionalTest task):

generateCucumberReports {
  doLast {
    new File("${buildDir}/reports/functionalTest/index.html").text = '<meta http-equiv="refresh" content="0; URL=\'cucumber-html-reports/overview-features.html\'"/>'
  }
}

noel-yap avatar May 24 '20 15:05 noel-yap

It does not seem like gradle natively supports generation of custom reports beyond using binary results, so your solution seems to be the most viable at this point.

SpacialCircumstances avatar May 24 '20 17:05 SpacialCircumstances