Fix logic for Afterpay payment flow

This commit is contained in:
JennyNou 2026-03-20 16:13:47 -04:00
parent e537e41c98
commit 1192775254

View file

@ -37,10 +37,10 @@ export class AfterpayPage extends BasePage {
async executeAfterpayPayment(paymentDetails: IPaymentDetails, claimDetails: IClaimDetails, servicePackage: ServicePackage) {
await this.login(paymentDetails.password!);
if (claimDetails.policyDeductible === 50 && servicePackage === ServicePackage.GlassOnly) {
if (await this.confirmButton.isVisible()) {
await this.confirmButton.click();
} else {
// For orders greater than $50, user will have 2 options to choose from: monthly with interest or biweekly without interest
// For some orders, user will have 2 options to choose from: monthly with interest or biweekly without interest
await this.selectAfterpayWithoutInterestButton.waitFor({ state: 'visible' });
if (await this.selectAfterpayWithoutInterestButton.isVisible()) {