2016-02-24 30 views
0

我有吸引力的XML類似下面爲什麼失敗消息步驟也是在HTML報告

<test-case start="1456329345978" stop="1456329352078" status="failed"> 
<name>SYSTEM_ASSERT_ERRORS</name> 
<title>Assert that there are no critical errors</title> 
<description type="text">Assert that there are no critical errors </description> 
<failure> 
    <message>AssertionError: FAIL: 3 out of 4 test steps failed</message> 
    <stack-trace>java.lang.AssertionError: FAIL: 3 out of 4 test steps failed: Not true that &lt;3&gt; is equal to &lt;0&gt;   
    </stack-trace> 
</failure> 
<steps>     
    <step start="1456329346636" stop="1456329351963" status="passed"> 
     <name>verifyLogs[JSchException]</name> 
     <title>verifyLogs: [JSchException]</title>      
    </step> 
    <step start="1456329346636" stop="1456329351965" status="failed"> 
     <name>verifyLogs["Error code"]</name> 
     <title>verifyLogs: ["Error code"]</title>      
    </step>     
</steps> 
<attachments> 
    <attachment title="log.txt" source="1be56864-2031-4e82-bfdd-ce5152a5bbc2-attachment.txt" type="text/plain"/> 
</attachments>    

在此轉換爲HTML中複製, 故障顯示在頂部測試用例窗格以及第一個失敗步驟之下?

我沒有看到在那裏再次顯示的理由?有什麼理由?

回答

0

原因可能是使失敗的測試步驟可見。另外,如果您有很多測試步驟,您可以檢查失敗步驟的堆棧跟蹤,而無需在最上面滾動。

如果您在測試中捕獲異常或映射它們,則測試步驟拋出的實際異常可能與Allure報告的異常不同。它被認爲是不好的做法(以及管理測試中的線程),並且不受到Allure,AFAIK的支持。

所以,我現在沒有看到問題。

+0

假設多個測試步驟失敗。堆棧跟蹤其中一個將顯示在頂部。 – Karthik

+0

多個測試步驟失敗假定您嘗試在您的測試中捕獲異常,這被認爲是不好的做法。在頂部的例外將顯示 - 一個由測試方法拋出(不能是多個)。 – volkovs

+0

測試步驟在這裏被視爲軟性斷言...不確定這裏的壞習慣... – Karthik

相關問題