test: unflake two tests (#7115)

This commit is contained in:
Dmitry Gozman 2021-06-14 16:01:18 -07:00 committed by GitHub
parent a3a9ccad6f
commit cc186be9a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -50,7 +50,8 @@ test.describe('non-stalling evaluate', () => {
// Testing this as a race.
expect([
'Frame does not yet have a main execution context',
'Frame is currently attempting a navigation'
'Frame is currently attempting a navigation',
'Navigation interrupted the evaluation',
]).toContain(error.message);
});
});

View file

@ -18,11 +18,12 @@ import { expect, contextTest as test, browserTest } from './config/browserTest';
import yauzl from 'yauzl';
import jpeg from 'jpeg-js';
test('should collect trace', async ({ context, page, server, browserName }, testInfo) => {
test('should collect trace', async ({ context, page, server }, testInfo) => {
await context.tracing.start({ name: 'test', screenshots: true, snapshots: true });
await page.goto(server.EMPTY_PAGE);
await page.setContent('<button>Click</button>');
await page.click('"Click"');
await page.waitForTimeout(2000); // Give it some time to produce screenshots.
await page.close();
await context.tracing.stop({ path: testInfo.outputPath('trace.zip') });