Rogger Fernandes
Rogger Fernandes

Reputation: 915

Skip next tests when one fail serenity cucumber

I am using Serenity with Cucumber to write automated web tests, I could not find in docummentation a way to ignore next tests when one fails.

Currently, if a step fails to run, next steps in the same SCENARIO are ignored, but next scenarios in the feature are executed.

I want that when a test fail, skip all next steps and scenarios.

Upvotes: 2

Views: 2119

Answers (2)

kfairns
kfairns

Reputation: 3057

To elaborate on what John Smart has said:

Each scenario should be able to pass without having to rely on the scenarios that have been run before it.

What's more: internet connection is known to be temperamental on occasion. If one of your scenarios fails because the Internet dropped out while waiting for a page to load, you don't want to have all the scenarios after that (that could be unaffected by the first failure) to be skipped.

In short:

Making your scenarios independent reduces brittleness of your automation suite.

Skipping scenarios if one fails is bad practice (especially for web applications), due to the fact that internet connection is not a constant that you can rely on.

Upvotes: 0

John Smart
John Smart

Reputation: 942

That isn't supported in Serenity or in BDD tools in general. Scenarios are intended to be independent examples of acceptance criteria or business rules, not steps in a larger test

Upvotes: 3

Related Questions