mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: add test with request interception and cookies (#2988)
Fixes #2970.
This commit is contained in:
parent
862ad96bde
commit
5bcb7cf512
@ -262,6 +262,17 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
expect(requests[1].url()).toContain('/one-style.css');
|
||||
expect(requests[1].headers().referer).toContain('/one-style.html');
|
||||
});
|
||||
it('should properly return navigation response when URL has cookies', async({page, server}) => {
|
||||
// Setup cookie.
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.setCookie({ name: 'foo', value: 'bar'});
|
||||
|
||||
// Setup request interception.
|
||||
await page.setRequestInterception(true);
|
||||
page.on('request', request => request.continue());
|
||||
const response = await page.reload();
|
||||
expect(response.status()).toBe(200);
|
||||
});
|
||||
it('should stop intercepting', async({page, server}) => {
|
||||
await page.setRequestInterception(true);
|
||||
page.once('request', request => request.continue());
|
||||
|
Loading…
Reference in New Issue
Block a user