reportportal / agent-js-jest

Agent to integrate Jest with ReportPortal.
https://www.npmjs.com/package/@reportportal/agent-js-jest
Apache License 2.0
21 stars 36 forks source link

Upload Screenshots function #138

Closed owens-ben closed 4 months ago

owens-ben commented 6 months ago

Hi @AmsterGet, here is the code I wrote to upload screenshots.

It works by looking for the directory of screenshots, then normalizing the failed test titles and matches them with the screenshot directory.

This was written to work specifically with my org's file structure so there will be several changes you'll need to implement to make it versatile enough for everyone.

You may also prefer to take a different approach by implementing another tempid value that would remove the need for string manipulation and probably be more resilient.

AmsterGet commented 6 months ago

Hi @owens-ben ! Thank you very much! I'd also like to engage @AliakseiLiasnitski to review this PR, as he has been working on researching how to implement this feature. Aliaksei will be back from vacation next week and we'll check your suggestions.

AmsterGet commented 6 months ago

Related to https://github.com/reportportal/agent-js-jest/issues/122