From a8937d53f0d08ed4a515540a7f8c3da5c5e007bc Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:07:28 -0400 Subject: [PATCH] Fix Paypal login flakiness --- playwright-tests/pages/PaypalPage.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/playwright-tests/pages/PaypalPage.ts b/playwright-tests/pages/PaypalPage.ts index d1c30c6c..05178dd9 100644 --- a/playwright-tests/pages/PaypalPage.ts +++ b/playwright-tests/pages/PaypalPage.ts @@ -24,9 +24,14 @@ export class PaypalPage extends BasePage { } async completePaypalPurchase(paymentDetails: IPaymentDetails) { - await this.usernameTextBox.fill(paymentDetails.username!); - await this.nextButton.waitFor({ state: 'visible', timeout: 10000 }); - await this.nextButton.click(); + + await expect(async () => { + await this.usernameTextBox.fill(paymentDetails.username!); + await this.nextButton.waitFor({ state: 'visible', timeout: 5000 }); + await this.nextButton.click(); + await expect(this.passwordTextBox).toBeVisible({ timeout: 5000 }); + }).toPass({ timeout: 30000 }); + await this.passwordTextBox.fill(paymentDetails.password!); await this.paypalLoginButton.click(); await this.payButton.click();