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
I just saw that we CAN use AND in the feature file itself. It's just that in the step file we have to use the Step function. Although it would be nice to have an And() call instead of a Step call just to reduce the cognitive overhead due to the difference, I'm closing as it's unlikely to make it in.
Hi @J7mbo
Yes, you can use AND in feature files and it is not required to define such steps with Step function. You can use any of Given, When, Then. I will highlight it in docs, that Cucumber treats all these functions as aliases and matches step only by pattern, not by keyword. Here are a few issues with some explanation:
Concerning And() function - I think the same step can be often used with both full keyword and AND / BUT, step definition should not know about that context. Such functions were deprecated in Cucumber for Cypress, for the same reason.
While investigating this issue, I found that there were several discussions on enforcing strict keyword matching:
The problem
It would be very useful to have
AND
support in features instead of using multipleGiven
s orWhen
s:instead of:
cucumber reference
The text was updated successfully, but these errors were encountered: