Fix for Afterpay flakiness

This commit is contained in:
JennyNou 2026-03-22 22:49:59 -04:00
parent 5682987c06
commit bc5331bd65

View file

@ -1,7 +1,7 @@
import { expect, type Locator, type Page } from '@playwright/test'; import { expect, type Locator, type Page } from '@playwright/test';
import { BasePage } from './BasePage'; import { BasePage } from './BasePage';
import { IPaymentDetails } from '@business-logic/types/CustomerDetails'; import { IClaimDetails, IPaymentDetails } from '@business-logic/types/CustomerDetails';
import { PaymentType } from '@business-logic/types/Enums'; import { PaymentType, ServicePackage } from '@business-logic/types/Enums';
import { PaymentPage } from './PaymentPage'; import { PaymentPage } from './PaymentPage';
import { AfterpayPage } from './AfterpayPage'; import { AfterpayPage } from './AfterpayPage';
import { PaypalPage } from './PaypalPage'; import { PaypalPage } from './PaypalPage';
@ -40,7 +40,7 @@ export class PaymentMethodPage extends BasePage {
this.submitButton = this.page.getByRole('button', { name: 'Submit' }); this.submitButton = this.page.getByRole('button', { name: 'Submit' });
} }
async executePayment(paymentDetails: IPaymentDetails) { async executePayment(paymentDetails: IPaymentDetails, claimDetails: IClaimDetails, servicePackage: ServicePackage) {
const browserContext = this.page.context(); const browserContext = this.page.context();
switch (paymentDetails.paymentType) { switch (paymentDetails.paymentType) {
@ -67,7 +67,7 @@ export class PaymentMethodPage extends BasePage {
const afterpayPage = new AfterpayPage(afterpayPopup); const afterpayPage = new AfterpayPage(afterpayPopup);
// Execute payment // Execute payment
await afterpayPage.executeAfterpayPayment(paymentDetails); await afterpayPage.executeAfterpayPayment(paymentDetails, claimDetails, servicePackage);
break; break;
case PaymentType.PayAtService: case PaymentType.PayAtService: