Extent Reports is a robust, open-source library for generating detailed test automation reports. It seamlessly integrates with testing frameworks like JUnit and TestNG to provide HTML-encoded and PDF-formatted reports. These reports are crucial for Quality Assurance (QA) teams as they summarize test results and pinpoint specific areas of failure in test scripts, making them more informative than many standard reporting tools provided by testing frameworks.
Extent Reports enhance the reporting capabilities of test automation frameworks by providing HTML-encoded PDFs that display results in visually informative pie charts. Unlike the basic HTML reports generated by frameworks such as TestNG, Extent Reports offer a high level of detail and clarity, showcasing exactly where scripts fail and thus facilitating a more effective debugging process.
Initialization of Reports
ExtentReports reports = new ExtentReports("Path of directory to store the HTML file", true);
Parameters
Path of directory: Specifies where the HTML report file will be saved.
true/false: A Boolean flag indicates whether to overwrite the existing report.
Creating a Test Report
ExtentTest test = reports.startTest("TestReportName");
Purpose: Starts a new test within the report.
Parameters
TestReportName: The name of the test for identification in the report.
Logging Test Steps
Method: Use the test.log() method to document each test case step, indicating status and details.
Example Usage:
test.log(LogStatus.PASS, "Step description here");
Completing the Test
Method: Utilize reports.endTest(test) to finalize the logging for a specific test
Generating the Report
Method: Call reports.flush() to finalize and save the report, ensuring all data is written to the file.
ExtentReports reports = new ExtentReports("Path of directory to store the HTML file", true/false);
ExtentTest test = reports.startTest("TestReportName");
Extent report classes can be used with the following built-in methods:
The status of the test can be indicated by the following values:
Extent Reports provide a valuable tool for enhancing the effectiveness of test reporting in Selenium by offering detailed, easily navigable reports that help pinpoint failures. While they offer significant advantages in terms of detail and ease of use, their lack of integration with tools like JIRA and rigid categorization can be seen as drawbacks. Nevertheless, for teams prioritizing detailed insights and visual reporting, Extent Reports are an excellent choice.