-
-
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 #873
Comments
No that is not currently available. Can you point me to the cucumber-ruby documentation or give an example of the use case? |
https://relishapp.com/cucumber/cucumber/docs/defining-steps/skip-scenario Since cucumber does not support IF/ELSE, so it is useful to list all possible scenarios, and make those |
I don't understand this. How does cucumber does not support IF/ELSE?
Could
I'd suggest just making the Given step "pending" and then the rest of the scenario will still be skipped. |
@charlierudolph the use case I heard was where a piece of necessary test infrastructure was not available - something you could only discover at runtime - so it made no sense to run that scenario. I think it was someone testing physical (medical?) devices IIRC. |
@charlierudolph I mean there is no
And thanks for your suggestion, I've tried to use |
Hmm. Okay,, how does the following sound: we introduce an interface that allows a hook or a step to be able to say "mark me as skipped"? Once any hook / step is anything other than passing, the rest of the scenario is already skipped. We can do something very similar to pending for now where you simply need to return the string 'skipped'. |
@charlierudolph Sounds good to me |
Shouldn't be too hard to implement then. If you or anyone else would like to try and implement this: I think we can model this pretty well after pending steps. I'd suggest starting with a feature test similar to the pending steps feature and then adding in some logic to support it here. For now I don't think we need to add any other type of reporting or anything. |
An alternate point of view: I don't know if it'll break a major design decision at the very core of cucumber, but it would be extremely useful if FeforeFeatures, BeforeFeature, BeforeScenario and BeforeStep could mutate their cucumber payloads and affect the behavior of the future testflow. Among these mutations, a I imagine there're a lot of benefits to the testflow being immutable once it's loaded. Is it an intentional design feature in cucumber? |
@yaronassa Can you please open a new issue for your comment and clarify what you mean by affect the behavior of the future workflow? What are some examples of what you need to change? |
I skip scenarios using following hook:
|
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. |
There is a
skip_this_scenario
function in Ruby version.Is it able to skip scenario imperatively in JavaScript version?
The text was updated successfully, but these errors were encountered: