test: unflake some more tests (#27546)

This commit is contained in:
Dmitry Gozman 2023-10-11 10:34:11 -07:00 committed by GitHub
parent ebd0ff9422
commit a5be8ce86a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -487,6 +487,7 @@ test('should work with multiple chunks', async ({ context, page, server }, testI
await page.setContent('<button>Click</button>');
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();

View File

@ -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'