I'm confused in difference between Tests and Steps in testng extent report.
I have 2 test cases as 1 pass and 1 fail. In extent report under Test: 1 test(s) passed 1 test(s) failed, 0 others and under Steps: 1 step(s) passed 2 step(s) failed, 0 others
So would anyone clarify what is the difference between both ?
Attaching code snippet and testng extent report
@Test
public void demoTestPass()
{
test = extent.createTest("demoTestPass", "This test will demonstrate the PASS test case");
Assert.assertTrue(true);
}
@Test
public void demoTestFail()
{
test = extent.createTest("demoTestFail", "This test will demonstrate the FAIL test case");
Assert.assertEquals("Hi", "Hello");
}
Please click for Extent report here.
Any clarification would be much appreciated.
Extent Reports offer several advantages when compared to the built-in reports that are generated through JUnit and TestNG such as pie chart representation, test stepwise report generation, adding screenshots etc., at every test step and a presentable user interface that can be shared with all stakeholders of the ...
We shall create test cases that end in three different statuses like Pass, Fail and Skip. To create a test, we can use createTest(test_name,test_description) using ExtentReports class.
What is the Extent Report? Extent Report is an open-source reporting library used to create visually attractive reports for Selenium tests using JUnit and TestNG. Extent reports produce HTML-based documents that offer several advantages like pie charts, graphs, screenshots addition, and test summary.
Tests defines: Total test section which you have created in your Report: With the syntax like : extentReport.createTest("name of section");
Steps defines : Total number of log which you have generated in Script, With the syntax like : testlog.info()
OR testlog.pass()
OR testlog.fail()
where testlog
is object of ExtentTest
class
Example:
In this report, there are 3 section which has been created and its showing as Tests. And Steps defines numbers of logs which has been passed in those Test.
Your case :
Test: 1 test(s) passed 1 test(s) failed, 0 others and under Steps: 1 step(s) passed 2 step(s) failed, 0 others
Test include 1 pass and 1 fail, because of its get failure in Steps. Your Steps include 1 pass and 2 fails and its reflected on Test.
Test(startTest("test name")) is something that is used to create a new test in extent reports.
Steps denotes that how many messages (test. Pass("pass message"), test. Fail ("fail message), test. Info ("info message")) you've logged to reports.
Consider you've two test methods and each test method has 1pass and 1 info messages.
So, in the extent reports, it'll show like 2 tests, total 4 steps. 2 pass steps and 2 info steps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With