Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/page/page-route.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,32 @@ it('should support async handler w/ times', async ({ page, server }) => {
await expect(page.locator('body')).not.toHaveText('intercepted');
});

it('route abort with times: 1 should not affect second sequential fetch', async ({ page, server, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/41802' });
it.fixme(browserName === 'chromium', 'Chromium drops a request that is intercepted while Fetch.disable is being processed; fix is not rolled yet');

server.setRoute('/data', (req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('ok');
});

await page.goto(server.EMPTY_PAGE);
await page.route('**/data', route => route.abort('timedout'), { times: 1 });

const results = await page.evaluate(async () => {
async function fetchOrHung(url: string) {
const timeout = new Promise<string>(resolve => setTimeout(() => resolve('hung'), 3000));
const request = fetch(url).then(r => String(r.status)).catch(() => 'aborted');
return Promise.race([request, timeout]);
}
const first = await fetchOrHung('/data');
const second = await fetchOrHung('/data');
return [first, second];
});

expect(results).toEqual(['aborted', '200']);
});

it('should contain raw request header', async ({ page, server }) => {
let headers: any;
await page.route('**/*', async route => {
Expand Down
41 changes: 12 additions & 29 deletions tests/playwright-test/stable-test-runner/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/playwright-test/stable-test-runner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
"@playwright/test": "^1.62.0-alpha-2026-07-20"
"@playwright/test": "^1.63.0-alpha-2026-08-17"
}
}
Loading