From a5be8ce86a31f5855ef0a751d35e8914a946ccc7 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Wed, 11 Oct 2023 10:34:11 -0700 Subject: [PATCH] test: unflake some more tests (#27546) --- tests/library/tracing.spec.ts | 2 ++ tests/page/page-screenshot.spec.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.ts index 9ac0eba2e8..2c85afbd28 100644 --- a/tests/library/tracing.spec.ts +++ b/tests/library/tracing.spec.ts @@ -487,6 +487,7 @@ test('should work with multiple chunks', async ({ context, page, server }, testI await page.setContent(''); await page.click('"Click"'); page.click('"ClickNoButton"', { timeout: 0 }).catch(() => {}); + await page.evaluate(() => {}); await context.tracing.stopChunk({ path: testInfo.outputPath('trace.zip') }); await context.tracing.startChunk(); @@ -503,6 +504,7 @@ test('should work with multiple chunks', async ({ context, page, server }, testI 'page.setContent', 'page.click', 'page.click', + 'page.evaluate', ]); expect(trace1.events.some(e => e.type === 'frame-snapshot')).toBeTruthy(); expect(trace1.events.some(e => e.type === 'resource-snapshot' && e.snapshot.request.url.endsWith('style.css'))).toBeTruthy(); diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts index 7985bf2fb5..1b4bb17169 100644 --- a/tests/page/page-screenshot.spec.ts +++ b/tests/page/page-screenshot.spec.ts @@ -817,8 +817,8 @@ it.describe('page screenshot animations', () => { // Ensure CSS animation is finite. expect(await div.evaluate(async el => Number.isFinite(el.getAnimations()[0].effect.getComputedTiming().endTime))).toBe(true); await Promise.all([ - page.screenshot({ animations: 'disabled' }), page.waitForEvent('console', msg => msg.text() === 'animationend'), + page.screenshot({ animations: 'disabled' }), ]); expect(await page.evaluate(() => window._EVENTS)).toEqual([ 'onfinish', 'animationend'