Sets up the core infrastructure for Playwright-based automated testing, including: - Docker support for consistent environments - Azure Pipelines configuration for CI/CD - Page Object Model structure for maintainable tests - Test data, validation, and rule engine implementation - Test configuration for alerts and other scenarios
36 lines
No EOL
957 B
TypeScript
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();
|
|
}
|
|
|
|
} |