Card 8668 Work-1
This commit is contained in:
parent
53ded9b2d3
commit
7a8c57eb7e
14 changed files with 109 additions and 21 deletions
|
|
@ -1,3 +1,11 @@
|
|||
registry=https://pkgs.dev.azure.com/Safelite/Digital/_packaging/DigitalQA/npm/registry/
|
||||
|
||||
always-auth=true
|
||||
|
||||
; begin auth token
|
||||
//pkgs.dev.azure.com/Safelite/Digital/_packaging/DigitalQA/npm/registry/:username=Safelite
|
||||
//pkgs.dev.azure.com/Safelite/Digital/_packaging/DigitalQA/npm/registry/:_password=MlBWQzBWcHBCN3NyQnR3SWxxRFNiU1dRR0dsbDNEcUVXQmRsbDJtSkhxb0J4aUsyTlpzRUpRUUo5OUJLQUNBQUFBQTlKc0tDQUFBU0FaRE9NQ2Ru
|
||||
//pkgs.dev.azure.com/Safelite/Digital/_packaging/DigitalQA/npm/registry/:email=npm requires email to be set but doesn't use the value
|
||||
//pkgs.dev.azure.com/Safelite/Digital/_packaging/DigitalQA/npm/:username=Safelite
|
||||
//pkgs.dev.azure.com/Safelite/Digital/_packaging/DigitalQA/npm/:_password=MlBWQzBWcHBCN3NyQnR3SWxxRFNiU1dRR0dsbDNEcUVXQmRsbDJtSkhxb0J4aUsyTlpzRUpRUUo5OUJLQUNBQUFBQTlKc0tDQUFBU0FaRE9NQ2Ru
|
||||
//pkgs.dev.azure.com/Safelite/Digital/_packaging/DigitalQA/npm/:email=npm requires email to be set but doesn't use the value
|
||||
; end auth token
|
||||
always-auth=true
|
||||
|
|
|
|||
|
|
@ -101,8 +101,19 @@ const essentialClients: IClient[] = [
|
|||
{
|
||||
clientTag: '6D13AEF6-CE16-400F-9A29-A1AED5C47D48',
|
||||
accountName: 'Liberty Mutual',
|
||||
clientFlags: { isTpaEnabled: true }
|
||||
clientFlags: { isTpaEnabled: true },
|
||||
bgColor: "rgb(255, 209, 0)"
|
||||
},
|
||||
|
||||
{
|
||||
clientTag: 'A5F7D473-29C4-4E2C-AD08-A3AB13FE0314',
|
||||
accountName: 'Safeco Insurance',
|
||||
accountNumber: '408810',
|
||||
clientFlags: { isTpaEnabled: true },
|
||||
bgColor: "rgb(255, 209, 0)",
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
clientTag: 'F680CCE4-6D88-4845-9FA4-746CF54B4AC',
|
||||
accountName: 'M Plate',
|
||||
|
|
@ -197,15 +208,41 @@ const essentialClients: IClient[] = [
|
|||
clientTag: '1065734B-2292-4392-8CAF-205F07752BBE',
|
||||
accountName: 'Wayne Insurance',
|
||||
clientFlags: {}
|
||||
},
|
||||
|
||||
{
|
||||
clientTag: '156CDB2D-D49C-49D6-BC63-12B5BEF6D922',
|
||||
accountName: 'State Farm',
|
||||
accountNumber: '711310',
|
||||
clientFlags: {},
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
const advancedClients: IClient[] = [
|
||||
{
|
||||
clientTag: '1216EA5F-64D1-462A-A03F-34C0A652430E',
|
||||
accountName: 'Liberty Mutual',
|
||||
accountNumber: '550036',
|
||||
clientFlags: {},
|
||||
bgColor: "rgb(255, 209, 0)"
|
||||
|
||||
},
|
||||
{
|
||||
clientTag: 'A5F7D473-29C4-4E2C-AD08-A3AB13FE0314',
|
||||
accountName: 'Safeco Insurance',
|
||||
accountNumber: '408810',
|
||||
clientFlags: { isTpaEnabled: true },
|
||||
bgColor: "rgb(255, 209, 0)"
|
||||
|
||||
},
|
||||
{
|
||||
clientTag: '156CDB2D-D49C-49D6-BC63-12B5BEF6D922',
|
||||
accountName: 'State Farm',
|
||||
accountNumber: '711310',
|
||||
clientFlags: {}
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
const defaultCreditCardDetails: IPaymentDetails = {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ const claimRegistrationValue = "{\"claimNumber\":\"058913992\",\"reportedDate\":
|
|||
|
||||
export default class MockPolicyData {
|
||||
|
||||
static interpolatePolicyDetails(policySoap: string, customerDetails: ICustomerDetails, policyNumber: string) {
|
||||
static interpolatePolicyDetails(policySoap: string, customerDetails: ICustomerDetails, policyNumber: string)
|
||||
{
|
||||
return policySoap.replaceAll('${firstName}', customerDetails.firstName)
|
||||
.replaceAll('${lastName}', customerDetails.lastName)
|
||||
.replaceAll('${streetAddress}', customerDetails.address.street)
|
||||
|
|
@ -49,6 +50,18 @@ export default class MockPolicyData {
|
|||
.replaceAll('${policyNumber}', policyNumber)
|
||||
.replaceAll('${phoneNumber}', customerDetails.phoneNumber);
|
||||
}
|
||||
|
||||
static applyClientToPolicySoap(policySoap: string, accountNumber: string) {
|
||||
let orgName = 'Liberty Mutual';
|
||||
let companyProductCd = 'liberty';
|
||||
if (accountNumber === '408810') { //this is safeco account number
|
||||
orgName = 'Safeco';
|
||||
companyProductCd = 'safeco';
|
||||
}
|
||||
return policySoap
|
||||
.replaceAll('<_xml:Org>Liberty Mutual</_xml:Org>', `<_xml:Org>${orgName}</_xml:Org>`)
|
||||
.replaceAll('<_xml:CompanyProductCd>liberty</_xml:CompanyProductCd>', `<_xml:CompanyProductCd>${companyProductCd}</_xml:CompanyProductCd>`);
|
||||
}
|
||||
|
||||
static generateCreateMockPolicyRequest(policyNumber: string, soapValue: string) {
|
||||
const request: IPostSaveFakeResponseRequestBody = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
export interface IClient {
|
||||
clientTag: string,
|
||||
accountName: string
|
||||
clientFlags: Partial<IClientFlags>
|
||||
accountName: string,
|
||||
accountNumber?: string,
|
||||
clientFlags: Partial<IClientFlags>,
|
||||
bgColor?: string
|
||||
}
|
||||
|
||||
export interface IClientFlags {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import IBailoutFlags from "./IBailoutFlags"
|
|||
export interface ITestData {
|
||||
isMockTesting: boolean,
|
||||
clientTag: string,
|
||||
accountNumber: 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
|
||||
|
|
|
|||
|
|
@ -162,9 +162,12 @@ export default class TestCase extends DisposableBase implements ITestCase {
|
|||
public async setup(): Promise<void> {
|
||||
if (this.testData.policySoap && this.testData.claimDetails) {
|
||||
const apiUtil = new CcisApiUtil();
|
||||
const accountNumber = this.testData.accountNumber ?? '550036';
|
||||
const policySoap = MockPolicyData.applyClientToPolicySoap(this.testData.policySoap, accountNumber);
|
||||
|
||||
// Create Policy
|
||||
const req = MockPolicyData.generateCreateMockPolicyRequest(this.testData.claimDetails.policyNumber, policySoap);
|
||||
|
||||
// Create Policy
|
||||
const req = MockPolicyData.generateCreateMockPolicyRequest(this.testData.claimDetails.policyNumber, this.testData.policySoap);
|
||||
console.log('Policy Number: ' + this.testData.claimDetails.policyNumber + ' Damage Date: ' + this.testData.claimDetails.damageDate + ' Postal code: ' + this.testData.customerDetails?.address.postalCode!);
|
||||
const res = await apiUtil.createFakeResponse(req);
|
||||
console.log("Fake Policy creation status" + res.status); // For debug use console.dir(res);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
import { ICustomerDetails } from '@business-logic/types/CustomerDetails';
|
||||
import { IAddress } from '@business-logic/types/IAddress';
|
||||
|
||||
export class ContactDetailsPage extends BasePage {
|
||||
readonly page: Page;
|
||||
|
|
@ -59,6 +60,12 @@ export class ContactDetailsPage extends BasePage {
|
|||
await this.cityTextBox.fill(alternateMobileCity);
|
||||
}
|
||||
|
||||
async fillMobileServiceAddress(serviceAddress: IAddress) {
|
||||
await this.streetAddressTextBox.fill(serviceAddress.street);
|
||||
await this.cityTextBox.fill(serviceAddress.city);
|
||||
await expect.soft(this.zipCodeTextBox).toHaveValue(serviceAddress.postalCode);
|
||||
}
|
||||
|
||||
async fillNotes(notes?: string) {
|
||||
if (notes) {
|
||||
await this.notesTextBox.fill(notes);
|
||||
|
|
|
|||
|
|
@ -38,9 +38,18 @@ export class WelcomePage extends BasePage {
|
|||
async goto(clientTag: string) {
|
||||
await this.page.goto(process.env['BASE_URL']! + `/?issPage=entry-page&ClientTag=${clientTag}`);
|
||||
await this.waitForURL(this.url);
|
||||
await this.cookieCloseButton.click();
|
||||
await this.dismissCookiePopupIfPresent();
|
||||
}
|
||||
|
||||
async dismissCookiePopupIfPresent() {
|
||||
try {
|
||||
await this.cookieCloseButton.waitFor({ state: 'visible', timeout: 3000 });
|
||||
await this.cookieCloseButton.click();
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async gotoWithAuthentication(clientTag: string) {
|
||||
const clientAuth = await getClientAuthByClientTag(clientTag);
|
||||
const certificate = clientAuth.certificateInfo[0] as ICertificateInfo;
|
||||
|
|
|
|||
|
|
@ -858,9 +858,17 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
await contactDetailsPage.validateURL(contactDetailsPage.issPageValue);
|
||||
|
||||
|
||||
await contactDetailsPage.fillContactDetails(customerDetails!);
|
||||
if (appointmentDetails?.alternateMobileCity) {
|
||||
await contactDetailsPage.fillAlternateMobileStreetAndCity(appointmentDetails?.alternateMobileStreetAddress!, appointmentDetails?.alternateMobileCity!);
|
||||
// await contactDetailsPage.fillContactDetails(customerDetails!);
|
||||
// if (appointmentDetails?.alternateMobileCity) {
|
||||
// await contactDetailsPage.fillAlternateMobileStreetAndCity(appointmentDetails?.alternateMobileStreetAddress!, appointmentDetails?.alternateMobileCity!);
|
||||
//}
|
||||
if (appointmentDetails?.serviceAddress) {
|
||||
await contactDetailsPage.fillMobileServiceAddress(appointmentDetails.serviceAddress);
|
||||
} else {
|
||||
await contactDetailsPage.fillContactDetails(customerDetails!);
|
||||
if (appointmentDetails?.alternateMobileCity) {
|
||||
await contactDetailsPage.fillAlternateMobileStreetAndCity(appointmentDetails?.alternateMobileStreetAddress!, appointmentDetails?.alternateMobileCity!);
|
||||
}
|
||||
}
|
||||
|
||||
await contactDetailsPage.nextPage();
|
||||
|
|
|
|||
|
|
@ -21,11 +21,10 @@ const essentialReplaceStaticAdasData: Partial<ITestData> = {
|
|||
phoneNumber: faker.helpers.fromRegExp(/[2-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]/),
|
||||
notes: 'Automated Test',
|
||||
address: {
|
||||
street: "123 Test Road",
|
||||
city: 'Columbus',
|
||||
street: "123 Test St",
|
||||
city: 'Galena',
|
||||
state: 'OHIO',
|
||||
postalCode: '43085',
|
||||
country: 'United States'
|
||||
postalCode: '43021',
|
||||
}
|
||||
},
|
||||
claimDetails: {
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ const essentialRepairMobileData: Partial<ITestData> = {
|
|||
phoneNumber: faker.helpers.fromRegExp(/[2-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]/),
|
||||
notes: 'Automated Test',
|
||||
address: {
|
||||
street: '123 Test Road',
|
||||
street: '7400 Safelite Way',
|
||||
city: 'Columbus',
|
||||
state: 'OHIO',
|
||||
postalCode: '43016',
|
||||
postalCode: '43235',
|
||||
country: 'United States'
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ const essentialServiceableBigTruckData: Partial<ITestData> = {
|
|||
notes: 'Automated Test',
|
||||
address: {
|
||||
street: '9799 Heartland Court',
|
||||
city: 'Dublin',
|
||||
city: 'Columbus',
|
||||
state: 'OHIO',
|
||||
postalCode: '43016',
|
||||
postalCode: '43217',
|
||||
country: 'United States'
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ const advancedScenario0001TestCases: TestCase[] = [];
|
|||
for (const client of advancedClients) {
|
||||
const data = { ...advancedScenario0001Data };
|
||||
data.clientTag = client.clientTag;
|
||||
data.accountNumber = client.accountNumber;
|
||||
const tc = new TestCase({
|
||||
name: `0001a_Advanced_Replace_Deductible_Client: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-6847'],
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const advancedScenario0003Data: Partial<ITestData> = {
|
|||
{
|
||||
partQuestionType: PartQuestionType.WindshieldColor,
|
||||
isOnPage: true,
|
||||
optionToSelect: 'Green Tint'
|
||||
optionToSelect: '05-10 Chrysler 300c'
|
||||
},
|
||||
{
|
||||
partQuestionType: PartQuestionType.PassengerRearColor,
|
||||
|
|
|
|||
Loading…
Reference in a new issue