Dmitry Gozman d426f2fd4e
fix(chromium): continue requests paused for the second time (#27429)
Sometimes Chromium restarts requests. This leads to multiple
`Fetch.requestPaused` for a single `Network.requestWillBeSent`.

Fixes #27294.
2023-10-04 11:18:06 -07:00

23 lines
1015 B
TypeScript

import { test, expect } from '@playwright/experimental-ct-react';
import TitleWithFont from '@/components/TitleWithFont';
test('should load font without routes', async ({ mount, page }) => {
const promise = page.waitForEvent('requestfinished', request => request.url().includes('iconfont'));
await mount(<TitleWithFont />);
const request = await promise;
const response = await request.response();
const body = await response!.body();
expect(body.length).toBe(2656);
});
test('should load font with routes', async ({ mount, page }) => {
test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/27294' });
await page.route('**/*.json', r => r.continue());
const promise = page.waitForEvent('requestfinished', request => request.url().includes('iconfont'));
await mount(<TitleWithFont />);
const request = await promise;
const response = await request.response();
const body = await response!.body();
expect(body.length).toBe(2656);
});