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,34 @@
// spec: specs/gymflow-test-plan.md
// seed: tests/data-progress.spec.ts
import { test, expect } from '@playwright/test';
test.describe('IV. Data & Progress', () => {
test('B. Performance Statistics - View Body Weight Chart', 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. Log body weight at least twice (e.g., via profile).
// Set first body weight
await page.getByRole('button', { name: 'Profile' }).click();
await page.getByRole('spinbutton').first().fill('83');
await page.getByRole('button', { name: 'Save Profile' }).click();
// Set second body weight
await page.getByRole('spinbutton').first().fill('85');
await page.getByRole('button', { name: 'Save Profile' }).click();
// 3. Navigate to the 'Stats' section.
await page.getByRole('button', { name: 'Stats' }).click();
// Expected Results:
// - The 'Body Weight' line chart is displayed.
await expect(page.getByRole('heading', { name: 'Body Weight History' })).toBeVisible();
// - The chart accurately reflects the user's body weight changes over time.
// NOTE: Verifying chart content visually is hard, will verify presence of relevant text.
await expect(page.getByText('81')).toBeVisible(); // Check for some values on the chart axis
await expect(page.getByText('85')).toBeVisible(); // Check for some values on the chart axis
});
});