Playwright re-established. 54 test cases generated.
This commit is contained in:
29
tests/admin-panel-view-user-list.spec.ts
Normal file
29
tests/admin-panel-view-user-list.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// 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://192.168.50.234: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
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user