Merge pull request #2594 from JennyNou/CASH-642-latest

Cash 642 latest into Cash 631
This commit is contained in:
maguire-arman 2025-06-19 12:58:39 -04:00 committed by GitHub
commit 58ae246a41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 94 additions and 1 deletions

View file

@ -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();
}

View file

@ -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},

View file

@ -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<ITestData> = {
...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;