Skip to content

Commit

Permalink
test: add test with request interception and cookies (#2988)
Browse files Browse the repository at this point in the history
Fixes #2970.
  • Loading branch information
aslushnikov committed Aug 1, 2018
1 parent 2f059bf commit c0d8b3b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/network.spec.js
Expand Up @@ -251,6 +251,17 @@ module.exports.addTests = function({testRunner, expect}) {
const response = await page.goto(server.EMPTY_PAGE);
expect(response.ok()).toBe(true);
});
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());
Expand Down

0 comments on commit c0d8b3b

Please sign in to comment.