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();