// spec: specs/gymflow-test-plan.md // seed: tests/workout-tracking.spec.ts import { test, expect } from '@playwright/test'; test.describe('III. Workout Tracking', () => { test('B. Idle State - Body Weight Defaults from Profile', async ({ page }) => { // 1. Log in as a regular user with a weight set in their profile. await page.goto('http://localhost:3000/'); await page.locator('input[type="email"]').fill('admin@gymflow.ai'); await page.locator('input[type="password"]').fill('admin123'); await page.getByRole('button', { name: 'Login' }).click(); // Ensure the weight is set in the profile before navigating to tracker await page.getByRole('button', { name: 'Profile' }).click(); await page.getByRole('spinbutton').first().fill('83'); // Set to default 83kg await page.getByRole('button', { name: 'Save Profile' }).click(); // 2. Navigate to the 'Tracker' section (Idle View). await page.getByRole('button', { name: 'Tracker', exact: true }).click(); // Expected Results: // - The 'My Weight' field in the Idle View defaults to the weight specified in the user's profile. await expect(page.getByRole('spinbutton')).toHaveValue('83'); }); });