Skip to content

How can I get my scenarios tag values in a before hook? #1157

Discussion options

You must be logged in to vote

In cucumber-js, you can skip a test from Before hooks, like shown below. This hasn't been implemented here though, but can be tracked at #1159.

Before(({ pickle }) => {
  if (pickle.tags.some(tag => tag.name === "@foo")) {
    return "skip";
  }
});

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@badeball
Comment options

Answer selected by badeball
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants