grasshopper7 / extentreports-cucumber6-adapter

Cucumber-JVM 6 Adapter for Extent Framework
https://ghchirp.online/2098/
MIT License
16 stars 15 forks source link

Incorrect status displayed #38

Open grasshopper7 opened 3 years ago

grasshopper7 commented 3 years ago

In the pdf report, for scenarios with status “AMBIGUOUS” the corresponding step is marked as passed. The same status is seen in spark report also. For example if the scenario has 4 steps and in the third step AmbiguousStepDefinitionsException occurs the first 3 steps will get passed, 4th step will be skipped and the status of scenario will be shown as skipped. But if the scenario has 4 steps and in the fourth step AmbiguousStepDefinitionsException occurs all the 4 steps will get passed and the status of scenario will be shown as passed.

Scenario: This is a sample scenario Given I have a first step And I have a second step
And I have a ambiguous step Then I have a ambiguous scenario

@Given(“I have a first step”) public void i_have_a_first_step() { System.out.println(“first”); } @And(“I have a second step”) public void i_have_a_second_step() { System.out.println(“second”); } @And(“I have a ambiguous step”) public void i_have_a_ambiguous_step() { System.out.println(“ambiguous”); } @And(“^I have a ambiguous step$”) public void i_have_another_ambiguous_step() { System.out.println(“ambiguous”); } @Then(“I have a ambiguous scenario”) public void i_have_a_ambiguous_scenario() { System.out.println(“ambiguous scenario”); }

I have mentioned two cases in point 4. In order to replicate the second case just swap the positions of step 3 and step 4 in the feature file.