-
-
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
Support to imperatively skip scenario Fixes #873 #912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Can we add a description to the feature to describe the use case?
I think we should also update some documentation. Probably here alongside pending step definitions: https://github.com/cucumber/cucumber-js/blob/08c138ac61f7517c0ea9d0dce59928163cb954d0/docs/support_files/step_definitions.md and in hooks. We should also clearly define the intended for this so people know when they should be using it.
features/skipped_steps.feature
Outdated
Given a skipped step | ||
""" | ||
|
||
Scenario: Synchronous pending step |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending -> skipped
features/skipped_steps.feature
Outdated
And the step "a skipped step" has status "skipped" | ||
|
||
|
||
Scenario: Callback pending step |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending -> skipped
features/skipped_steps.feature
Outdated
Then it passes | ||
And the step "a skipped step" has status "skipped" | ||
|
||
Scenario: Promise pending step |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending -> skipped
Please see updates. I have updated the step_definitions.md and added some feature text to the top of the added feature file. I also added a cucumber test to verify that Where in hooks.md should I add the documentation for this feature? |
Looks great! How about on |
Added an example to hooks.md. Let me know of any changes needed. |
Hi @jshifflet, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
Thanks and thanks @charlierudolph for the help on this pull request. |
@jshifflet something I was debating around this. Currently the step is marked as skipped but the output doesn't say anything about why its skipped. We may need to add the ability to return a reason why it skipped and then update the output to reflect that why. I personally don't intend on using this, so please let me know how its like to use this. I'm preparing a release now |
@charlierudolph would this just be a custom message that appears during test execution? |
I was just thinking of reporting this the same way a pending step is reported. In order to allow a message we could open up the API to be something like // skipping without a reason
return 'skipped'
// skipping with a reason
return {status: 'skipped', reason: 'x resource is missing'} |
@charlierudolph sounds good. Is there an example of a pending step giving a reason? I was looking here: https://github.com/cucumber/cucumber-js/blob/master/features/pending_steps.feature and at the event protocol. Thanks. |
The reason would be a new feature (pending steps do not support currently support it). I was primarily referring to the progress / progress-bar / summary formatters for pending steps are reported. |
Got it. I will try to get a proof-of-concept done. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
First pull request ever.
Let me know if I need to fix anything.
This is for issue #873
Thanks.