-
-
Save up1/4a4eb4dcabb3bdc2f2629b8e379914e9 to your computer and use it in GitHub Desktop.
Playwright 1.63
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
| // Visual comparisons store the golden snapshot as lossless WebP. | |
| await expect(page).toHaveScreenshot('homepage.webp'); | |
| // Standalone screenshots can trade quality for size with lossy WebP. | |
| await page.screenshot({ path: 'homepage.webp', quality: 50 }); |
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
| test('click should expand', async ({ mount }) => { | |
| const component = await mount('components/Expandable/Stateful'); | |
| await component.getByRole('button').click(); | |
| await expect(component.getByTestId('expanded')).toHaveValue('true'); | |
| }); |
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
| // playwright.config.ts | |
| export default defineConfig({ | |
| retries: 2, | |
| retryStrategy: 'isolated', | |
| }); |
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
| // Test A | |
| test('update user settings', { lock: 'user-settings' }, async ({ page }) => { | |
| // ... | |
| }); | |
| // Test B | |
| // Never runs concurrently with 'update user settings' above, | |
| // even in a different project. | |
| test('rename user', { lock: 'user-settings' }, async ({ page }) => { | |
| // ... | |
| }); | |
| // Test C | |
| test('reset the database', { lock: ['database', 'external-api'] }, async () => { | |
| // ... | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment