Skip to content

Commit

Permalink
test: try to unflake screenshot tests (#4334)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Nov 4, 2020
1 parent 5c1149f commit 78b1511
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/page-screenshot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ describe('page screenshot', (suite, { browserName, headful }) => {
await page.setViewportSize({width: 500, height: 500});
await page.goto(server.PREFIX + '/screenshots/canvas.html');
const screenshot = await page.screenshot();
expect(screenshot).toMatchSnapshot('screenshot-canvas.png', { threshold: 0.3 });
expect(screenshot).toMatchSnapshot('screenshot-canvas.png', { threshold: 0.4 });
});

it('should work for webgl', (test, { browserName }) => {
Expand Down Expand Up @@ -298,7 +298,9 @@ describe('page screenshot', (suite, { browserName, headful }) => {
expect([buffer[0], buffer[1], buffer[2]]).toEqual([0xFF, 0xD8, 0xFF]);
});

it('should work with large size', async ({ page }) => {
it('should work with large size', test => {
test.slow('Large screenshot is slow');
}, async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 800 });
await page.evaluate(() => {
document.body.style.margin = '0';
Expand Down

0 comments on commit 78b1511

Please sign in to comment.