How do i add any type of document evidence to the particular test run evidence using JIRA API.
You can go to the page i am referring to by -
Story -> subtest execution -> execution details -> evidences -> add evidence
the test type is Cucumber.
JIRA is already integrated with XRAY plugin.
I am trying to attach using REST API. I have looked through XRAY documentations but could not achieve the result.
1. Option 1: add attachments while running the tests
Assuming that you're using a Cucumber JSON report, that information can be added while running your tests, by adding it in your Cucumber Java code (are you using Java to make the steps code?), for example after a scenario fails.
https://javadoc.io/doc/io.cucumber/cucumber-core/4.7.2/io/cucumber/core/api/Scenario.html
@After
public void doSomethingAfter(Scenario scenario){
if (scenario.isFailed()) {
scenario.embed(((TakesScreenshot)driver).getScreenshotAs(OutputType.BYTES), "image/png");
}
}
This screenshot will be embed on the cucumber json report, and Xray will show it in the UI after you import the results.
2. Option 2: submit evidence after uploading the test results
This is trickier. To add the evidence to the test run, you'll need to use GraphQL API for that.
You could also the evidence to the Test Execution issue; this would be possible using Jira REST API for adding attachments to issues; however, it would be a bit cumbersome as the Test Execution usually contains results related with several test runs (and not just one)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.