terencetian
9 months agoVisitor
Junit tags corresponding to Zephyr squad
Hi,
I'm uploading my automation test report in junit format to Zephyr squad cycle through test automation channel. My current junit report format have the following structure:
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"><</SPAN>testsuites</SPAN> <SPAN class="token attr-name">id</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN><SPAN class="token punctuation">"</SPAN></SPAN> <SPAN class="token attr-name">name</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN><SPAN class="token punctuation">"</SPAN></SPAN> <SPAN class="token attr-name">tests</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>8<SPAN class="token punctuation">"</SPAN></SPAN> <SPAN class="token attr-name">failures</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>1<SPAN class="token punctuation">"</SPAN></SPAN> <SPAN class="token attr-name">skipped</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>0<SPAN class="token punctuation">"</SPAN></SPAN> <SPAN class="token attr-name">errors</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>0<SPAN class="token punctuation">"</SPAN></SPAN> <SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"><</SPAN>testsuite</SPAN> <SPAN class="token attr-name">name</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>test suite 1<SPAN class="token punctuation">"</SPAN></SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"><</SPAN>testcase</SPAN> <SPAN class="token attr-name">name</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>test case 1<SPAN class="token punctuation">"</SPAN></SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"></</SPAN>testcase</SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"><</SPAN>testcase</SPAN> <SPAN class="token attr-name">name</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>test case 2<SPAN class="token punctuation">"</SPAN></SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"><</SPAN>failure</SPAN> <SPAN class="token attr-name">type</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>test type<SPAN class="token punctuation">"</SPAN></SPAN> <SPAN class="token attr-name">message</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>test message<SPAN class="token punctuation">"</SPAN></SPAN><SPAN class="token punctuation">></SPAN></SPAN>test failure<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"></</SPAN>failure</SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"></</SPAN>testcase</SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"></</SPAN>testsuite</SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"><</SPAN>testsuite</SPAN> <SPAN class="token attr-name">name</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>test suite 2<SPAN class="token punctuation">"</SPAN></SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"><</SPAN>testcase</SPAN> <SPAN class="token attr-name">name</SPAN><SPAN class="token attr-value"><SPAN class="token punctuation attr-equals">=</SPAN><SPAN class="token punctuation">"</SPAN>test case 3<SPAN class="token punctuation">"</SPAN></SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"></</SPAN>testcase</SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"></</SPAN>testsuite</SPAN><SPAN class="token punctuation">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="token punctuation"></</SPAN>testsuites</SPAN><SPAN class="token punctuation">></SPAN></SPAN>
And I notice the name in the testcase tag in junit report will match zephyr test case's summary and the failure tag will make the test case in cycle fail. Now I have two questions:
- How zephyr squad will match the testsuites and testsuite tags or it's just the structure it needs but won't match anything in zephyr squad (because after I delete the testsuites tag or testsuite tag, zephyr squad returns file format error)
- What tag I can add in the junit file to match test step details in the test execution in test cases in zephyr squad, as I can modify the junit file programmatically.
Hope someone from the team can answer these, because I'm in the early stage to integrate the test automation to our existing zephyr squad in our team. If it's possible, it'll be great to have a comprehensive documentation about the relationship between junit file and zephyr squad, thanks!