Playwright re-established. 54 test cases generated.
This commit is contained in:
30
tests/idle-state-start-free-workout.spec.ts
Normal file
30
tests/idle-state-start-free-workout.spec.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// 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 - Start Free Workout', 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. Ensure the tracker is in the idle state. (This is the default view after login)
|
||||
|
||||
// 3. Enter a body weight in the input field (e.g., '75.5').
|
||||
await page.getByRole('spinbutton').fill('75.5');
|
||||
|
||||
// 4. Click 'Free Workout' button.
|
||||
await page.getByRole('button', { name: 'Free Workout' }).click();
|
||||
|
||||
// Expected Results:
|
||||
// - The application transitions to 'Active Session' view.
|
||||
await expect(page.getByRole('heading', { name: 'Free Workout' })).toBeVisible();
|
||||
// - The timer starts.
|
||||
await expect(page.getByText(/(\d{2}:){2}\d{2}/)).toBeVisible();
|
||||
// - The entered body weight is displayed in the active session header.
|
||||
await expect(page.getByText('• 75.5kg')).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user