Skip to content

Calling a scenario within a step #48

Discussion options

You must be logged in to vote

So I can think of a few ways to do this cleanly. One is using Background with your Gherkin, it allows you to define a set of steps that should happen before every scenario.

You could also extract your steps to functions, and then call those functions as needed.

Finally, you can use hooks as a way to execute logic before a scenario runs.

All of these should give you the behavior you desire.

Replies: 1 comment

Comment options

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