Skip to content

Instantly share code, notes, and snippets.

@bbrother92
Last active April 19, 2019 15:34
Show Gist options
  • Save bbrother92/8cbee0d46706436ebefffa05b5d099a8 to your computer and use it in GitHub Desktop.
Save bbrother92/8cbee0d46706436ebefffa05b5d099a8 to your computer and use it in GitHub Desktop.

testng запускает тесты не по порядку но не радномо (после перезапуска порядок не измениться ) и чтобы сохр порядок юзаем preserve-order="true" (работает только если метод вписан в xml include name=)

verbose option

<test name="logintest1" verbose="0" preserve-order="true" enabled="true">

"0":
[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] ------------------------------------------------------------------------
"2":
[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] ------------------------------------------------------------------------

xml

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

bfs Suite > bft Test>bfc Class> bfm Methods

Master suite
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Suite1" verbose="1" >
    <suite-files>
        <suite-file path="suite1.xml"/>
        <suite-file path="suite2.xml"/>
    </suite-files>
</suite> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment