question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot see attached screenshots to html

See original GitHub issue

Screenshots are added to jest-html-reporters-attach directory, seems to be in hidden text area in html but cannot see any attached to specific failed test report.

Use jest + playwright piece of code

```async handleTestEvent(event) {
    if (event.name === 'test_done' && event.test.errors.length > 0) {
        const specName = event.test.name.replace(/\W/g, '-');
        const browser = await this.global.browserName;
        const img = await this.global.page.screenshot({
            path: `e2e/output/screenshots/onFail/${browser}_${specName}.png`,
        });
        await addAttach(img, `${browser}_${specName}`);
    }
}```

I use playwright_environment

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
devineacommented, Oct 27, 2021

You may need to pass the filename as a relative path from the report html file so that it can be located via http uri on Jenkins for examplel

https://github.com/Hazyzh/jest-html-reporters/issues/54#issuecomment-671026836

1reaction
JacoKarsten-Korbicomcommented, Oct 27, 2021

Sorry guys, I no longer use Jest. I have moved on to Playwright’s built-in test runner (and reports).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attaching screenshots doesn't work for html reports #1443
Embed screenshot in your code; Run the test with HTML formatter; Observe results. Expected behavior. Image is attached in HTML report. Screenshots If...
Read more >
Screenshot attched but not showing in outlook Error: - Help
I'm adding screenshot in outlook mail body.Mail sent successfully but image is not displaying. I guess outlook is not finding src of img...
Read more >
Screenshots not attached to Extent Reports C#, DotNet CORE ...
The problem is with attaching the screenshots to the reports as I could see the screenshots being created in the directory. using System;...
Read more >
How to attach screenshot in cucumber-html report - YouTube
In this video we will learn "how to attach screenshot in cucumber- html report for Failed steps" using attach () in cucumber latest...
Read more >
Can't see the 'Attach Screenshot' link after disabling or ...
When you install this plugin, it will automatically disable the system bundled attach screenshot plugin, but will not automatically enable it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found