Difference between Tests and Steps in testng extent report
Asked Answered
C

2

6

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.

Cupulate answered 30/4, 2018 at 8:11 Comment(1)
Please note that in the upcoming version 4, for all tests without children, you will see only 1 chart and data points for the top-most level only. Log events are no longer considered as part of any metrics.Roussel
B
3

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

Beamon answered 1/5, 2018 at 5:6 Comment(0)
H
5

Difference Between Tests and Steps in extentReport:

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: Image of Report

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.

Halloo answered 1/5, 2018 at 5:6 Comment(0)
B
3

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

Beamon answered 1/5, 2018 at 5:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.