From c49228220dc049dc789a1edaadcf3248999f74e9 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 20 May 2025 10:42:49 -0400 Subject: [PATCH 01/13] Adds support for heavy truck insurance flow Adds a new test case for a big truck insurance flow. This includes updating the test data to include a flag for heavy trucks and the zip code. Renames `isHeavyTruckVehicle` to `isHeavyTruckVehicleAlert` for clarity. --- .../business-logic/types/IAlertFlags.ts | 2 +- .../business-logic/types/ITestData.ts | 1 + .../pages/VehicleSelectionPage.ts | 12 ++- playwright-tests/tests/0000__M.test.ts | 2 + .../tests/BigTruckInsuranceVerifiedFlow.ts | 80 +++++++++++++++++++ .../alert-validation/alert0001_HeavyTruck.ts | 2 +- 6 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts diff --git a/playwright-tests/business-logic/types/IAlertFlags.ts b/playwright-tests/business-logic/types/IAlertFlags.ts index b13f30bbc..7943ed6be 100644 --- a/playwright-tests/business-logic/types/IAlertFlags.ts +++ b/playwright-tests/business-logic/types/IAlertFlags.ts @@ -1,5 +1,5 @@ export default interface IAlertFlags { - isHeavyTruckVehicle?: boolean, + isHeavyTruckVehicleAlert?: boolean, isRepairReplace?: boolean, isSplitWindshield?: boolean, isRepairOnly?: boolean, diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index 76d0e4534..dab74efcf 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -29,6 +29,7 @@ export interface ITestData { endorsements: IEndorsementDetails[], hasOemEndorsement: boolean, // OEM Endorsement does not appear on endorsements page, so it has a separate flag.s skipEstimatePage: boolean, + isHeavyTruck: boolean, isRecalVehicle: boolean, canNotRecal: boolean, dynamicRecal: boolean, diff --git a/playwright-tests/pages/VehicleSelectionPage.ts b/playwright-tests/pages/VehicleSelectionPage.ts index f554639a5..6e78cfe6d 100644 --- a/playwright-tests/pages/VehicleSelectionPage.ts +++ b/playwright-tests/pages/VehicleSelectionPage.ts @@ -11,6 +11,7 @@ export class VehicleSelectionPage extends BasePage { readonly makeDropdown: Locator; readonly modelDropdown: Locator; readonly styleDropdown: Locator; + readonly zipCodeTextBox: Locator; readonly discontinuedServiceAlert: Locator; url = process.env['BASE_URL']! + '/fmg/?fmgPage=vehicle'; @@ -22,6 +23,7 @@ export class VehicleSelectionPage extends BasePage { this.makeDropdown = this.page.locator('#makeQuestionField'); this.modelDropdown = this.page.locator('#modelQuestionField'); this.styleDropdown = this.page.locator('#styleQuestionField'); + this.zipCodeTextBox = this.page.getByRole('textbox', { name: 'Zip code' }); this.discontinuedServiceAlert = this.page.locator('.alert-danger.widget-name-AlertNoServiceWidget'); // this.validateURL(this.url); } @@ -48,13 +50,17 @@ export class VehicleSelectionPage extends BasePage { @step("VehicleSelectionPage >> Select Vehicle: ") async handleVehicleSelectionPage(testData: Partial) { await this.validateProgressBar("4"); - const { vehicleDetails } = testData; - const { isHeavyTruckVehicle, isSplitWindshield } = testData.alertFlags || {}; + const { vehicleDetails, isHeavyTruck, customerDetails } = testData; + const { isHeavyTruckVehicleAlert, isSplitWindshield } = testData.alertFlags || {}; await this.selectVehicle(vehicleDetails!); + + if (isHeavyTruck) { + await this.zipCodeTextBox.fill(customerDetails?.address.postalCode!); + } // Handle alert conditions for vehicle selection - if (isHeavyTruckVehicle || isSplitWindshield) { + if (isHeavyTruckVehicleAlert || isSplitWindshield) { await this.checkForAlertMessages(); throw new TestSuccessAlert('Both assertions are met successfully.'); } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index b51c8dd5e..d504bf24e 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -31,6 +31,7 @@ import cashRepairInShopAfterPayTests from "./CashRepairInShopAfterPay"; import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; +import insuranceBigTruckVerifiedTests from "./BigTruckInsuranceVerifiedFlow"; /** * Master Test Runner @@ -67,6 +68,7 @@ const allStandardTests = [ {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, + {name: "BigTruckInsuranceVerifiedFlow", tests: insuranceBigTruckVerifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} diff --git a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts new file mode 100644 index 000000000..a97e64912 --- /dev/null +++ b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts @@ -0,0 +1,80 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData" +import { PaymentMethod, AppointmentType, DamageType, PaymentType } from "@business-logic/types/Enums"; +import TestCase from "@business-logic/types/TestCase"; +import { VehicleLookupType } from "@business-logic/types/Enums"; +import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; + +// Set the seed based on test name for consistent but unique data +setFakerSeedFromTestName("InsuranceBigTruckVerified"); + +// Now get the test data with the seeded faker +const insuranceBigTruckVerifiedData: Partial = { + ...getDefaultTestData(), // Get default data with current seed + + // Key feature: Insurance flow with GEICO + paymentMethod: PaymentMethod.Insurance, + + // Insurance claim flags + isDuplicateClaim: true, + isPolicyFound: true, + isUseVehicleOnPolicy: true, + isHeavyTruck: true, + + // Override customer details with specific name and California location + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Big', + lastName: 'Truck', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Ontario', + state: 'California', + postalCode: '55414' + } + }, + + + // Insurance claim details + claimDetails: { + client: 'USAA', + policyNumber: 'Mock900040BigTruck', + policyDeductible: 2000.00, + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}), + damageCause: DamageType.Rock + }, + + // Hyundai vehicle details with VIN lookup + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2025', + make: 'Peterbilt', + model: '579', + style: 'conventional cab', + vin: '1XPBDP9X6SD693446', + vehicleLookupType: VehicleLookupType.Vin, + }, + + // No need to override vehicleDamage as it already defaults to WindshieldCrack + + // Override for in-shop appointment + appointmentDetails: { + serviceLocation: AppointmentType.InShop, + shopAddress: '504 Malcolm Ave SE, Minneapolis, MN 55414', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + // Override payment details (empty because we skip payment method page in insurance flow) + paymentDetails: {} +} + +const insuranceBigTruckVerifiedTests: TestCase[] = []; + +const tc = new TestCase({ + name: `InsuranceBigTruckVerified`, + tags: ['@E2E','@InsuranceBigTruckVerified', '@test_report', '@Insurance'], + testData: insuranceBigTruckVerifiedData +}, undefined, 'InsuranceBigTruckVerified'); +insuranceBigTruckVerifiedTests.push(tc); + +export default insuranceBigTruckVerifiedTests; \ No newline at end of file diff --git a/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts b/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts index dad46ecd5..9a881d4e5 100644 --- a/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts +++ b/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts @@ -18,7 +18,7 @@ const heavyTruckData: Partial = { style: 'conventional cab' }, alertFlags: { - isHeavyTruckVehicle: true + isHeavyTruckVehicleAlert: true }, vehicleDamage: [ VehicleDamage.WindshieldOneChip, From 5925f0765317d4e7b74deeeda1a11d71622c3cc3 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 20 May 2025 11:27:08 -0400 Subject: [PATCH 02/13] fixed address for big truck location --- playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts index a97e64912..78832afd5 100644 --- a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts +++ b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts @@ -60,7 +60,7 @@ const insuranceBigTruckVerifiedData: Partial = { // Override for in-shop appointment appointmentDetails: { serviceLocation: AppointmentType.InShop, - shopAddress: '504 Malcolm Ave SE, Minneapolis, MN 55414', + shopAddress: '504 Malcolm Ave Se, Minneapolis, MN 55414', appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate }, From 2b16a6b2fdf01c362c64afb975c53a59b9f7d0ed Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 20 May 2025 11:28:09 -0400 Subject: [PATCH 03/13] Corrects deductible validation on order confirmation Ensures the order confirmation page accurately displays the policy deductible amount for insurance users. Previously, it incorrectly validated the service package amount against a hardcoded value instead of the policy deductible. --- playwright-tests/pages/OrderConfirmationPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index 6e513d7d2..c66f95497 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -102,7 +102,7 @@ export class OrderConfirmationPage extends BasePage { } else { // Price validations for insurance users if (servicePackage === ServicePackage.GlassOnly) { - expect.soft(servicePackageAmt).toEqual(0); + expect.soft(servicePackageAmt).toEqual(claimDetails?.policyDeductible); } else { expect.soft(servicePackageAmt).toBeGreaterThan(0); } From 9c13fec5a2448c496c7b43bf6f673eedf6658583 Mon Sep 17 00:00:00 2001 From: Jenny Nou Date: Tue, 20 May 2025 15:56:58 -0400 Subject: [PATCH 04/13] Added policy zip to test data --- playwright-tests/business-logic/types/ITestData.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index dab74efcf..ec616fb83 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -33,5 +33,6 @@ export interface ITestData { isRecalVehicle: boolean, canNotRecal: boolean, dynamicRecal: boolean, - promoCode: string + promoCode: string, + policyZip: string } \ No newline at end of file From 152043dfd94e0f378812204161ea0cf25c85ad1d Mon Sep 17 00:00:00 2001 From: Jenny Nou Date: Tue, 20 May 2025 15:57:56 -0400 Subject: [PATCH 05/13] Renamed big truck insurance test file --- playwright-tests/tests/0000__M.test.ts | 4 ++-- ...InsuranceVerifiedFlow.ts => InsuranceBigTruckVerified.ts} | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) rename playwright-tests/tests/{BigTruckInsuranceVerifiedFlow.ts => InsuranceBigTruckVerified.ts} (95%) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index d504bf24e..e09acec35 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -31,7 +31,7 @@ import cashRepairInShopAfterPayTests from "./CashRepairInShopAfterPay"; import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; -import insuranceBigTruckVerifiedTests from "./BigTruckInsuranceVerifiedFlow"; +import insuranceBigTruckVerifiedTests from "./InsuranceBigTruckVerified"; /** * Master Test Runner @@ -68,7 +68,7 @@ const allStandardTests = [ {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, - {name: "BigTruckInsuranceVerifiedFlow", tests: insuranceBigTruckVerifiedTests}, + {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} diff --git a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts b/playwright-tests/tests/InsuranceBigTruckVerified.ts similarity index 95% rename from playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts rename to playwright-tests/tests/InsuranceBigTruckVerified.ts index 78832afd5..f06e9171d 100644 --- a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts +++ b/playwright-tests/tests/InsuranceBigTruckVerified.ts @@ -30,7 +30,7 @@ const insuranceBigTruckVerifiedData: Partial = { ...getDefaultTestData().customerDetails!.address, city: 'Ontario', state: 'California', - postalCode: '55414' + postalCode: '43085' } }, @@ -40,6 +40,7 @@ const insuranceBigTruckVerifiedData: Partial = { client: 'USAA', policyNumber: 'Mock900040BigTruck', policyDeductible: 2000.00, + policyZip: '55414', damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}), damageCause: DamageType.Rock }, @@ -60,7 +61,7 @@ const insuranceBigTruckVerifiedData: Partial = { // Override for in-shop appointment appointmentDetails: { serviceLocation: AppointmentType.InShop, - shopAddress: '504 Malcolm Ave Se, Minneapolis, MN 55414', + shopAddress: '5719 Brandt Pike, Dayton, OH 45424', appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate }, From f5ecb1148a91c9bf4243f732926cd994f08c13b6 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:29:34 -0400 Subject: [PATCH 06/13] Added condition for validation --- playwright-tests/pages/PaymentMethodPage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playwright-tests/pages/PaymentMethodPage.ts b/playwright-tests/pages/PaymentMethodPage.ts index 240d0e03e..c57caaeef 100644 --- a/playwright-tests/pages/PaymentMethodPage.ts +++ b/playwright-tests/pages/PaymentMethodPage.ts @@ -357,10 +357,12 @@ l } let isCaliforniaState = localStorage.order.serviceLocation.state as string == 'CA' ? true : false; let hasRecalPart: boolean = false; + let canSafeliteRecalibrate: boolean = false; if (!isRepair) { hasRecalPart = localStorage.order.lineItems.glassParts.find((item: any) => item.requiresRecalibration === true) ? true : false; + canSafeliteRecalibrate = localStorage.order.lineItems.glassParts.find((item: any) => item.canSafeliteRecalibrate === true) ? true : false; } - let recalRequired = !isRepair && (isInsurance || isCaliforniaState) && hasRecalPart + let recalRequired = !isRepair && (isInsurance || isCaliforniaState) && hasRecalPart && canSafeliteRecalibrate let stringForRepair: string[] = ["Expert windshield repair", "Exclusive resin sealant", "Nationwide lifetime guarantee"]; let stringIfRecal = isRepair ? "" From c2abf5d7aaaa7b9ee4e05d484bb02cc35f7cd88c Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:30:00 -0400 Subject: [PATCH 07/13] Updated heavy truck naming --- playwright-tests/pages/VehicleSelectionPage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright-tests/pages/VehicleSelectionPage.ts b/playwright-tests/pages/VehicleSelectionPage.ts index 21be579d3..c2d638d12 100644 --- a/playwright-tests/pages/VehicleSelectionPage.ts +++ b/playwright-tests/pages/VehicleSelectionPage.ts @@ -51,8 +51,8 @@ export class VehicleSelectionPage extends BasePage { @step("VehicleSelectionPage >> Select Vehicle: ") async handleVehicleSelectionPage(testData: Partial) { await this.validateProgressBar(ProgressBarPercentages.VehicleSelectionPage); - const { vehicleDetails } = testData; - const { isHeavyTruckVehicle, isSplitWindshield } = testData.alertFlags || {}; + const { vehicleDetails, isHeavyTruck, customerDetails } = testData; + const { isHeavyTruckVehicleAlert, isSplitWindshield } = testData.alertFlags || {}; await this.selectVehicle(vehicleDetails!); From 3e7d251244b1f4c757bb68d7d8b451c33236f311 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:23:54 -0400 Subject: [PATCH 08/13] Added new test to cover unverified insurance flow --- playwright-tests/tests/InsuranceUnverified.ts | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 playwright-tests/tests/InsuranceUnverified.ts diff --git a/playwright-tests/tests/InsuranceUnverified.ts b/playwright-tests/tests/InsuranceUnverified.ts new file mode 100644 index 000000000..f0fcf293a --- /dev/null +++ b/playwright-tests/tests/InsuranceUnverified.ts @@ -0,0 +1,86 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData" +import { PaymentMethod, AppointmentType, DamageType, PartQuestionType } from "@business-logic/types/Enums"; +import TestCase from "@business-logic/types/TestCase"; +import { VehicleLookupType } from "@business-logic/types/Enums"; +import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; + +// Set the seed based on test name for consistent but unique data +setFakerSeedFromTestName("InsuranceUnverified"); + +// Now get the test data with the seeded faker +const insuranceUnverifiedData: Partial = { + ...getDefaultTestData(), // Get default data with current seed + + // Key feature: Insurance flow with GEICO + paymentMethod: PaymentMethod.Insurance, + + // Insurance claim flags + isPolicyFound: false, + isPolicyUnverified: true, + isRecalNotification: true, + + // Override customer details with specific name and California location + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Jane', + lastName: 'Unverified', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Richmond', + state: 'Virginia', + postalCode: '23219' + } + }, + + + // Insurance claim details + claimDetails: { + client: '21st Century', + policyNumber: 'UnverifiedMock', + policyDeductible: "Unverified", + policyZip: '43123', + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}), + damageCause: DamageType.Rock + }, + + // Hyundai vehicle details with VIN lookup + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2014', + make: 'Honda', + model: 'Accord', + style: '4 door sedan', + vehicleLookupType: VehicleLookupType.Zip, + }, + + // Part questions related to recalibration + partQuestions: [ + { + partQuestionType: PartQuestionType.GeneralQuestion1, + isOnPage: true, + optionToSelect: 'Yes' + }, + ], + + // Override for in-shop appointment + appointmentDetails: { + serviceLocation: AppointmentType.InShop, + shopAddress: '5719 Brandt Pike, Dayton, OH 45424', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + // Override payment details (empty because we skip payment method page in insurance flow) + paymentDetails: {} +} + +const insuranceUnverifiedTests: TestCase[] = []; + +const tc = new TestCase({ + name: `InsuranceUnverified`, + tags: ['@E2E','@InsuranceUnverified', '@test_report', '@Insurance'], + testData: insuranceUnverifiedData +}, undefined, 'InsuranceUnverified'); +insuranceUnverifiedTests.push(tc); + +export default insuranceUnverifiedTests; \ No newline at end of file From 896174056046757b03f7243ee6fab97532939745 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:24:58 -0400 Subject: [PATCH 09/13] Changed policy deductible type to cover unverified coverage text --- playwright-tests/business-logic/types/CustomerDetails.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright-tests/business-logic/types/CustomerDetails.ts b/playwright-tests/business-logic/types/CustomerDetails.ts index 3ac2747a0..3c1f9841d 100644 --- a/playwright-tests/business-logic/types/CustomerDetails.ts +++ b/playwright-tests/business-logic/types/CustomerDetails.ts @@ -61,7 +61,7 @@ export interface IPaymentDetails { export interface IClaimDetails { client: string, policyNumber: string, - policyDeductible: number, + policyDeductible: any, policyZip?: string damageDate: string, damageCause: DamageCause From ca41375b3c257d489373c3c85392a17f44f70d68 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:25:23 -0400 Subject: [PATCH 10/13] Added unverified policy flag --- playwright-tests/business-logic/types/ITestData.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index ec616fb83..f9d776224 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -34,5 +34,6 @@ export interface ITestData { canNotRecal: boolean, dynamicRecal: boolean, promoCode: string, - policyZip: string + policyZip: string, + isPolicyUnverified: boolean } \ No newline at end of file From 514fdca340116908c8e8e8a7d6b8cadbf7871f1b Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:26:20 -0400 Subject: [PATCH 11/13] Updated locator and logic for unverified policy flow --- playwright-tests/pages/CoverageStatementPage.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/playwright-tests/pages/CoverageStatementPage.ts b/playwright-tests/pages/CoverageStatementPage.ts index 7085c6794..b529f21f1 100644 --- a/playwright-tests/pages/CoverageStatementPage.ts +++ b/playwright-tests/pages/CoverageStatementPage.ts @@ -9,7 +9,7 @@ export class CoverageStatementPage extends InsuranceBasePage { readonly scheduleOnlineButton: Locator; readonly cancelMyClaimButton: Locator; readonly deductibleAmount: Locator; - readonly verfiyingCoverageText: Locator; + readonly verifyingCoverageText: Locator; readonly continueButton: Locator; // For ITAC/NoComp url = process.env['BASE_URL']! + '/FixMyGlass/CoverageStatement.aspx'; @@ -19,7 +19,7 @@ export class CoverageStatementPage extends InsuranceBasePage { this.scheduleOnlineButton = this.page.getByText('Continue to schedule online'); this.cancelMyClaimButton = this.page.getByText('Cancel my claim'); this.deductibleAmount = this.page.getByRole('heading', { name: '$' }).locator('span'); - this.verfiyingCoverageText = this.page.getByRole('heading', { name: 'We’re verifying your coverage' }); + this.verifyingCoverageText = this.page.getByRole('heading', { name: 'We\'re verifying your coverage' }); this.continueButton = page.getByRole('button', { name: 'Continue' }); // this.validateURL(this.url); } @@ -46,16 +46,20 @@ export class CoverageStatementPage extends InsuranceBasePage { "span.deductible-text-black[data-bind='text: deductibleFormatted']" ); + const unverifiedDeductibleElement = this.verifyingCoverageText; + // Check if the locator is visible before running the expectation if (await deductibleElement.isVisible()) { // Check if the page contains the properly formatted deductible amount await expect(deductibleElement).toContainText(`$${expectedDeductibleRegex}`); } - } - async validateUnverifiedText(){ - await expect(this.verfiyingCoverageText).toBeEnabled(); + if (await unverifiedDeductibleElement.isVisible()) { + // Click on continue button if unverified header is visible + await this.continueButton.click(); + } } + @step("CoverageStatementPage >> Next page: ") async handleCoverageStatementPage(testData: Partial) { From bc591b07bd9ffaaf263472d415d82c8a15c6da86 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:28:00 -0400 Subject: [PATCH 12/13] Added logic for validating unverified flow --- .../pages/OrderConfirmationPage.ts | 34 +++++-------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index 588ecb196..489ed1678 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -33,7 +33,7 @@ export class OrderConfirmationPage extends BasePage { this.apptDateText = this.page.locator('[class="scheduleText"]'); this.amountDueText = this.page.getByLabel('expand cart'); this.viewCartButton = this.page.locator('#cart-dropdown-head'); - this.deductibleText = this.page.locator('#deductible-value'); + this.deductibleText = this.page.locator('.deductible'); this.subtotalText = this.page.locator('.sub-total'); this.finalAmountDue = this.page.locator('div.amount-due'); this.cartServicePackageText = this.cartServicePackageText = this.page.locator('.cart-panel'); @@ -44,7 +44,7 @@ export class OrderConfirmationPage extends BasePage { async validateOrderConfirmationPage(testData: Partial) { // Destructure data we use const { vehicleDetails, customerDetails, servicePackage, promoCode, - isPolicyFound, claimDetails, paymentDetails, isUseVehicleOnPolicy, paymentMethod } = testData; + isPolicyFound, claimDetails, paymentDetails, isUseVehicleOnPolicy, paymentMethod, isPolicyUnverified } = testData; await this.serviceText.waitFor({ state: "visible" }); expect.soft((await this.getActualAppointmentSummary()).map(item => item.toLowerCase())).toEqual((await this.getExpectedAppointmentSummary(testData)).map(item => item.toLowerCase())); @@ -87,6 +87,7 @@ export class OrderConfirmationPage extends BasePage { const finalAmountDueAmt = Number.parseFloat(finalAmountDueValue!.split('$')[1].replaceAll(',', '')); + expect.soft(subtotalAmt).toBeGreaterThan(0); // expect.soft(deductibleAmt).toEqual(0); @@ -94,36 +95,17 @@ export class OrderConfirmationPage extends BasePage { // Verify amount due > 0 expect.soft(amountDueAmt).toBeGreaterThan(0); expect.soft(finalAmountDueAmt).toBeGreaterThan(0); + + if (isPolicyUnverified && PaymentType.PayWithInsurance){ + expect.soft(finalAmountDueAmt).toContain('Verifying coverage') + } } else { // Verify amount due 0 expect.soft(amountDueAmt).toEqual(0); expect.soft(finalAmountDueAmt).toEqual(0); } - } else { - // Price validations for insurance users - if (servicePackage === ServicePackage.GlassOnly) { - expect.soft(servicePackageAmt).toEqual(claimDetails?.policyDeductible); - } else { - expect.soft(servicePackageAmt).toBeGreaterThan(0); - } - - // Check for either "Verifying coverage" or "0.00" in price fields - expect.soft( - amountDueValue?.includes('Verifying coverage') || - amountDueValue?.includes('0.00') - ).toBeTruthy(); - - expect.soft( - subtotalTextValue?.includes('Verifying coverage') || - subtotalTextValue?.includes('0.00') - ).toBeTruthy(); - - expect.soft( - finalAmountDueValue?.includes('Verifying coverage') || - finalAmountDueValue?.includes('0.00') - ).toBeTruthy(); - } } +} async getFormattedAppointmentDate(appointmentDate: string) { From c95772052acbea0fa4c00c3eee51964848522980 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:29:06 -0400 Subject: [PATCH 13/13] Added unverified insurance test to master file --- playwright-tests/tests/0000__M.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index e09acec35..709e288ff 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -32,6 +32,7 @@ import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; import insuranceBigTruckVerifiedTests from "./InsuranceBigTruckVerified"; +import insuranceUnverifiedTests from "./InsuranceUnverified"; /** * Master Test Runner @@ -69,6 +70,7 @@ const allStandardTests = [ {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, + {name: "InsuranceUnverified", tests: insuranceUnverifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests}