testng запускает тесты не по порядку но не радномо (после перезапуска порядок не измениться ) и чтобы сохр порядок юзаем preserve-order="true" (работает только если метод вписан в xml include name=)
<test name="logintest1" verbose="0" preserve-order="true" enabled="true">
[INFO] ------------------------------------------------------------------------ [INFO] Building regressionui 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] ... [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running TestSuite [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.78 s - in TestSuite [INFO] Results: [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------ [INFO] Building regressionui 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] ... [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running TestSuite PASSED: loginTest PASSED: wrongMailTest PASSED: wrongPassTest PASSED: invldMailTest PASSED: blankPassTest PASSED: blankMailTest =============================================== logintest1 Tests run: 6, Failures: 0, Skips: 0 =============================================== [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.78 s - in TestSuite [INFO] Results: [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
each class should be represented in xml:
suite>classes>class.name=foo1 + class.name=foo2
no dublicate allowed:
suite>classes>class.name=foo1 + class.name=foo1