簡體   English   中英

testNG 中的測試套件結果依賴性

[英]Test suite result dependency in testNG

我有包含以下格式的其他測試套件的測試套件 xml 文件:

<suite-files>
    <suite-file path="debug1.xml" />
    <suite-file path="debug2.xml"/>

</suite-files>

有沒有辦法在兩個子套件之間添加依賴項? 這意味着如果debug1.xml失敗,則debug2.xml不應執行debug2.xml TestNG 不提供對<suite-files>級別的任何依賴。 這可以通過一些聽眾來完成嗎?

您可以在測試代碼中定義TestNG 組安排如下依賴項

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

<suite name="test">

    <groups>
        <dependencies>
            <group name="debug1" depends-on=""/>
            <group name="debug2" depends-on="debug1"/>
        </dependencies>
    </groups>
    <suite-files>
        <suite-file path="debug1.xml"/>
        <suite-file path="debug2.xml"/>
    </suite-files>
</suite>

參考:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM