diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index 01df8990..05bcbabd 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -7,6 +7,7 @@ export interface ITestData { clientTag: string, isDuplicateClaim: boolean, isPolicyFound: boolean, // Effective difference between advanced and essential + isUnverifiedPolicyAfterVehicleLookup: boolean, // Changing license plate can cause flow to change to unverified from verified isUseVehicleOnPolicy: boolean, // Should we use the vehicle on the policy? isVehicleLookupValidations: boolean, // Should we validate vehicle lookup? isAddressLookupValidations: boolean, // Should we validate address lookup errors? diff --git a/playwright-tests/pages/CoverageStatementPage.ts b/playwright-tests/pages/CoverageStatementPage.ts index 0a8b2553..b5f2a5f0 100644 --- a/playwright-tests/pages/CoverageStatementPage.ts +++ b/playwright-tests/pages/CoverageStatementPage.ts @@ -23,8 +23,8 @@ export class CoverageStatementPage extends BasePage { super(page); this.page = page; - this.cancelMyClaimButton = this.page.getByText('Cancel my claim'); - this.cancelMyClaimConfirm = this.page.getByRole('link', { name: "No, I want to cancel" }); // seen for ITAC/NoComp flows + this.cancelMyClaimButton = this.page.getByRole('link', { name: "No, I want to cancel" }); // seen for ITAC/NoComp flows + this.cancelMyClaimConfirm = this.page.locator('div.text-center', { hasText: "No, I want to cancel" }); // on modal for cancel claim this.deductibleAmount = this.page.locator('.cost-underline'); this.noDeductibleRepairText = this.page.getByText('According to your policy, there is no deductible for a repair.'); // no deductible for repair text @@ -87,13 +87,17 @@ export class CoverageStatementPage extends BasePage { const unVerifiedCustomer = claimDetails.policyDeductible === -1; // if deductible is -1, we treat it as unverified flow if (unVerifiedCustomer) { - await expect(this.unverifiedCoverageHeader).toBeVisible(); await this.continueButton.click(); } } + async handleUnverifiedPolicyAfterVehicleLookupFlow(){ + await expect(this.unverifiedCoverageHeader).toBeVisible(); + await this.continueButton.click(); + } + async handleITACFlow(){ await expect(this.headerForITAC).toBeVisible(); // verify ITAC header is visible diff --git a/playwright-tests/tests/advanced/0023a_VehicleByVINPartsQns.ts b/playwright-tests/tests/advanced/0023a_VehicleByVINPartsQns.ts index f6d650bb..5a33473c 100644 --- a/playwright-tests/tests/advanced/0023a_VehicleByVINPartsQns.ts +++ b/playwright-tests/tests/advanced/0023a_VehicleByVINPartsQns.ts @@ -23,13 +23,14 @@ const customerDetails: ICustomerDetails = { } } -const policyNumber = `~AutomatedScenario0023a${faker.string.uuid().substring(0, 6)}`; +const policyNumber = `~AutomatedScenario0023a${crypto.randomUUID().replace(/-/g, '').slice(0, 16).toUpperCase()}`; // Ensure unique policy number for each test run since same key in request can cause 500 error const policySoap = MockPolicyData.getPolicySoapByScenario('0023a', customerDetails, policyNumber); const advancedScenario0023Data: Partial = { clientTag: '', isDuplicateClaim: false, isPolicyFound: true, + isUnverifiedPolicyAfterVehicleLookup: true, isNoComp: false, hasStateLawPopup: true, endorsements: undefined,