I have java automation project integrated with TestNG, Maven and Extent reporter using SureFire.
The project runs in a nightly build via Jenkins, and in the end there is an email with a link to the HTML report and brief data extracted from the report, which includes: number of tests, number of suites and pass/fail ratio.
I have problem with extracting these variables from the HTML Extent reporter dashboard, and I’d like to know how can I do it. I’ve added a snippet from my Editable Email Notification default content:
<style>
.param_name { background-color:#e6e6ff; }
a:link { color:#8080ff; }
div p { border-bottom: solid 1px #cccccc; }
div { font-family:arial; line-height:160%; }
</style>
<div>
<h2><a href="$JOB_URL">$PROJECT_NAME</a>, build <a href="$BUILD_URL">#$BUILD_NUMBER</a></h2>
<p>Please find the HTML report <a href="${PROJECT_URL}/${BUILD_NUMBER}/HTML_20Report">here</a>.</p>
<p>
<span class="param_name"> Total Tests: </span>${TEST_COUNTS}</br>
<span class="param_name"> Passed Tests: </span>${PASSED_TESTS}</br>
<span class="param_name"> Failed Tests: </span>${FAILED_TESTS}</br></br>
</p>
</div>
As you can see I need some way, maybe a script to add in my Jenkins configure to extract total tests, tests that passed or failed, from the Extent reporter.