test: make sure referer header is reported with request interception (#2986)

The referer header has been fixed some time ago.

References #469.
This commit is contained in:
Andrey Lushnikov 2018-07-30 18:05:27 -07:00 committed by GitHub
parent d305c7d8c1
commit 2c9599496a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,6 +251,17 @@ module.exports.addTests = function({testRunner, expect}) {
const response = await page.goto(server.EMPTY_PAGE); const response = await page.goto(server.EMPTY_PAGE);
expect(response.ok()).toBe(true); expect(response.ok()).toBe(true);
}); });
it('should contain referer header', async({page, server}) => {
await page.setRequestInterception(true);
const requests = [];
page.on('request', request => {
requests.push(request);
request.continue();
});
await page.goto(server.PREFIX + '/one-style.html');
expect(requests[1].url()).toContain('/one-style.css');
expect(requests[1].headers().referer).toContain('/one-style.html');
});
it('should stop intercepting', async({page, server}) => { it('should stop intercepting', async({page, server}) => {
await page.setRequestInterception(true); await page.setRequestInterception(true);
page.once('request', request => request.continue()); page.once('request', request => request.continue());