34 lines
835 B
TypeScript
34 lines
835 B
TypeScript
import { Page } from '@playwright/test';
|
|
import { BasePage } from './BasePage';
|
|
import { getPageConfig } from '../config/test-pages';
|
|
|
|
export class HomePage extends BasePage {
|
|
constructor(page: Page, config?) {
|
|
const pageConfig = getPageConfig('home');
|
|
super(page, pageConfig.url, config);
|
|
this.pageConfig = pageConfig;
|
|
}
|
|
|
|
private pageConfig;
|
|
|
|
async getHeroTitle(): Promise<string> {
|
|
return await this.getText('h1');
|
|
}
|
|
|
|
async getFeaturesSection(): Promise<boolean> {
|
|
return await this.isVisible('.features-section');
|
|
}
|
|
|
|
async navigateToAbout(): Promise<void> {
|
|
await this.click('a[href="/about"]');
|
|
}
|
|
|
|
async navigateToContact(): Promise<void> {
|
|
await this.click('a[href="/contact"]');
|
|
}
|
|
|
|
async navigateToProducts(): Promise<void> {
|
|
await this.click('a[href="/products"]');
|
|
}
|
|
}
|