You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project was recently upgraded to Cucumber 5 from Cucumber 4, and we are having a regression when attempting to pass an empty list to a step.
I have a step like the following:
@Then("I see only the following buttons:")
public void validateButtons(List buttonNames) {
// Check for the buttons
}
Importantly, this step throws an error if there are unexpected buttons. So, we use it to both ensure the presence of expected buttons, and the invisibility of other buttons. For example, we use it to make sure that there is not an "Edit" button for certain users, like so:
Then I see only the following buttons:
| Send Record for Approval | Validate Record |
However, sometimes we need to validate that there are no buttons on the page. To make that happen we would call the step like so:
Then I see the following buttons:
|
This would then pass an empty list to the step.
After upgrading to Cucumber 5, scenarios that are passing the empty list are failing when attempting to initialize the runner class with the following error:
RunnerClass.initializationError Time elapsed: 0.012 s <<< ERROR!
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
I've checked through the code, and the issue appears to be that when the constructor of GherkinVintageDataTableArgument is called, it calls the getLocation() method from PickleTable, and this method just returns the getLocation() method from PickleCell. Since there are no cells in this situation, the error is thrown.
I recognize that passing an empty table to a step might not be something that you want to support. But it was something that was allowed earlier, and I'd appreciate it if there is some way to allow it again.
The text was updated successfully, but these errors were encountered:
My project was recently upgraded to Cucumber 5 from Cucumber 4, and we are having a regression when attempting to pass an empty list to a step.
I have a step like the following:
Importantly, this step throws an error if there are unexpected buttons. So, we use it to both ensure the presence of expected buttons, and the invisibility of other buttons. For example, we use it to make sure that there is not an "Edit" button for certain users, like so:
However, sometimes we need to validate that there are no buttons on the page. To make that happen we would call the step like so:
This would then pass an empty list to the step.
After upgrading to Cucumber 5, scenarios that are passing the empty list are failing when attempting to initialize the runner class with the following error:
I've checked through the code, and the issue appears to be that when the constructor of GherkinVintageDataTableArgument is called, it calls the getLocation() method from PickleTable, and this method just returns the getLocation() method from PickleCell. Since there are no cells in this situation, the error is thrown.
I recognize that passing an empty table to a step might not be something that you want to support. But it was something that was allowed earlier, and I'd appreciate it if there is some way to allow it again.
The text was updated successfully, but these errors were encountered: