I have a testng suite file which has 10 classes inside a test. Say
<classes>
<class name = "Class1">
<class name = "Class2">
<class name = "Class3">
</classes>
Now class1 has 3 methods with priority 1,2,3 in order and the same with class 2 and class3. When I run the job in Jenkins with suite having preserve-order="true", the tests run as class1-priority1 test, class2-priority1, class3-priority1, class1-priority2, class2-priority2 etc.
I need to have all the tests associated with class1 executed inorder first and then class2 and then class3.
Could someone tell me why this behavior is?