Fix conditions for cart validation
This commit is contained in:
parent
07a8e2e516
commit
81862af867
1 changed files with 6 additions and 6 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue