DigitalConsumer.FixMyGlass/playwright-tests/pages/LeadgenHomePage.ts
maguire-arman 404dda6556 Adds Playwright test framework for FMG
Initial commit of the Playwright test framework, including:
- Configuration files for Playwright, Docker, and Sauce Labs
- Test case structure and page object models
- CI/CD pipeline configuration
- Utilities and business logic implementations

This framework will be used for end-to-end testing of the FMG application.
2025-04-07 15:40:31 -04:00

36 lines
No EOL
957 B
TypeScript

import test, { Locator, Page } from '@playwright/test';
import { BasePage } from './BasePage';
// This file is an example of a Page Object Model
export class LeadgenHomePage extends BasePage {
readonly page: Page;
readonly letsGetStartedButton: Locator;
readonly zipTextbox: Locator;
url = process.env['BASE_URL']!;
constructor(page: Page) {
super(page);
this.page = page;
this.letsGetStartedButton = this.page.locator('#zipCodeTextboxButton');
this.zipTextbox = this.page.getByPlaceholder('Enter service ZIP code');
}
async goto() {
await this.page.goto(process.env['BASE_URL']!);
// await this.validateURL(this.url);
}
async letsGetStarted(zip: string) {
await this.zipTextbox.fill(zip);
await this.letsGetStartedButton.click();
}
async isCurrentVariant(): Promise<boolean> {
return await this.zipTextbox.isVisible();
}
}