From 5bcb7cf512c8ef73eeae129e143f8ca57e11bc8e Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 30 Jul 2018 19:05:19 -0700 Subject: [PATCH] test: add test with request interception and cookies (#2988) Fixes #2970. --- test/network.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/network.spec.js b/test/network.spec.js index 5d7ba2f0..beb91c62 100644 --- a/test/network.spec.js +++ b/test/network.spec.js @@ -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());