mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-05 19:04:43 +03:00
test: xhr request type for main resource url (#23174)
This commit is contained in:
parent
0e1aeaaecf
commit
33f3a6002d
@ -118,3 +118,19 @@ it('should fire requestfailed when intercepting race', async ({ page, server, br
|
||||
|
||||
await promsie;
|
||||
});
|
||||
|
||||
it('main resource xhr should have type xhr', async ({ page, server, browserName }) => {
|
||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22812' });
|
||||
it.fixme(browserName === 'webkit');
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
const [request] = await Promise.all([
|
||||
page.waitForEvent('request'),
|
||||
page.evaluate(() => {
|
||||
const x = new XMLHttpRequest();
|
||||
x.open('GET', location.href, false);
|
||||
x.send();
|
||||
})
|
||||
]);
|
||||
expect(request.isNavigationRequest()).toBe(false);
|
||||
expect(request.resourceType()).toBe('xhr');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user