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.

screenshot on failure capturing passing specs as well

See original GitHub issue

Hello, we are trying to capture screenshots automatically on failure. This works but seems to also capture screenshots from other (passing) specs which are running in parallel. We have 10 workers but seem to consistently get 6 other screenshots (of non-failing specs) along with the intended screenshot of our (temporarily purposefully) failing spec.

Is this a known issue or are we perhaps doing something wrong? The only addition we made to light this up is the line in the config per to the docs: screenshot: 'only-on-failure'

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TimeInvestorcommented, Feb 2, 2022

Hi @CThompsonLifeTime It is because you create the page manually via page = await browser.newPage(); instead of using the page fixture. The solution is to close the page manually by calling await page.close() after each test.

0reactions
CThompsonLifeTimecommented, Feb 7, 2022

This solved our problem - thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Capture Screenshot in Selenium for Failed Test Cases
We will create a Utility class that will have one method which will capture the screenshot. Utility.
Read more >
How to Capture Screenshot for Failed Tests in TestNG
Get all my courses for USD 5.99/Month - https://bit.ly/all-courses-subscription FREE Training's at https://training.rcvacademy.com ...
Read more >
Capture screenshots of flaky end-to-end tests - CircleCI
If a test fails, take a screenshot of the webpage and store it somewhere - that way, you can look into the failure...
Read more >
TestNG Selenium Capture Screenshot on failure
Hi, I am very new to Selenium. Could you please help me with the steps to Capture Screenshot on failure using TestNG Framework...
Read more >
Attach Screenshots on Test Failure — WebdriverIO
Wouldn't it be nice to know the exact state of the application you are testing whenever a test failed to help debug your...
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