[BUG] "expect(element).toHaveScreenshot" method doesn't auto-retry screenshot till the timeout, it fails after first try
See original GitHub issueContext:
- Playwright Version: 1.22.1
- Operating System: Mac
- Node.js version: 14.4
- Browser: Chromium
Using the code from docs example which is below, expect timeout is set to 15 seconds but in fact I see that “expect(element).toHaveScreenshot” method fails after first try of comparison, it doesn’t re-try screenshot.
const locator = page.locator('button');
await expect(locator).toHaveScreenshot();
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top Results From Across the Web
How to make puppeteer wait for page to load - Urlbox
Waiting for too long after the page is loaded, means we are wasting unneccessary time and causing the screenshot request to take longer...
Read more >screenshotWaitTimeout not accepted as a capability?
Exception: Message: u"An unknown server-side error occurred while processing the command. (Original error: Timed out waiting for screenshot file.
Read more >Capturing the element issue - Help - UiPath Community Forum
Hi, I want to capture this wrong credential pop-up, But this is visible on the screen for 1-2 sec, when we capture it...
Read more >Using the Screen Capture API - MDN Web Docs
In this article, we will examine how to use the Screen Capture API and its getDisplayMedia() method to capture part or all of...
Read more >How to capture/take Selenium Screenshot as Full ... - Tools QA
Why is Screenshot required in Automation testing? How to take a Selenium screenshot Full page & of a particular element in Selenium ?...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In our use case, we would very much like a matcher that retakes a screenshot until it matches the snapshot. I really hope that something like what @aslushnikov mentioned in https://github.com/microsoft/playwright/issues/14226#issuecomment-1131777539 is implemented in playwright. (polling a screenshot)
Would you be able to confirm if such functionality is underway, or was this just a comment with little weight behind it? If no such method will be available in the near future, we will know to explore an alternative solution.
We also stumbled across this problem and expected the feature to behave like @VsKathsuma described it. Would that be a bigger change?