Skip to content

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

test: fix 'exposeFunction should not leak' in video mode (#28169)

Max Schmitt7ffcb42551d9
diff --git a/tests/library/channels.spec.ts b/tests/library/channels.spec.ts
index c46d463c5b..dc3ec1b5f5 100644
--- a/tests/library/channels.spec.ts
+++ b/tests/library/channels.spec.ts
@@ -256,7 +256,7 @@ it('should work with the domain module', async ({ browserType, server, browserNa
throw err;
});
-it('exposeFunction should not leak', async ({ page, expectScopeState, server }) => {
+it('exposeFunction should not leak', async ({ page, expectScopeState, server, video }) => {
await page.goto(server.EMPTY_PAGE);
let called = 0;
await page.exposeFunction('myFunction', () => ++called);
@@ -284,6 +284,7 @@ it('exposeFunction should not leak', async ({ page, expectScopeState, server })
{
'_guid': 'browser',
'objects': [
+ ...(video === 'on' ? [{ _guid: 'artifact', objects: [] }] : []),
{
'_guid': 'browser-context',
'objects': [