-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'skipped' status returned from When is not preventing the execution of Then step #1312
Comments
Auhh. The original requirements for the "skipped" feature involved being able to skip a scenario from a before hook. This seems like a valid use case and something that needs to be fixed. |
Hum... so is the example from |
This feature describes and tests the current behaviour around "skipped" https://github.com/cucumber/cucumber-js/blob/main/features/skipped_steps.feature - we'd be adding a couple more scenarios there to cover skipping from steps. The status is being set on the basis of the "skipped" result from the step code here https://github.com/cucumber/cucumber-js/blob/main/src/runtime/step_runner.ts#L66 - so the orchestration a level up in https://github.com/cucumber/cucumber-js/blob/main/src/runtime/test_case_runner.ts is probably where we need to make changes. |
We're confused because we expected the scenario to fail but it is passing. Co-authored-by: Matt Wynne <matt@mattwynne.net>
@mattwynne and I tried to reproduce the scenario but surprisingly, it doesn't fail. Here's a link: main...RukenaG:fix-#1312? @sfdcale, do you see anything wrong with our implementation of the scenario? @davidjgoss is it possible this bug has been fixed accidentally since this bug was reported? |
@RukenaG so sorry for the late reply! The scenario you added looks great. Would you be okay to raise a pull request? We'll probably need to update some docs at the same time. Yeah looking now, it's very possible this happened by accident, probably as part of the big rework to use the messages protocol. |
Closing this as per discussion the current behaviour includes skipping at the step level. @gloryCU would still be happy to take a PR for that scenario, as that's valuable coverage and documentation. |
I am struggling to skip the execution of
Then
step when status returned fromWhen
method is'skipped'
:Snippet1:
This is not working(
Then
step is executed)Snippet2:
This is working(
Then
step is not executed)Why snippet1 is not skipping the execution of
Then
step?My ultimate goal is to skip the execution of
Then
step based on the results of some operation inWhen
step.The text was updated successfully, but these errors were encountered: