Junit test screenshots

I’m missing something when I tried to setup Junit report screenshots

I followed instructions in documentation Unit test reports | GitLab

I also twisted wdio junit reporter and junit builder do create ATTACHMENT and when I download parsed junit report ATTACHMENTs are in correct place. I tried a few possible constellations :smiley:

Also Gitlab setting for screenshots is enabled.

Artefact with screenshots is created and contains files.

  artifacts:
    name: errorShots
    expire_in: '1d'
    when: on_failure
    paths:
      - errorShots/
    reports:
      junit: ./results/*.xml

As paths I used how it is in artefact and maybe that’s the problem…
If absolute paths are wrong I would expect at least to see empty boxes with images or some error in gitlab or during fetching data.

What is displayed in gitlab:

Gitlab version: Omnibus 13.8.1-ce

I would appreciate any help.

@zemacnica welcome to the forums and thanks for posting your question.

You have things setup correctly but this feature is not finalized yet which is why you are not seeing any screenshots in the UI associated with failed tests.

You can follow progress in this epic and we welcome contributions!

-James H, GitLab Product Manager, Verify:Testing

Oh, mentioning in Doc made me confused. Then I’m prepared for the future :smiley: . Thank you for response.

1 Like

Hi @zemacnica,
I’m trying to set up attachments for wdio + junit reporter. Can you please elaborate on how did you managed to get attachments included in the report? Thanks in advance!

I had to rewrite some methods as a custom junit reporter and I used original junit reporter classes to extend them. I override build test case output to put there an attachment. Because attachments are not supported by any package I could find.

can you please share the repo/code , how can e implement it, currently we are using Junit reporter on azure pipeline…but not able to attach screenshots@zemacnica