It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why do embedded screenshots from Cucumber JSON report don't appear as evidence Edited

majchman Apr 19, 2018

I take screenshots at the end of a cucumber test run whenever a scenario fails. This happens in the after hook with this code (java):

@After
public void scenarioRunTearDown() {
if( currentScenario.isFailed() ) {

byte[] screenshot = ((TakesScreenshot)this.driver).getScreenshotAs( OutputType.BYTES);
currentScenario.embed( screenshot, "image/png" );
}
else {
LOG.debug( "scenario passed" );
}

DriverManager.closeDriver();
}

After the cucumber JSON gets imported to a Test Execution in JIRA/Xray the embedded screenshot appears in the steps (examples in case of a Scenario Outline):

Screen Shot 2018-04-19 at 11.39.21.png

The attachment is rather hard to find as this odd eye-icon is hard to spot, if you don't know what to look for. Besides this, the screenshot is not attached to a step where the exception happened, but to another one.

At the same time there already is a place to save execution evidences at the top of an Test Execution details page. Unfortunately the attached screenshot does not appear here:

Screen Shot 2018-04-19 at 11.48.47.png

So... what am I doing wrong here? How do I attach screenshots to a Cucumber JSON report, so that they appear at the right step and in the Execution Evidences box in a Test Execution?

1 answer

0 votes
José Domingues Apr 24, 2018

Hi Majchman,

The problem should be the format, please follow the Xray Json format described in our documentation here and here.
Using this method and format you should be able to manage to obtain the result you need.
As the format you are currently using is for cucumber steps so every evidence you provide through that method will be understood as step evidences.

 

Best regards,

Xpand Add-ons Team

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Marketplace Apps & Integrations

Webinar alert! An IT Admin's Guide to Securing Collaboration at Scale

Hello, Atlassian Community! My name is Dave Meyer and I'm a Principal Product Manager at Atlassian. I wanted to give this community a heads up about an upcoming Webinar that might be of interest...

165 views 2 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you