Although similar to Optional parameter in cucumber, still it is for ruby programmers which I am not familiar with...
So what I'd like to have is to be able to use either one of those two options:
Given REST ADCC Login with username "admin" and password "admin"
and
Given REST ADCC Login with username "admin"
For the latter I would allow myself to set the password with the username value for testing purposes only.
The step implementation as I understood is:
@Given("^REST ADCC Login with username \"(.*)\"(?: and password \"(.*)\")?( negative)?$")
public void login(String username, String password, String negative) {
loginLogoutStepsHandler.login(username, password);
}
but then, when I use the first step option, with the password defined, the password param gets null as it should have been "admin".
What is wrong with my syntax?
Thanks!