From 81862af867e93cb6ee7455c167e31e88000124fc Mon Sep 17 00:00:00 2001 From: JennyNou Date: Wed, 25 Mar 2026 09:49:03 -0400 Subject: [PATCH] Fix conditions for cart validation --- playwright-tests/pages/OrderConfirmationPage.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index 40f5a29f..b7e64336 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -66,12 +66,12 @@ export class OrderConfirmationPage extends BasePage { const isUnverified = !isPolicyFound; const isUnverifiedPolicyAfterVehicleLookup = testData.isUnverifiedPolicyAfterVehicleLookup === true; const hasPremiumOrStandard = - claimDetails!.policyDeductible >= 0 && + (claimDetails!.policyDeductible >= 0 || !isPolicyFound) && (servicePackage === ServicePackage.Premium || servicePackage === ServicePackage.Standard); const payAtService = - claimDetails!.policyDeductible >= 0 && - paymentDetails?.paymentType === PaymentType.PayAtService; + (claimDetails!.policyDeductible >= 0 && + paymentDetails?.paymentType === PaymentType.PayAtService) || !paymentDetails?.paymentType; const paidWithPIA = claimDetails!.policyDeductible >= 0 && @@ -84,9 +84,9 @@ export class OrderConfirmationPage extends BasePage { // Grab text content for elements that are expected on-screen const lineItemsValue = await textIf(hasPremiumOrStandard, this.cartLineItemsText); const deductibleTextValue = await textIf(!isItacOrNoComp, this.deductibleText); - const subtotalTextValue = await textIf((hasPremiumOrStandard || isItacOrNoComp || !isUnverified) && !isUnverifiedPolicyAfterVehicleLookup, this.subtotalText); - const totalAmountDueValue = await textIf(((hasPremiumOrStandard && !payAtService) || (isItacOrNoComp && !payAtService) || !isUnverified) && !isUnverifiedPolicyAfterVehicleLookup, this.totalAmountDueText); - const amountPaidTextValue = await textIf(((hasPremiumOrStandard && !payAtService) || (isItacOrNoComp && !payAtService) || !isUnverified) && !isUnverifiedPolicyAfterVehicleLookup, this.totalAmountDueText); + const subtotalTextValue = await textIf((hasPremiumOrStandard || isItacOrNoComp) && !isUnverified && !isUnverifiedPolicyAfterVehicleLookup, this.subtotalText); + const totalAmountDueValue = await textIf((hasPremiumOrStandard && !payAtService) || (isItacOrNoComp && !payAtService) && !isUnverified && !isUnverifiedPolicyAfterVehicleLookup, this.totalAmountDueText); + const amountPaidTextValue = await textIf((hasPremiumOrStandard && !payAtService) || (isItacOrNoComp && !payAtService) && !isUnverified && !isUnverifiedPolicyAfterVehicleLookup, this.totalAmountDueText); const finalAmountDueValue = await textIf(hasPremiumOrStandard || isItacOrNoComp || isUnverified || isUnverifiedPolicyAfterVehicleLookup, this.finalAmountDue); const confirmationTextValue = await this.confirmationText.textContent();