I have tried many option but any of them not work as i need. I have created some feature file as i required time by time. so i have a disorder feature file. I want to run the feature file as i wanted. like.
- fil1.feature
- fil2.feature
- fil3.feature
- fil4.feature so i want to run in this sequence : file3.feature->fil4.feature->fil1.feature.
I have tried @tag, @feature in junit test runner option but its maintain the sequence its run only 3,4 but can't run 1.
So can you tell me how to run feature file randomly???
Cucumber picks up the feature files in alphabetic order from the folder given in the
features
parameter of theCucumberOptions
. So one options would be to rename your feature files alphabetically in the order you want.After the feature files in the initial folder are read, then the sub folders in the location are picked up alphabetically and the feature files inside them are read. So you can place the file you want to be used later into a sub-folder.
Saying all this, it is not a very good idea to have any dependency between tests which requires a sequence to be maintained.