diff --git a/playwright-tests/pages/CoverageStatementPage.ts b/playwright-tests/pages/CoverageStatementPage.ts index b529f21f1..66ab7c763 100644 --- a/playwright-tests/pages/CoverageStatementPage.ts +++ b/playwright-tests/pages/CoverageStatementPage.ts @@ -10,6 +10,7 @@ export class CoverageStatementPage extends InsuranceBasePage { readonly cancelMyClaimButton: Locator; readonly deductibleAmount: Locator; readonly verifyingCoverageText: Locator; + readonly noCompText: Locator; readonly continueButton: Locator; // For ITAC/NoComp url = process.env['BASE_URL']! + '/FixMyGlass/CoverageStatement.aspx'; @@ -20,6 +21,7 @@ export class CoverageStatementPage extends InsuranceBasePage { this.cancelMyClaimButton = this.page.getByText('Cancel my claim'); this.deductibleAmount = this.page.getByRole('heading', { name: '$' }).locator('span'); this.verifyingCoverageText = this.page.getByRole('heading', { name: 'We\'re verifying your coverage' }); + this.noCompText = this.page.getByRole('heading', { name: 'Your policy doesn\'t cover this service' }); this.continueButton = page.getByRole('button', { name: 'Continue' }); // this.validateURL(this.url); } @@ -54,7 +56,7 @@ export class CoverageStatementPage extends InsuranceBasePage { await expect(deductibleElement).toContainText(`$${expectedDeductibleRegex}`); } - if (await unverifiedDeductibleElement.isVisible()) { + if (await unverifiedDeductibleElement.isVisible() || await this.noCompText.isVisible()) { // Click on continue button if unverified header is visible await this.continueButton.click(); } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 419bd227a..022e23abb 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -27,6 +27,7 @@ import insuranceAcuityPaypalTests from "./InsuranceAcuityPaypal"; import insuranceITAC21stCenturyTests from "./InsuranceITAC21stCentury"; import insuranceGeicoTests from "./InsuranceGeico"; import insuranceITACOptimizedPriceValidationAllStateTests from "./InsuranceITACOptimizedPriceValidationAllState"; +import insuranceNoCompProgressiveTests from "./InsuranceNoCompProgressive"; import cashRepairInShopAfterPayTests from "./CashRepairInShopAfterPay"; import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; @@ -70,6 +71,7 @@ const allStandardTests = [ {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, + {name: "InsuranceNoCompProgressive", tests: insuranceNoCompProgressiveTests}, {name: "CashReplaceSwitchToInsuranceProgressiveNoComp", tests: cashReplaceSwitchToInsuranceProgressiveNoCompTests}, {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, {name: "InsuranceUnverified", tests: insuranceUnverifiedTests}, diff --git a/playwright-tests/tests/InsuranceNoCompProgressive.ts b/playwright-tests/tests/InsuranceNoCompProgressive.ts new file mode 100644 index 000000000..f1f30fe87 --- /dev/null +++ b/playwright-tests/tests/InsuranceNoCompProgressive.ts @@ -0,0 +1,89 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData" +import { PaymentMethod, AppointmentType, DamageType, PaymentType, 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("InsuranceNoCompProgressive"); + +// Now get the test data with the seeded faker +const insuranceNoCompProgressiveData: 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: false, + isPolicyDriver: true, + isRecalVehicle: true, + + // Override customer details with specific name and California location + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'SHERI', + lastName: 'SCHATZ', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Slidell', + state: 'Louisiana', + postalCode: '70458' + } + }, + + + // Insurance claim details + claimDetails: { + client: 'Progressive', + policyNumber: 'Mock495646B', + policyDeductible: 1722.20, + policyZip: '70458', + 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: '2015', + make: 'Acura', + model: 'MDX', + style: '4 door utility', + 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: '56705 Garrett Road, Slidell, LA 70458', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + // Override payment details (empty because we skip payment method page in insurance flow) + paymentDetails: {} +} + +const insuranceNoCompProgressiveTests: TestCase[] = []; + +const tc = new TestCase({ + name: `InsuranceNoCompProgressive`, + tags: ['@E2E','@InsuranceNoCompProgressive', '@test_report', '@Insurance'], + testData: insuranceNoCompProgressiveData +}, undefined, 'InsuranceBigTruckVerified'); +insuranceNoCompProgressiveTests.push(tc); + +export default insuranceNoCompProgressiveTests; \ No newline at end of file