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