test: make init script test strict again (#5877)

This commit is contained in:
Pavel Feldman 2021-03-19 06:18:25 +08:00 committed by GitHub
parent c4410d3f4d
commit c68bd31053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,11 +63,12 @@ it('should be callable from-inside addInitScript', async ({context, server}) =>
});
await context.addInitScript('window["woof"]("context")');
const page = await context.newPage();
await page.addInitScript('window["woof"]("page")');
await page.evaluate('undefined');
expect(args).toEqual(['context']);
args = [];
await page.addInitScript('window["woof"]("page")');
await page.reload();
expect(args).toContain('context');
expect(args).toContain('page');
expect(args).toEqual(['context', 'page']);
});
it('exposeBindingHandle should work', async ({context}) => {