Xray-App / xray-code-snippets

Xray source-code snippets showcasing the integration with this test management tool for Jira
BSD 3-Clause "New" or "Revised" License
22 stars 3 forks source link

Code snippet for adding findings/evidence to cucumber multipart import? #4

Closed robertlagrant closed 11 months ago

robertlagrant commented 11 months ago

I'd love an example showing how to add evidence alongside the raw results import. Our particular case is we generate a .webm video from Playwright as we step through our BDD tests, and it would be great to automatically attach the video as evidence alongside the BDD results upload.

bitcoder commented 11 months ago

Unfortunately it's not possible to add attachments at the same time you create an issue in Jira. As the Xray API is built on top of it, it inherits this behavior. So, you have to create the issue (i.e., import the results) and then do another request to upload attachments to the Test execution issue that was created. Which language and framework are you using exactly? is it ruby+cucumber?

bitcoder commented 11 months ago

References:

bitcoder commented 11 months ago

Added examples on how to upload attachment(s) to an issue (e.g, Test, Test Execution, Test Plan) in:

In sum, you have to upload the test results.. obtain the Test Execution issue key from the response and then do another request, this time to Jira's REST API, to upload attachments.

robertlagrant commented 10 months ago

Thank you for all those details. Much appreciated. To double check: does X-Ray use Jira's standard ticket attachments as "evidence" when they're attached to a test execution?

bitcoder commented 10 months ago

@robertlagrant , to clarify, we can have attachments at different leves:

In Xray server/datacenter, evidence on the Test Runs is stored as attachments in the underlying Test Execution issue In Xray cloud, evidence on the Test Runs is stored in Xray's cloud infrastructure itself; there's a storage limit (reach out Xray support team for more info on that)

If you decide to add attachments directly to the Test Execution issue (as shown on the snippets above), then it uses Jira way of managing attachments (i.e., a local directory on Jira server or the cloud infrastructure of Atlassian in the case of Jira cloud).

Hope it clarifies!