I have 2 tests that I need to run one after another for several times.
The desired scenario is: "first test", "second test", "first test", "second test" and so on...
The actual scenario is: "first test", "first test", "second test", "second test".
@Test (priority = 1, invocationCount = 3)
public void first() {
System.out.println("first test");
}
@Test (priority = 2, invocationCount = 3)
public void second() {
System.out.println("second test");
}
How can I achieve my desired scenario?
Another requirement here is that on the first test, android phone should be the first device and ios phone should be the second device. On the second test, the ios phone should be the first device and the android should be second. So it means that I need to use a different xml file.
<test name="TwoDevices - ios first">
<parameter name="appName" value="App2"/>
<parameter name ="device" value="IOS/iphone6_plus"/>
<parameter name ="secondDevice" value="ANDROID/lg4_v5"/>
<classes>
<class name="com.TestFactory"/>
</classes>