Last active
September 4, 2025 15:20
-
-
Save observethenoyes/d457b4c5db032c8476f89952f546d5be to your computer and use it in GitHub Desktop.
Visual Regression Masking Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { expect, test } = require('@playwright/test') | |
| test('wait for an element to become visible', async ({ page }) => { | |
| await page.goto(process.env.ENVIRONMENT_URL || 'https://www.winzogames.us') | |
| await page.waitForLoadState('networkidle'); | |
| // Use the "toHaveScreenshot" matcher to compare screenshots between check runs | |
| // Don't forget to --update-snapshots on your first run! | |
| await expect(page).toHaveScreenshot({ | |
| maxDiffPixelRatio: 0.2, //Define your thresholds here | |
| maxDiffPixels: 1000, //Define your thresholds here | |
| threshold: 0.2, //Define your thresholds here | |
| fullPage: true, | |
| animations: 'disabled', | |
| mask: [ // Mask out dynamic content on WinZO Homepage | |
| page.locator('[class*="MatchMakingComponent_root"] .container').locator('> div').first().locator('> div') | |
| ], | |
| omitBackground: true, | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment