I have 10 tests that to be run in cucumber and I am using ruby to write my codes. The application under tests design, forces me to have tests that are dependent to each other.
So until the previous case is a pass, the next one fails. I have added cucumber_wants_to_quit
in case the second scenario fails, to avoid waiting to only get the failure reports. Now, I was looking for something like, running the second scenario again, and keep running it until pass
before proceeding to the third scenario.
I know of the command cucumber re-run
but will not want to use it, since this basically runs all the scenarios and runs the failed cases once the first complete run is completed.
My requirement is basically, when the second scenario fails, before moving to third, run the second scenario until pass. In coding language something like
After do |scenario.name|
if scenario.name == failed?
status = scenario.name.run_again until scenario.name == passed
if !status
Cucumber.wants_to_quit = true
end
end
end
Any help on this?