Fix flakiness for Afterpay sandbox flow

This commit is contained in:
JennyNou 2026-03-22 22:48:41 -04:00
parent 1192775254
commit 2dfdbb6d1d

View file

@ -37,9 +37,11 @@ export class AfterpayPage extends BasePage {
async executeAfterpayPayment(paymentDetails: IPaymentDetails, claimDetails: IClaimDetails, servicePackage: ServicePackage) {
await this.login(paymentDetails.password!);
if (await this.confirmButton.isVisible()) {
await this.confirmButton.click();
} else {
try {
await this.confirmButton.waitFor({ state: 'visible', timeout: 5000 });
await this.confirmButton.isVisible()
await this.confirmButton.click();
} catch {
// For some orders, user will have 2 options to choose from: monthly with interest or biweekly without interest
await this.selectAfterpayWithoutInterestButton.waitFor({ state: 'visible' });