I am struggling to run my groovy-spock tests in specific order. Currently, I can run all my tests but it does not follow any sequence. I read about [http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html][1] but I did not find anything about following a specific order. Can we do this using Maven?
Asked
Active
Viewed 94 times
0
-
https://stackoverflow.com/questions/3693626/how-to-run-test-methods-in-specific-order-in-junit4 – daggett Aug 28 '18 at 12:45
-
Did you try `runOrder` argument? Check details here for example: https://stackoverflow.com/questions/12075725/how-do-i-control-the-order-of-execution-of-tests-in-maven – yuppie-flu Aug 28 '18 at 12:45
-
6It is a really bad idea, to have tests depend on each other. And otherwise, there is no reason for a certain order. – jokster Aug 28 '18 at 13:00
-
In Spock there is an annotation `@Stepwise` but usually unit tests should never rely on a particular order otherwise you are doing integration tests... – khmarbaise Aug 28 '18 at 13:05