Cannot upload screenshot in JUnit reporter

Cannot upload screenshot in JUnit reporter

Hi everyone,

I’m trying to upload screenshot on CI pipeline test job run.
According to the article: https://docs.gitlab.com/ee/ci/junit_test_reports.html#viewing-junit-screenshots-on-gitlab

If JUnit XML files contain an attachment tag, GitLab parses the attachment.

I can get test results in merge-request and in pipeline view, by using artifacts:reports:junit in my ci yaml config.
However, if add ATTACHMENT with absolute file path to my xml test report, nothing will happen.

Configuration:

  1. Both gitlab features “:junit_pipeline_view” and “:junit_pipeline_screenshots_view” are enabled.
  2. GitLab Enterprise Edition 13.1.1-ee
  3. .NET tech stack, tests are written on C# + SeleniumWebDriver
  4. Tests are running in docker image

My questions:

  1. There is a remark

When this issue is complete, the attached file will be > visible on the pipeline details page

How does upload screenshot on job run work then?

  1. How is it supposed to be used? Should I manually edit testresult.xml at runtime and write filepaths to screenshots, or there is a program way to do that?

Thank you in advance

@yyrozhkov - Thanks for the question!

I’m the Product Manager for the team working on that issue noted. The endpoint has been created and we expect to get to the work that will utilize and display the screenshots in a future milestone. For now junit XML files with attachment tags won’t be parsed or displayed any differently from what appears on the Unit Test Report today.

We would really appreciate hearing about your use case in the issue you noted and what you may have done in the past to see those screenshots alongside test failures.

Thanks!

-James H, GitLab Product Manager Verify:Testing

Hi, @jheimbuck_gl
Thank you for the answer.
Will be waiting for implementation of this feature.