import { Page, expect } from '@playwright/test'; export class FrontendProductPage { constructor(private page: Page) {} async goto() { await this.page.goto('/products'); await this.page.waitForLoadState('networkidle'); } async expectProductVisible(title: string) { const productCard = this.page.locator(`text="${title}"`); await expect(productCard).toBeVisible(); } async clickProduct(title: string) { await this.page.locator(`text="${title}"`).click(); await this.page.waitForLoadState('networkidle'); } }