[BUG] Diff between screenshots is not present in the report
See original GitHub issueContext:
- Playwright Version: 1.23.0
- Operating System: Mac
- Node.js version: 16.14.0
- Browser: Chromium
Code Snippet
Playwright config:
const config: PlaywrightTestConfig = {
testDir: 'tests',
fullyParallel: true,
reporter: process.env.CI ? [['github'], ['html']] : [['list'], ['html', { open: 'on-failure' }]],
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
use: {
headless: true,
viewport: { width: 1280, height: 720 },
screenshot: 'only-on-failure',
video: 'retain-on-failure',
trace: 'retain-on-failure',
},
expect: {
toHaveScreenshot: {
threshold: 0.2,
maxDiffPixelRatio: 0.05
},
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
};
export default config;
Method that compares screenshots:
async matchesScreenshot(
locator: Locator,
options?: LocatorScreenshotOptions,
) {
expect(locator).toHaveScreenshot({timeout: 5000, ...options});
}
Describe the bug
I’m doing visual regression testing. I want to see the difference between screenshots in the report. However, the difference is not present there. Also, in the test-results
folder the difference is missing too.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:10 (5 by maintainers)
Top Results From Across the Web
ExtentReports - screenshot not in the report - broken image
I've figured out that a solution is to store the images in the same directory where the report gets generated, give the image...
Read more >It says: "There are still screenshot uploads in progress. ...
This message means there are screenshot uploads that were started but never finished. Normally if an upload fails, App Store Connect will report...
Read more >found this bug (screenshot attached) but don't kno...
Hello @Faisal Tahir ,. Welcome to the community,. The above screen shot is not an issue it basically telling the format. Or please...
Read more >Why do you need screenshots and logs to be attached to a ...
However, past experience has shown that discovered bugs are not immediately rectified. ... Difference between Use Case and Test Case.
Read more >Every Report.Info contains a screenshot on failure when ...
The Report.Info lines then don't contain any screenshots. Only the Error Line does, as expected. It also makes no difference if i use...
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
@muhammad-saleh Thank you for the explanation, this makes sense. So, this is happening because you use full-page screenshots. I’ll reopen this issue for now.
If it helps someone, I have prepared an NPM package patch using https://www.npmjs.com/package/patch-package, that ignores difference in height but still requires the same width of snapshots.