Details
-
New Feature
-
Status: Gathering Interest
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Add support for processing embedded attachments in TestNG XML reports and add them to the overall Test Run attachment.
Using the code from project https://github.com/bitcoder/xray-testng-extensions/blob/master/README.md along with TestNG latest code (from v7.1 onwards), it is possible to build an enhanced XML report that contains attachments.
The attachments will be included inside a <attachments> element, each one in a specific <attachment> element. The filename will be available as an attribute, while the content is available as CDATA inside the <rawcontent> sub-element.
<test-method status="PASS" signature="CanAddNumbers()[pri:0, instance:com.xpand.java.CalcTest@23fe1d71]" name="CanAddNumbers" duration-ms="3" started-at="2019-10-14T10:08:48 WEST" finished-at="2019-10-14T10:08:48 WEST">
<reporter-output>
</reporter-output>
<attachments>
<attachment filename="1.png" src="/Users/smsf/1.png">
<rawcontent>
<![CDATA[....base64 encoded string>
</rawcontent>
</attachment>
<attachment filename="2.png" src="/Users/smsf/2.png">
<rawcontent>
<![CDATA[....base64 encoded string>
</rawcontent>
</attachment>
</attachments>
</test-method>
See testng-results.xml
for sample report.