Files
pos-system/apps/web-client/e2e/auth.spec.ts
Ho Ngoc Hai c088de53c3 Update dependencies and enhance Tailwind CSS configuration for web applications
- Added new dependencies including clsx, lucide-react, recharts, and various Radix UI components to improve UI functionality.
- Upgraded Tailwind CSS to version 4.0.0 and updated configuration to utilize CSS variables for theming and responsive design.
- Introduced global styles and improved accessibility features in the layout and components.
- Removed outdated login page and refactored authentication store for better state management.
- Enhanced API service with additional authentication methods and improved error handling.

These changes aim to modernize the web applications and improve user experience through better design and functionality.
2026-01-02 09:41:40 +07:00

35 lines
1.3 KiB
TypeScript

import { test, expect } from '@playwright/test';
/**
* EN: E2E tests for authentication flows
* VI: E2E tests cho các luồng xác thực
*/
test.describe('Authentication', () => {
test.beforeEach(async ({ page }) => {
// EN: Navigate to login page / VI: Điều hướng đến trang login
await page.goto('/login');
});
test('should display login page', async ({ page }) => {
await expect(page.getByText('Sign In / Đăng nhập')).toBeVisible();
await expect(page.getByPlaceholderText(/email/i)).toBeVisible();
await expect(page.getByPlaceholderText(/password/i)).toBeVisible();
});
test('should show validation errors for empty form', async ({ page }) => {
await page.getByRole('button', { name: /sign in/i }).click();
// EN: Check for validation errors / VI: Kiểm tra lỗi validation
await expect(page.getByText(/email is required/i)).toBeVisible();
});
test('should navigate to register page', async ({ page }) => {
await page.getByRole('link', { name: /sign up/i }).click();
await expect(page).toHaveURL(/.*\/register/);
});
test('should navigate to forgot password page', async ({ page }) => {
await page.getByRole('link', { name: /forgot password/i }).click();
await expect(page).toHaveURL(/.*\/forgot-password/);
});
});