You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@wakaleo : We recently migrated to Serenity 4 with JUnit 4, and we are looking for ways to control the order of execution of our test scenarios. Currently, our tests run in an unpredictable order, and we need a way to define a specific sequence.
Could you please confirm if there’s a built-in way to control execution order in Serenity BDD?
The text was updated successfully, but these errors were encountered:
This is not possible by design in JUnit (relying on test execution order can mean you have dependencies between your tests), but in JUnit 5 you can use the Order annotation for that.
@wakaleo Since we can define the @order annotation at the method level , which applies to test methods, will that help us control the execution order of scenarios in serenity BDD feature files ?
I upgraded JUnit from version 4 to 5 in our Serenity BDD pom.xml. Now, the @order annotation can be defined at the step definition class level. I was wondering if this can control the execution order of feature files or scenarios in my feature files.
No, the order annotation is a JUnit 5 annotation. BDD scenarios are executed in order of appearance in the feature file, unless you run them in parallel (in which case the order is not determined).
There are a few hacks you can do to control the order of execution of the feature files themselves, byt wanting to do so is usually a red flag that your scenarios or features have dependencies, which leads to brittle test suites.
@wakaleo : We recently migrated to Serenity 4 with JUnit 4, and we are looking for ways to control the order of execution of our test scenarios. Currently, our tests run in an unpredictable order, and we need a way to define a specific sequence.
Could you please confirm if there’s a built-in way to control execution order in Serenity BDD?
The text was updated successfully, but these errors were encountered: