1

I have a test documentation tool which accepts reports in XML and JSON. I need to attach screenshots to every test case even the passed ones. Unfortunately, the tool (xRay for Jira) can only digest screenshots in a form of JSON and cannot in XML. I know that cucumber does reports in json but I do not want tests to be BDD-like.

Is there a test runner, which can do reporting in JSON or a solution on how to convert JUnit 5 XML report to appropriate JSON format with screenshots in Base64.

Current set up is Java/Gradle/JUnit5/Selenide but can be reviewed.

Vlad Titov
  • 686
  • 1
  • 6
  • 15
  • You can implement your own reporter that generates the output in json. You'll have to wrestle a bit with your build system to get it activated: https://junit.org/junit5/docs/current/user-guide/#launcher-api-listeners-reporting – M.P. Korstanje Apr 05 '21 at 18:53

1 Answers1

1

Importing attachments, as of today, is supported if you use Xray JSON or Cucumber JSON reports.

The only way, right now, would be to implement either a JUnit5 TestExecutionListener or a TestWatcher that would generate a Xray JSON report.

Note: in the short term, support will be added for JUnit 5 and also for TestNG; currently, this is experimental and not yet supported in the product but please raise a support request asking for this improvement, so the team can track your interest on it. The URLs for the previous repos will probably change.

Sérgio
  • 1,777
  • 2
  • 10
  • 12