email2vimalraj / CucumberExtentReporter

A plugin to generate the cucumber jvm custom html report using ExtentsReport
http://www.vimalselvam.com/cucumber-extent-reporter/
MIT License
58 stars 74 forks source link

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

Closed anbajaj closed 5 years ago

anbajaj commented 5 years ago

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 commented 5 years ago

extentreport1

email2vimalraj commented 5 years ago

@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.

anbajaj commented 5 years ago

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

email2vimalraj commented 5 years ago

Kindly report this issue in the extentreports-java repo.

On Tue 24 Jul, 2018, 12:54 AM Anuj Bajaj, notifications@github.com wrote:

Thanks @email2vimalraj https://github.com/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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/email2vimalraj/CucumberExtentReporter/issues/98#issuecomment-407172239, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKI3p0jnLqBlko1HvGCzzw1cioqpHa7ks5uJiLQgaJpZM4VTmX1 .

anbajaj commented 5 years ago

@email2vimalraj - reported this issue - https://github.com/anshooarora/extentreports-java/issues/1100