Search code examples
javaextentreportsselenium-extent-report

Difference between Tests and Steps in testng extent report


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.


Solution

  • 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