Emjey
Emjey

Reputation: 2063

How do skip cucumber steps?

I have a requirement to skip the rest of the steps of the test, based on the output of the previous/current step.

How do I do that with cucumber? I am using cucumber with ruby along with gherkin.

Basically, I want to check if the element in an application in dashboard is enabled, the test should proceed only when it is, else it should skip the rest of the test steps.

I tried using AfterStep in hooks next if condition and scenario.skip_invoke! but cucumber says it has undefined method

Can anyone help me understand about how do I achieve skipping the test?

Upvotes: 0

Views: 641

Answers (1)

Daniel Fintinariu
Daniel Fintinariu

Reputation: 2793

Try using the skip_this_scenario method.

Information on this can be found here

Upvotes: 3

Related Questions