// TEMPLATE THAM CHIẾU — không phải file chạy thật. // Skill dùng style này để sinh tests/e2e/specs//.spec.ts. // ID test (TC01...) phải khớp bảng test case đã chốt ở Phase 2. import { test, expect } from '../../fixtures/test'; import { LoginPage } from '../../pages/LoginPage'; test.describe('Đăng nhập hệ thống', () => { test('TC01 - Đăng nhập thành công với credentials hợp lệ', async ({ page }) => { const loginPage = new LoginPage(page); await loginPage.navigate('/login'); await loginPage.login('admin@example.com', 'Password123'); await expect(page).toHaveURL(/\/dashboard/); }); test('TC02 - Hiển thị lỗi khi nhập sai mật khẩu', async ({ page }) => { const loginPage = new LoginPage(page); await loginPage.navigate('/login'); await loginPage.login('admin@example.com', 'wrong-password'); await expect(loginPage.errorMessage).toBeVisible(); }); test('TC03 - Hiển thị validation khi để trống email', async ({ page }) => { const loginPage = new LoginPage(page); await loginPage.navigate('/login'); await loginPage.submitButton.click(); await expect(page.getByText('Email là bắt buộc')).toBeVisible(); }); });