email2vimalraj/CucumberExtentReporter

Feature status is not correct when you skip few scenarios from example table.

Closed this issue · 5 comments

Hello Team,

We are using cucumber extent report & have a feature file with 1000 rows in the Example table. For each row we have a specific scenario & based on which we get the data from DB & the scenarios for which we don't get any record in DB, we are skipping the scenario by calling:
throw new AssumptionViolatedException("scenario skipped");

In the final extent report, we are seeing the Feature pie chart as skipped however there were 997 scenarios passed & 3 got skipped.

Expected result is to show Feature status as Passed if there are no failed test scenarios.

extentreport

@anshooarora @email2vimalraj

@anbajaj : This is how the extent report works. But the extent report gives you the capability to alter the status hierarchy based on your need. All you have to do is, in your runner, you can have the following code:

    @BeforeClass
    public void setup() {
        List statusHierarchy = Arrays.asList(
            Status.FATAL,
            Status.FAIL,
            Status.ERROR,
            Status.PASS,
            Status.WARNING,
            Status.SKIP,
            Status.DEBUG,
            Status.INFO
        );
        Reporter.getExtentReport().config().statusConfigurator().setStatusHierarchy(statusHierarchy);
    }

Please note that in the above hierarchy, I've set the SKIP as low priority than PASS, hence your feature will be reported as PASS.

If you still have difficulty, feel free to re-open.

Thanks @email2vimalraj for the prompt reply.

It worked out well (Showing feature status as Pass) however it is showing below count in the scenarios pie chart even though there are few test scenarios which got skipped:

500 scenario(s) passed
0 scenario(s) failed, 0 others