playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] Cannot handle the GooglePay Popup window

Open krystian-jedrzejowski-zazoon opened this issue 3 years ago • 14 comments

Context:

  • Playwright Version: 1.28
  • Operating System: Windows
  • Browser: All, Chromium

Code Snippet Example 1 - waiting for new page:

const pagePromise = context.waitForEvent('page');
await page.locator('.gpay-button').click();
const newPage = await pagePromise;
await newPage.waitForLoadState();
console.log(await newPage.title());

Result: Timeout waiting for page;

Example 2 - waiting for new popup:

const popupPromise = page.waitForEvent('popup');
await page.locator('.gpay-button').click();
const popup = await popupPromise;
// Wait for the popup to load.
await popup.waitForLoadState();
console.log(await popup.title());

Result: Timeout waiting for popup;

Describe the bug Playwright cannot handle this popup/page in any way. I was trying to record the scenario in visual studio code but nothing happens after this popup is opened - recording actions stops in it.

Popup to handle image

@krystian-jedrzejowski-zazoon Google Pay popup is not a regular page, so the popup is not exposed through Playwright API. I'll mark this as P3 to collect further feedback.

aslushnikov avatar Dec 30 '22 06:12 aslushnikov

I am having same issue. Actually only with Chromium. I tried with Firefox and It worked.

Being honest, I tried with waitForEvent("page") with Firefox and It worked 100% of times, but with chromium It worked I would say only 5% of times.

Even with page.on("page") when you click on the Button that launches the new Page the event is not caught when the browser is Chromium, but always when It is Firefox

Jakyhack avatar Jan 12 '23 18:01 Jakyhack

@aslushnikov Any updates on this

@krystian-jedrzejowski-zazoon No updates, and this is very low on our list since this doesn't have too much interest from the community.

aslushnikov avatar Feb 14 '23 15:02 aslushnikov

@aslushnikov would love to re-open this thread as this is a feature that we'd find really valuable in Playwright. Can you provide any guidance on what a fix here might entail? Perhaps I could try to implement it as a first pass.

averym-stripe avatar May 04 '23 17:05 averym-stripe

@averym-stripe the main complexity is in contributing missing instrumentation to all 3 browser debugging protocols: CDP in Chromium, WebInspector protocol in WebKit, and Juggler in Firefox.

aslushnikov avatar May 10 '23 18:05 aslushnikov

Same problem here, is there any new workaround?

rubencougil avatar Feb 07 '24 11:02 rubencougil

Same problem here, any updates?

Tarnoruda avatar May 29 '24 06:05 Tarnoruda

We are having same issue and have been avoiding testing our google pay flow there because of that. Is there any update on this?

Nikola-Yurukov avatar Jun 07 '24 07:06 Nikola-Yurukov

This has been a problem for us for quite a while now, any intentions on fixing it?

LudmilMarinov avatar Jun 07 '24 07:06 LudmilMarinov

What we did as a workaround is to use Firefox agent instead of Chrome for handling test cases where we need to deal with Google Pay Popup (in Firefox seems to be just a regular page), and so far it is working fine for us.

rubencougil avatar Jun 07 '24 08:06 rubencougil

Yeah, we can actually configure it that way for the sake of having our e2e working but it would still be preferable to have the tests working on chrome as that is our requirement at this time, that's why I was asking for a follow up if there is any priority on a potential fix in that area.

Nikola-Yurukov avatar Jun 07 '24 08:06 Nikola-Yurukov