Skip to content

Commit

Permalink
fix: changing popup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zenit2001 committed Oct 8, 2024
1 parent a53a8e1 commit 39d67e3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/playwright/pages/PaymentMethodsPage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ export default class PaymentMethodsPage {
.frameLocator('.adyen-checkout__paypal__button--paypal iframe.visible')
.locator('.paypal-button-container');

const popupPromise = this.page.waitForEvent('popup');

// Click PayPal radio button
if (!expressFlow) {
await this.page.click('#rb_paypal');
await this.page.waitForTimeout(5000);
}

// Capture popup for interaction
const [popup] = await Promise.all([
this.page.waitForEvent('popup'),
payPalButton.click({ timeout: 40000 }),
]);
await payPalButton.click();
const popup = await popupPromise;

// Wait for the page load
await popup.waitForNavigation({
Expand Down

0 comments on commit 39d67e3

Please sign in to comment.