Careeroza
Real World Example
Nightly Report Mail at a Service Company
In a typical insurance or banking project, the client expects a regression report every morning. The framework generates the Extent report, and the CI job emails it with a short summary in the subject line so the test lead knows the status before opening anything.
public class SuiteSummaryListener implements ISuiteListener {
@Override
public void onFinish(ISuite suite) {
int passed = 0, failed = 0, skipped = 0;
for (ISuiteResult r : suite.getResults().values()) {
ITestContext ctx = r.getTestContext();
passed += ctx.getPassedTests().size();
failed += ctx.getFailedTests().size();
skipped += ctx.getSkippedTests().size();
}
String subject = String.format("[%s] PolicyPortal regression: %d passed, %d failed, %d skipped",
failed == 0 ? "GREEN" : "RED", passed, failed, skipped);
Files.writeString(Path.of("target/mail-subject.txt"), subject); // the CI mail step reads it
}
}Example
cat target/mail-subject.txtExample output
[RED] PolicyPortal regression: 212 passed, 3 failed, 4 skipped
Why It Works
- The subject line alone tells the lead whether to dig in.
- Failed tests in the report have a screenshot, URL and stack trace, so the triage takes minutes.
- Allure history shows whether those 3 failures are new (likely a bug) or old (likely flaky tests).