Skip to content
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

Merged
merged 6 commits into from
Sep 23, 2017

Conversation

jshifflet
Copy link
Contributor

First pull request ever.

Let me know if I need to fix anything.

This is for issue #873

Thanks.

Copy link
Member

@charlierudolph charlierudolph left a 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.

Given a skipped step
"""

Scenario: Synchronous pending step
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending -> skipped

And the step "a skipped step" has status "skipped"


Scenario: Callback pending step
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending -> skipped

Then it passes
And the step "a skipped step" has status "skipped"

Scenario: Promise pending step
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending -> skipped

@jshifflet
Copy link
Contributor Author

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 skipped can be used in a hook.

Where in hooks.md should I add the documentation for this feature?

@charlierudolph
Copy link
Member

Looks great! How about on hooks.md between the tagged hooks section and before / after all section.

@jshifflet
Copy link
Contributor Author

Added an example to hooks.md.

Let me know of any changes needed.

@charlierudolph charlierudolph merged commit fd1f7a0 into cucumber:master Sep 23, 2017
@aslakhellesoy
Copy link
Contributor

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:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@jshifflet
Copy link
Contributor Author

Thanks and thanks @charlierudolph for the help on this pull request.

@charlierudolph
Copy link
Member

charlierudolph commented Sep 23, 2017

@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

@jshifflet
Copy link
Contributor Author

@charlierudolph would this just be a custom message that appears during test execution?

@charlierudolph
Copy link
Member

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'}

@jshifflet
Copy link
Contributor Author

@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.

@charlierudolph
Copy link
Member

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.

@jshifflet
Copy link
Contributor Author

Got it. I will try to get a proof-of-concept done.

@lock
Copy link

lock bot commented Oct 24, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants