cucumber-reports plugin provides lots of valuable reports, including the number of failures (example: failedScenariosNumber) or number of failed steps (failedStepsNumber). It is useful to be able to extract these values through Jenkins, similar to how we extract environment variables like: ${ENV, var=“SoftwareVersion”}, for providing consolidated email report.
Example test.jenkinsfile code (FYI: The ENV portion works. EXPECTED_CUCUMBER_REPORT or something like this is what is sorely missing or I am not aware of anything like it):
success {
// Email when the build passes
emailext to:‘my_email@gmail.com’,
body: ‘pass: ${ENV, var=“SoftwareVersion”}
${EXPECTED_CUCUMBER_REPORT, var = “failedScenariosNumber”}
${SCRIPT, template=“groovy-html.template”}’,
…
}
For an example result of: Jenkins Surefire suite output:
03:00:58 Surefire suite
03:00:58 Total tests run: 39, Passes: 26, Failures: 13, Skips: 0
Expected output for retrieving failedScenariosNumber results from above would be: 13