Skip to content

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

fix: disable PaintHolding to be able to click in oopifs (#28604)

Yury Semikhatsky66e056c306bc
diff --git a/packages/playwright-core/src/server/chromium/chromiumSwitches.ts b/packages/playwright-core/src/server/chromium/chromiumSwitches.ts
index 65e458e81f..c3ceaeaaec 100644
--- a/packages/playwright-core/src/server/chromium/chromiumSwitches.ts
+++ b/packages/playwright-core/src/server/chromium/chromiumSwitches.ts
@@ -35,7 +35,8 @@ export const chromiumSwitches = [
// AvoidUnnecessaryBeforeUnloadCheckSync - https://github.com/microsoft/playwright/issues/14047
// Translate - https://github.com/microsoft/playwright/issues/16126
// HttpsUpgrades - https://github.com/microsoft/playwright/pull/27605
- '--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades',
+ // PaintHolding - https://github.com/microsoft/playwright/issues/28023
+ '--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding',
'--allow-pre-commit-input',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',
diff --git a/tests/library/chromium/oopif.spec.ts b/tests/library/chromium/oopif.spec.ts
index 8a8db75745..5324e6d155 100644
--- a/tests/library/chromium/oopif.spec.ts
+++ b/tests/library/chromium/oopif.spec.ts
@@ -327,6 +327,20 @@ it('should emit filechooser event for iframe', async ({ page, server, browser })
expect(chooser).toBeTruthy();
});
+it('should be able to click in iframe', async ({ page, server, browser }) => {
+ it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28023' });
+ await page.goto(server.PREFIX + '/dynamic-oopif.html');
+ expect(await countOOPIFs(browser)).toBe(1);
+ expect(page.frames().length).toBe(2);
+ const frame = page.frames()[1];
+ await frame.setContent(`<button onclick="console.log('clicked')">OK</button>`);
+ const [message] = await Promise.all([
+ page.waitForEvent('console'),
+ frame.click('button'),
+ ]);
+ expect(message.text()).toBe('clicked');
+});
+
it('should not throw on exposeFunction when oopif detaches', async ({ page, browser, server }) => {
await page.goto(server.PREFIX + '/dynamic-oopif.html');
expect(await countOOPIFs(browser)).toBe(1);