mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: verify Page.goto fails when server returns 204 (#2452)
Fixed upstream: https://crrev.com/551261 Rolled into pptr: https://github.com/GoogleChrome/puppeteer/pull/2393 Fixes #1879.
This commit is contained in:
parent
d9bb7ee8a0
commit
b96815aa72
@ -390,6 +390,16 @@ module.exports.addTests = function({testRunner, expect, puppeteer, DeviceDescrip
|
|||||||
});
|
});
|
||||||
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
||||||
});
|
});
|
||||||
|
it('should fail when server returns 204', async({page, server}) => {
|
||||||
|
server.setRoute('/empty.html', (req, res) => {
|
||||||
|
res.statusCode = 204;
|
||||||
|
res.end();
|
||||||
|
});
|
||||||
|
let error = null;
|
||||||
|
await page.goto(server.EMPTY_PAGE).catch(e => error = e);
|
||||||
|
expect(error).not.toBe(null);
|
||||||
|
expect(error.message).toContain('net::ERR_ABORTED');
|
||||||
|
});
|
||||||
it('should navigate to empty page with domcontentloaded', async({page, server}) => {
|
it('should navigate to empty page with domcontentloaded', async({page, server}) => {
|
||||||
const response = await page.goto(server.EMPTY_PAGE, {waitUntil: 'domcontentloaded'});
|
const response = await page.goto(server.EMPTY_PAGE, {waitUntil: 'domcontentloaded'});
|
||||||
expect(response.status()).toBe(200);
|
expect(response.status()).toBe(200);
|
||||||
|
Loading…
Reference in New Issue
Block a user