I have 4 test cases and I want the first test case to run from Demo1.java and then run the other 2 test cases from Demo2.java and then return back to Demo1.java to execute the final test case.
Is there any way I can achieve this? Thanks for your help.
- I have tried
priorityparameter but I guess that just checks for the priorities in the same test class
Here is a sample code -
Demo1.java
class Demo1{
@Test
public void testOne(){ //This case should be executed first
}
@Test
public void testFour(){ //This case should be executed last
}
}
Demo2.java
class Demo2{
@Test
public void testTwo(){ // This case should be executed 2nd in the order
}
@Test
public void testThree(){ // This case should be executed 3rd in the order
}
}