Skip to content

Commit

Permalink
test: unflake a few trace-viewer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Jan 10, 2025
1 parent 2cd5003 commit c213f38
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/library/trace-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1539,9 +1539,11 @@ test('canvas clipping', async ({ runAndTrace, page, server }) => {

// Enable canvas display
await traceViewer.showSettings();
await traceViewer.displayCanvasContentSetting.click();

const msg = await traceViewer.page.waitForEvent('console', { predicate: msg => msg.text().startsWith('canvas drawn:') });
const [msg] = await Promise.all([
traceViewer.page.waitForEvent('console', { predicate: msg => msg.text().startsWith('canvas drawn:') }),
traceViewer.displayCanvasContentSetting.click(),
]);
expect(msg.text()).toEqual('canvas drawn: [0,91,11,20]');

const snapshot = await traceViewer.snapshotFrame('page.goto');
Expand All @@ -1559,9 +1561,11 @@ test('canvas clipping in iframe', async ({ runAndTrace, page, server }) => {

// Enable canvas display
await traceViewer.showSettings();
await traceViewer.displayCanvasContentSetting.click();

const msg = await traceViewer.page.waitForEvent('console', { predicate: msg => msg.text().startsWith('canvas drawn:') });
const [msg] = await Promise.all([
traceViewer.page.waitForEvent('console', { predicate: msg => msg.text().startsWith('canvas drawn:') }),
traceViewer.displayCanvasContentSetting.click(),
]);
expect(msg.text()).toEqual('canvas drawn: [1,1,11,20]');

const snapshot = await traceViewer.snapshotFrame('page.evaluate');
Expand Down

0 comments on commit c213f38

Please sign in to comment.