Removes the explicit URL declaration from the page classes. The URL validation and navigation are now handled directly within the tests, providing greater flexibility and control over test execution and removing the need to manage URLs within each page object.
20 lines
No EOL
831 B
TypeScript
20 lines
No EOL
831 B
TypeScript
import { Page } from "@playwright/test";
|
|
import { LookupPage } from "./LookupPage";
|
|
import { step } from 'framework/localTypes/Step';
|
|
import { ITestData } from 'framework/TestData';
|
|
import { ProgressBarPercentages } from 'framework/localTypes/Enums';
|
|
|
|
export class ServiceZipPage extends LookupPage {
|
|
|
|
constructor(page: Page) {
|
|
super(page);
|
|
}
|
|
|
|
@step("ZipLookupPage >> Lookup by service ZIP: ")
|
|
async handleServiceZipPage(testData: Partial<ITestData>) {
|
|
const { customerDetails, vehicleDetails, alertFlags } = testData;
|
|
await this.validateProgressBar(ProgressBarPercentages.ServiceZipPage);
|
|
await this.enterZip(customerDetails!.address.postalCode!);
|
|
await this.handleZipValidation(customerDetails!.address.postalCode!, vehicleDetails!.vehicleLookupType!, alertFlags!);
|
|
}
|
|
} |