Careeroza
TestNG Reports
Built-in Reports
After every run TestNG writes reports into target/surefire-reports (with Maven) or test-output (from the IDE):
| File | Contains |
|---|---|
index.html | suite overview, pass/fail per method, exceptions |
emailable-report.html | one-page summary you can email |
testng-results.xml | machine-readable results for Jenkins / CI |
Console Summary
Example
A typical regression run summary:
mvn testExample output
=============================================== ShopEase Regression Total tests run: 48, Passes: 45, Failures: 2, Skips: 1 =============================================== [ERROR] Failures: [ERROR] CartTest.removeItemUpdatesTotal:58 total expected [₹1,299] but found [₹2,598] [ERROR] SearchTest.noResultsMessage:41 » Timeout Expected condition failed: waiting for visibility of element located by By.cssSelector: .no-results [INFO] [ERROR] Tests run: 48, Failures: 2, Errors: 0, Skipped: 1
Tip: Use Reporter.log("step text") to add steps to the HTML report. Richer reports (Extent Reports, Allure) with screenshots are in the advance level.