Playwright re-established. 54 test cases generated.

This commit is contained in:
AG
2025-11-30 14:35:47 +02:00
parent 683f80dfea
commit eef65251d7
63 changed files with 5752 additions and 157 deletions

View File

@@ -0,0 +1,39 @@
// 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('A. User Profile - Update Personal Information', async ({ page }) => {
// 1. Log in as a regular 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. Modify 'Weight', 'Height', 'Birth Date', and 'Gender'.
await page.getByRole('spinbutton').first().fill('88'); // Weight
await page.getByRole('spinbutton').nth(1).fill('190'); // Height
await page.locator('input[type="date"]').fill('1990-01-01'); // Birth Date
await page.getByRole('combobox').first().selectOption(['Female']); // Gender
// 4. Click 'Save Profile'.
await page.getByRole('button', { name: 'Save Profile' }).click();
// Expected Results:
// - Profile information is updated successfully.
// - A success snackbar message is displayed.
await expect(page.getByText('Profile saved successfully')).toBeVisible();
// - The updated information is reflected upon refreshing the profile or re-logging in.
await page.getByRole('button', { name: 'Tracker', exact: true }).click();
await page.getByRole('button', { name: 'Profile' }).click();
await expect(page.getByRole('spinbutton').first()).toHaveValue('88');
await expect(page.getByRole('spinbutton').nth(1)).toHaveValue('190');
await expect(page.locator('input[type="date"]')).toHaveValue('1990-01-01');
await expect(page.getByRole('combobox').first()).toHaveValue('Female');
});
});