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,41 @@
// spec: specs/gymflow-test-plan.md
// seed: tests/workout-tracking.spec.ts
import { test, expect } from '@playwright/test';
test.describe('III. Workout Tracking', () => {
test('C. Active Session - Quit Session Without Saving', async ({ page }) => {
// 1. Start a 'Free Workout' session.
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();
await page.getByRole('spinbutton').fill('83');
await page.getByRole('button', { name: 'Free Workout' }).click();
// 2. Log at least one set.
await page.getByRole('textbox', { name: '0' }).fill('Bench Press');
await page.getByRole('button', { name: 'Bench Press' }).click();
await page.getByPlaceholder('0').nth(1).fill('80');
await page.getByPlaceholder('0').nth(2).fill('5');
await page.getByRole('button', { name: 'Log Set' }).click();
// 3. Click 'More' (three dots) menu.
await page.getByRole('button').filter({ hasText: /^$/ }).first().click();
// 4. Select 'Quit Without Saving'.
await page.getByRole('button', { name: 'Quit without saving' }).click();
// 5. Confirm quitting.
await page.getByRole('button', { name: 'Confirm' }).click();
// Expected Results:
// - Session data is discarded.
// NOTE: This cannot be directly verified from the UI in this step, but implicitly tested if user returns to idle state without error.
// - User is returned to the 'Idle State' of the Tracker.
await expect(page.getByRole('heading', { name: 'Ready?' })).toBeVisible();
// - No error messages.
await expect(page.locator('text=Error')).not.toBeVisible();
});
});