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
Step definitions in expectations.py are using the decorator @then
This makes it mandatory to use the keyword Then in the scenario for these steps.
Why not simply use @step instead of @then, so that the scenario can be written with any of the keywords?
For instance: @step('I wait on element "([^"]*)?"(?: for (\d+)ms)*(?: to( not)* (be checked|be enabled|be selected|be visible|contain a text|contain a value|exist))*')
makes it possible to write When I wait on element "myButton" to be enabled
but also And I wait on element "myButton" to exist
or Then I wait on element "myButton" to exist
while the current implementation only allows the last syntax.
The text was updated successfully, but these errors were encountered:
mbt-eric-b
changed the title
Suggestion: use @step insted of more specific decorators
Suggestion: use @step instead of more specific decorators
Apr 12, 2023
rather than @given, @when, and @then
because those are restrincting the Gherkin keyword you might use
to Given, When, Then respectively.
@step let's you free to pick the Gherkin keyword that fits best
Step definitions in expectations.py are using the decorator @then
This makes it mandatory to use the keyword Then in the scenario for these steps.
Why not simply use @step instead of @then, so that the scenario can be written with any of the keywords?
For instance:
@step('I wait on element "([^"]*)?"(?: for (\d+)ms)*(?: to( not)* (be checked|be enabled|be selected|be visible|contain a text|contain a value|exist))*')
makes it possible to write
When I wait on element "myButton" to be enabled
but also
And I wait on element "myButton" to exist
or
Then I wait on element "myButton" to exist
while the current implementation only allows the last syntax.
The text was updated successfully, but these errors were encountered: