feat: add page objects for all pages
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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"]');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user