If you are referencing the world instance (which is bound to this
) in a step definition or hook, then you cannot use ES6 arrow functions.
Cucumber uses apply internally to call your step definition and
hook functions using the world object as this
.
Using apply
does not work with arrow functions, so if you need to reference the world, use a regular function
.
Why do my definition patterns need to be globally unique instead of unique only within Given
, When
, Then
?
To encourage a ubiquitous, non-ambiguous domain language.
Using the same language to mean different things is basically the definition of ambiguous.
If you have similar Given
and Then
patterns, try adding the word “should” to Then
patterns.