Is there any way to match the following steps unambiguously?
And I should have 2 alerts
And I should have 2 alerts with param 71
I have implemented them as:
@And("^I should have (\\d+) alerts")
@And("^I should have (\\d+) alerts with param (\\d+)")
When Cucumber evaluates the second step it says that it is ambiguous because it could have matched either of the two step definitions, even though it has the extra words 'with param'.
Thanks in advance.
is matched by both steps because
matches anything that begins with
Terminate that step definition with
$
and it will no longer match steps which keep going: