Fix Paypal login flakiness

This commit is contained in:
JennyNou 2026-03-31 16:07:28 -04:00
parent bb56843114
commit a8937d53f0

View file

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