import { Page, expect } from '@playwright/test'; export class AdminLoginPage { constructor(private page: Page) {} async goto() { await this.page.goto('/admin/login'); await this.page.waitForLoadState('networkidle'); } async login(email: string, password: string) { await this.page.fill('#email', email); await this.page.fill('#password', password); await this.page.click('button[type="submit"]'); await this.page.waitForURL(/\/admin(?!\/login)/); } async expectLoginSuccess() { await expect(this.page).toHaveURL(/\/admin(?!\/login)/); } async expectLoginError() { await expect(this.page.locator('[role="alert"]')).toBeVisible(); } }