As per cucumber 4 with TestNG:
When using TestNG in parallel mode, scenarios can be executed in separate threads irrespective of which feature file it belongs too. Different rows in a scenario outline can be also executed in separate threads. The two scenarios in feature1.feature file will be executed by two threads in two browsers. The single feature2.feature will be executed by another thread in a separate browser.
Now suppose I have a scenario like below in feature1:
1st scenario : Create an user with some details.
2nd scenario : Edit an user with some details.
Now if in TestNG if both scenario invoke at the same time then my 2nd scenario will fail for sure as the user is not created yet.
Do I just switch to Junit as:
When using JUnit in parallel mode, all scenarios in a feature file will be executed in the same thread. The two scenarios in feature1.feature file will be executed in one browser. The single feature2.feature will be executed by another thread in a separate browser.
Below function just having the parameter to run it as parallel.
@Override
@DataProvider(parallel = true)
public Object[][] scenarios() {
return super.scenarios();
}
So my main question is how to configure my test in parallel so my test can run systematically. i.e execute parallel per feature file, or any tag which can mark scenario depended on another like we have in TestNG @Test(dependsOnMethods = { "testTwo" })
.
Kindly suggest any configuration setting for cucumber or strategy which can be use for same.