Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Pavel Feldmanc68bd31053ff
diff --git a/test/browsercontext-expose-function.spec.ts b/test/browsercontext-expose-function.spec.ts
index 48924c913f..4e60ce595b 100644
--- a/test/browsercontext-expose-function.spec.ts
+++ b/test/browsercontext-expose-function.spec.ts
@@ -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}) => {