Merge branch 'develop' into feature/CASH-2563
This commit is contained in:
commit
db95db31d8
9 changed files with 95 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ import VehiclePartQuestionsPage from "../pages/VehiclePartsPage"
|
|||
import CapabilityQuestionsPage from "../pages/CapabilityQuestionsPage"
|
||||
import MoldingQuestionsPage from "../pages/MoldingQuestionsPage"
|
||||
import { InsuranceCompanyPage } from "../pages/InsuranceCompanyPage"
|
||||
import { InsuranceDetailsPage } from "../pages/InsuranceDetailsPage"
|
||||
import { CCPolicyInfoPage } from "../pages/CCPolicyInfoPage"
|
||||
import { DuplicateCheckPage } from "../pages/DuplicateCheckPage"
|
||||
import { PolicyVehiclesPage } from "../pages/PolicyVehiclesPage"
|
||||
|
|
@ -42,6 +43,7 @@ export interface ITestPages {
|
|||
estimatePage: EstimatePage,
|
||||
homePage: HomePage,
|
||||
insuranceCompanyPage: InsuranceCompanyPage,
|
||||
insuranceDetailsPage: InsuranceDetailsPage,
|
||||
leadgenHomePage: LeadgenHomePage,
|
||||
moldingQuestionsPage: MoldingQuestionsPage,
|
||||
orderConfirmationPage: OrderConfirmationPage,
|
||||
|
|
@ -78,6 +80,7 @@ export const createTestPages: TestPagesFactory<ITestPages> = (page: Page) => {
|
|||
estimatePage: new EstimatePage(page),
|
||||
homePage: new HomePage(page),
|
||||
insuranceCompanyPage: new InsuranceCompanyPage(page),
|
||||
insuranceDetailsPage: new InsuranceDetailsPage(page),
|
||||
leadgenHomePage: new LeadgenHomePage(page),
|
||||
moldingQuestionsPage: new MoldingQuestionsPage(page),
|
||||
orderConfirmationPage: new OrderConfirmationPage(page),
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export enum ProgressBarPercentages {
|
|||
VehiclePartsPage = '20%',
|
||||
ServicePackagePage = '60%',
|
||||
InsuranceCompanyPage = '60%',
|
||||
InsuranceDetailsPage = '55%',
|
||||
ServiceLocationPage = '76%',
|
||||
SchedulePage = '76%',
|
||||
MobileDetailsPage = '76%',
|
||||
|
|
|
|||
61
playwright-tests/pages/InsuranceDetailsPage.ts
Normal file
61
playwright-tests/pages/InsuranceDetailsPage.ts
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import { type Locator, type Page } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
import { step } from 'framework/localTypes/Step';
|
||||
import { ITestData } from 'framework/TestData';
|
||||
import { ProgressBarPercentages } from 'framework/localTypes/Enums';
|
||||
|
||||
export class InsuranceDetailsPage extends BasePage {
|
||||
|
||||
readonly page: Page;
|
||||
readonly insuranceCompany: Locator;
|
||||
readonly policyNumber: Locator;
|
||||
readonly dateOfLoss: Locator;
|
||||
readonly damageCause: Locator;
|
||||
readonly claimNumber: Locator; // conditional — only shown for certain insurers like Kentucky Farm Bureau
|
||||
readonly streetAddress: Locator;
|
||||
readonly apartment: Locator;
|
||||
readonly city: Locator;
|
||||
readonly policyState: Locator;
|
||||
readonly policyZip: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page);
|
||||
this.page = page;
|
||||
|
||||
this.insuranceCompany = page.getByLabel('Insurance company');
|
||||
this.policyNumber = page.getByLabel('Policy number');
|
||||
this.dateOfLoss = page.getByLabel('Approximate date of loss');
|
||||
this.claimNumber = page.getByLabel('Claim Number');
|
||||
this.damageCause = page.getByLabel('How did the damage occur?');
|
||||
this.streetAddress = page.getByLabel('Street address');
|
||||
this.apartment = page.getByLabel('Apt. number (optional)');
|
||||
this.city = page.getByLabel('City');
|
||||
this.policyState = page.getByLabel('State');
|
||||
this.policyZip = page.getByLabel('Zip');
|
||||
}
|
||||
|
||||
private async populatePage(testData: Partial<ITestData>): Promise<void> {
|
||||
const { claimDetails, customerDetails } = testData;
|
||||
|
||||
await this.policyNumber.fill(claimDetails!.policyNumber);
|
||||
await this.dateOfLoss.fill(claimDetails!.damageDate);
|
||||
await this.damageCause.selectOption(claimDetails!.damageCause);
|
||||
await this.streetAddress.fill(customerDetails!.address.street);
|
||||
await this.apartment.fill(customerDetails!.address.aptNumber ?? '');
|
||||
await this.city.fill(customerDetails!.address.city);
|
||||
await this.policyState.selectOption(customerDetails!.address.state);
|
||||
await this.policyZip.fill(customerDetails!.address.postalCode);
|
||||
|
||||
if (await this.claimNumber.isVisible()) {
|
||||
await this.claimNumber.fill(claimDetails!.claimNumber ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
@step("InsuranceDetailsPage >> Fill out insurance details for non integrated insurance flow")
|
||||
async handleInsuranceDetailsPage(testData: Partial<ITestData>): Promise<void> {
|
||||
await this.validateProgressBar(ProgressBarPercentages.InsuranceDetailsPage);
|
||||
await this.populatePage(testData);
|
||||
await this.nextPage();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -123,6 +123,7 @@ const storeActions = {
|
|||
|
||||
CREATE_SUBMITTED_STATE: "createSubmittedState",
|
||||
RESET_SUBMITTED_STATE: "resetSubmittedState",
|
||||
RESET_INSURANCE_DETAILS: "resetInsuranceDetails",
|
||||
ADD_DONATION_TO_SUBMITTED_STATE: "addDonationToSubmittedState",
|
||||
RESET_EXTERNAL_PARAMETER_STATE: "resetExternalParameterState",
|
||||
UPDATE_EXTERNAL_PARAMETER_MMS: "updateExternalParameterMMS",
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ const storeMutations = {
|
|||
RESET_SERVICE_LOCATION_MOBILE_ADDRESS: "resetServiceLocationMobileAddress",
|
||||
RESET_SCHEDULE: "resetSchedule",
|
||||
RESET_PAYMENT_METHOD_CHOICE: "resetPaymentMethodChoice",
|
||||
RESET_INSURANCE_DETAILS: "resetInsuranceDetails",
|
||||
|
||||
// OTHER MUTATIONS
|
||||
UPDATE_PAGE_DATA: "updatePageData",
|
||||
|
|
|
|||
|
|
@ -834,11 +834,12 @@ export default {
|
|||
return getBoolFromString(this.$route?.query?.piaError);
|
||||
},
|
||||
shouldDisplayUnverifiedInsuranceAlert() {
|
||||
const shouldDisplayUnverifiedDeduct = experimentMixin.methods.hasSettingEqualTo(
|
||||
const hasExperimentSetting = experimentMixin.methods.hasSettingEqualTo(
|
||||
experimentSettings.SHOW_UNVERIFIED_DEDUCT_ENTRY,
|
||||
"true"
|
||||
);
|
||||
return shouldDisplayUnverifiedDeduct;
|
||||
|
||||
return hasExperimentSetting && this.isInsurance;
|
||||
},
|
||||
// Necessary to make the watcher of lineItems work
|
||||
// JavaScript does not keep a record of the old value, only a reference to it's location in the memory.
|
||||
|
|
|
|||
|
|
@ -799,6 +799,7 @@ export default {
|
|||
false,
|
||||
false
|
||||
);
|
||||
this.dispatchStoreAction(this.storeActions.RESET_INSURANCE_DETAILS, false, false);
|
||||
this.dispatchStoreAction(this.storeActions.SAVE_CAN_SCHEDULE_ONLINE, false, false);
|
||||
this.dispatchStoreAction(this.storeActions.SAVE_ACCOUNT_NAME, null, false);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1234,6 +1234,7 @@ export default {
|
|||
supportingItems[mobileFeeIndex].laborAmount = this.mobileFeePart.laborAmount;
|
||||
supportingItems[mobileFeeIndex].sellingPrice = this.mobileFeePart.sellingPrice;
|
||||
supportingItems[mobileFeeIndex].kitPrice = this.mobileFeePart.kitPrice;
|
||||
supportingItems[mobileFeeIndex].isInsurable = this.mobileFeePart.isInsurable;
|
||||
} else {
|
||||
if (this.mobileFeePart !== null) supportingItems.push(this.mobileFeePart);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -375,6 +375,26 @@ export const mutations = {
|
|||
updateIsInsurance(state, isInsurance) {
|
||||
state.order.payment.isInsurance = isInsurance;
|
||||
},
|
||||
resetInsuranceDetails(state) {
|
||||
state.order.payment.insuranceCoverage = {
|
||||
isVerified: null,
|
||||
coverageStatus: null,
|
||||
coverageSubStatus: null,
|
||||
coverageType: null,
|
||||
coverageVerificationType: null,
|
||||
};
|
||||
|
||||
state.order.policy.policyNumber = null;
|
||||
state.order.policy.claimNumber = null;
|
||||
state.order.policy.insuranceCompanyName = null;
|
||||
state.order.policy.streetAddress = null;
|
||||
state.order.policy.apartment = null;
|
||||
state.order.policy.city = null;
|
||||
state.order.policy.state = null;
|
||||
state.order.policy.zipCode = null;
|
||||
state.order.damage.dateOfLoss = null;
|
||||
state.order.damage.damageCause = null;
|
||||
},
|
||||
updateIsPia(state, isPia) {
|
||||
state.order.payment.isPia = isPia;
|
||||
},
|
||||
|
|
@ -3132,6 +3152,9 @@ export const actions = {
|
|||
saveBillToAccountNumber(context, billToAccountNumber) {
|
||||
context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber);
|
||||
},
|
||||
resetInsuranceDetails(context) {
|
||||
context.commit(storeMutations.RESET_INSURANCE_DETAILS);
|
||||
},
|
||||
|
||||
saveSupportingItems(context, supportingItems) {
|
||||
syncLineItemIds(supportingItems, context.state.order.lineItems.supportingItems);
|
||||
|
|
|
|||
Loading…
Reference in a new issue