Fix license plate validation

This commit is contained in:
JennyNou 2026-03-19 10:53:55 -04:00
parent bd11b53413
commit b2f1d2d23a

View file

@ -16,7 +16,7 @@ export class VehicleLookupLicensePage extends BasePage {
this.licensePlateNumTextBox = page.getByRole('textbox', { name: 'License plate number' }); this.licensePlateNumTextBox = page.getByRole('textbox', { name: 'License plate number' });
this.licensePlateStateDrpDwn = page.getByRole('combobox', { name: 'License plate state' }); this.licensePlateStateDrpDwn = page.getByRole('combobox', { name: 'License plate state' });
this.plateNoMatchError = page.getByText('Your license plate didnt return a VIN match.Please re-enter the information'); this.plateNoMatchError = page.getByText('Your license plate didnt return a VIN match.Please re-enter the information');
this.plateMismatchAlert = page.getByRole('alert').locator('div'); this.plateMismatchAlert = page.getByText('We found a windshield, but the VIN associated with the license plate you provided is for a');
} }
async enterPlateDetails(vehicleDetails: IVehicleDetails, isVehicleLookupValidations = false) { async enterPlateDetails(vehicleDetails: IVehicleDetails, isVehicleLookupValidations = false) {
@ -26,6 +26,7 @@ export class VehicleLookupLicensePage extends BasePage {
await this.continueButton.click({ timeout: 1000 }); await this.continueButton.click({ timeout: 1000 });
await expect(this.plateNoMatchError).toBeVisible(); await expect(this.plateNoMatchError).toBeVisible();
await this.licensePlateNumTextBox.fill(vehicleDetails.licensePlateNumber[1]); await this.licensePlateNumTextBox.fill(vehicleDetails.licensePlateNumber[1]);
await this.licensePlateStateDrpDwn.selectOption(vehicleDetails.licensePlateState![1]);
await this.continueButton.click({ timeout: 1000 }); await this.continueButton.click({ timeout: 1000 });
await expect(this.plateMismatchAlert).toBeVisible(); await expect(this.plateMismatchAlert).toBeVisible();
await this.licensePlateNumTextBox.fill(vehicleDetails.licensePlateNumber[2]); await this.licensePlateNumTextBox.fill(vehicleDetails.licensePlateNumber[2]);