30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
// spec: specs/gymflow-test-plan.md
|
|
// seed: tests/user-system-management.spec.ts
|
|
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('V. User & System Management', () => {
|
|
test('C. Admin Panel - View User List', async ({ page }) => {
|
|
// 1. Log in as an 'ADMIN' user.
|
|
await page.goto('http://localhost:3000/');
|
|
await page.getByRole('textbox', { name: 'user@gymflow.ai' }).fill('admin@gymflow.ai');
|
|
await page.locator('input[type="password"]').fill('admin1234');
|
|
await page.getByRole('button', { name: 'Login' }).click();
|
|
|
|
// 2. Navigate to the 'Profile' section.
|
|
await page.getByRole('button', { name: 'Profile' }).click();
|
|
|
|
// 3. Expand 'Admin Area'. (Implicitly expanded for admin users)
|
|
|
|
// 4. Click to expand 'Users List'.
|
|
await page.getByRole('button', { name: 'Users List (3)' }).click(); // 3 seeded users
|
|
|
|
// Expected Results:
|
|
// - A list of all users (excluding the current admin) is displayed, showing their email, role, and blocked status.
|
|
await expect(page.getByText('user1@gymflow.ai')).toBeVisible();
|
|
await expect(page.getByText('user2@gymflow.ai')).toBeVisible();
|
|
await expect(page.getByText('blocked@gymflow.ai')).toBeVisible();
|
|
await expect(page.getByText('admin@gymflow.ai')).not.toBeVisible(); // Admin user should not be in the list
|
|
});
|
|
});
|