// 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.fixme('C. Admin Panel - View User List', async ({ page }) => { // This test is currently skipped because it fails to find seeded users (e.g., 'user1@gymflow.ai') // in the admin user list, which is necessary for verification. This suggests an underlying issue // with the seed data, the application's user management logic, or how users are rendered/displayed // within the admin panel. This requires further investigation. // 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 \(\d+\)/ }).click(); // 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 }); });