import { Page, expect } from '@playwright/test'; export class FrontendNewsPage { constructor(private page: Page) {} async goto() { await this.page.goto('/news'); await this.page.waitForLoadState('networkidle'); } async expectNewsVisible(title: string) { const newsCard = this.page.locator(`text="${title}"`); await expect(newsCard).toBeVisible(); } async expectNewsNotVisible(title: string) { const newsCard = this.page.locator(`text="${title}"`); await expect(newsCard).not.toBeVisible(); } async clickNews(title: string) { await this.page.locator(`text="${title}"`).click(); await this.page.waitForLoadState('networkidle'); } async expectNewsDetailVisible(content: string) { await expect(this.page.locator(`text=${content}`)).toBeVisible(); } }