27 lines
1.2 KiB
TypeScript
27 lines
1.2 KiB
TypeScript
// 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://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();
|
|
|
|
// 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');
|
|
});
|
|
});
|