mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-27 13:50:25 +03:00
test: fix page.goto test on Firefox (#21132)
Turns out Firefox can yield either of the two errors, depending on the stage of the pending navigation.
This commit is contained in:
parent
c8f63c04cc
commit
434fa470e3
@ -409,10 +409,14 @@ it('should fail when replaced by another navigation', async ({ page, server, bro
|
||||
});
|
||||
const error = await page.goto(server.PREFIX + '/empty.html').catch(e => e);
|
||||
await anotherPromise;
|
||||
if (browserName === 'chromium')
|
||||
if (browserName === 'chromium') {
|
||||
expect(error.message).toContain('net::ERR_ABORTED');
|
||||
else if (browserName === 'webkit' || browserName === 'firefox')
|
||||
} else if (browserName === 'webkit') {
|
||||
expect(error.message).toContain('Navigation interrupted by another one');
|
||||
} else if (browserName === 'firefox') {
|
||||
// Firefox might yield either NS_BINDING_ABORTED or 'navigation interrupted by another one'
|
||||
expect(error.message.includes('Navigation interrupted by another one') || error.message.includes('NS_BINDING_ABORTED')).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it('should work when navigating to valid url', async ({ page, server }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user