test(network): add failing test for Set-Cookie in fulfill (#4988)

This commit is contained in:
Yury Semikhatsky 2021-01-12 15:56:12 -08:00 committed by GitHub
parent cac119f3bf
commit 0bf7477c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,3 +177,29 @@ it('should include the origin header', async ({page, server}) => {
expect(text).toBe('done'); expect(text).toBe('done');
expect(interceptedRequest.headers()['origin']).toEqual(server.PREFIX); expect(interceptedRequest.headers()['origin']).toEqual(server.PREFIX);
}); });
it('should support Set-Cookie header', (test, { browserName }) => {
test.fixme(browserName === 'webkit');
test.fixme(browserName === 'firefox');
}, async ({context, page, server}) => {
await page.route('https://example.com/', (route, request) => {
route.fulfill({
headers: {
'Set-Cookie': 'name=value; domain=.example.com; Path=/'
},
contentType: 'text/html',
body: 'done'
});
});
await page.goto('https://example.com');
expect(await context.cookies()).toEqual([{
sameSite: 'None',
name: 'name',
value: 'value',
domain: '.example.com',
path: '/',
expires: -1,
httpOnly: false,
secure: false
}]);
});