Skip to content

Incorrect status displayed #38

@grasshopper7

Description

@grasshopper7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions