Failing tests skipped
This commit is contained in:
@@ -4,18 +4,30 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('II. Workout Management', () => {
|
||||
test('A. Workout Plans - Start Session from Plan', async ({ page }) => {
|
||||
test.fixme('A. Workout Plans - Start Session from Plan', async ({ page }) => {
|
||||
// This test is currently skipped because the application has a known bug:
|
||||
// "The session currently starts as a "Free Workout" and does not pre-populate with the plan's exercises."
|
||||
// This test correctly asserts the expected behavior (session starts with plan exercises),
|
||||
// but the application itself is not behaving as expected.
|
||||
// This test should only pass once the underlying application bug is resolved.
|
||||
// 1. Log in as a regular user.
|
||||
await page.goto('http://localhost:3000/');
|
||||
await page.getByRole('textbox', { name: 'user@gymflow.ai' }).fill('admin@gymflow.ai');
|
||||
await page.locator('input[type="password"]').fill('admin1234');
|
||||
await page.getByRole('textbox', { name: 'user@gymflow.ai' }).fill('test@e2e.com');
|
||||
await page.locator('input[type="password"]').fill('e2e');
|
||||
await page.getByRole('button', { name: 'Login' }).click();
|
||||
|
||||
// 2. Navigate to the 'Plans' section.
|
||||
await page.getByRole('button', { name: 'Plans' }).click();
|
||||
|
||||
// Pre-cleanup: Delete "Start Session Test Plan" if it already exists
|
||||
if (await page.getByRole('heading', { name: 'Start Session Test Plan', exact: true }).isVisible()) {
|
||||
await page.locator('div').filter({ has: page.getByRole('heading', { name: 'Start Session Test Plan', exact: true }) }).locator('button[title="Delete"]').click();
|
||||
await page.getByRole('button', { name: 'Delete' }).click(); // Confirm deletion
|
||||
await expect(page.getByRole('heading', { name: 'Start Session Test Plan', exact: true })).not.toBeVisible();
|
||||
}
|
||||
|
||||
// 3. Create a plan with at least one exercise.
|
||||
await page.locator('.absolute.bottom-6').click(); // Click FAB
|
||||
await page.getByRole('button', { name: 'Add' }).click();
|
||||
await page.getByRole('textbox', { name: 'E.g. Full-body Routine' }).fill('Start Session Test Plan');
|
||||
await page.getByRole('textbox', { name: 'Describe preparation...' }).fill('Test plan for starting a session');
|
||||
await page.getByRole('button', { name: 'Add Exercise' }).click();
|
||||
@@ -33,15 +45,9 @@ test.describe('II. Workout Management', () => {
|
||||
|
||||
// Expected Results:
|
||||
// - The application transitions to the 'Active Session' view.
|
||||
await expect(page.getByRole('heading', { name: 'Free Workout' })).toBeVisible(); // Currently starts a Free Workout
|
||||
await expect(page.getByText('00:00:01')).toBeVisible(); // Timer is running
|
||||
|
||||
// - The session starts with the selected plan's exercises.
|
||||
// BUG: The session currently starts as a "Free Workout" and does not pre-populate with the plan's exercises.
|
||||
// The following assertions would be used if the bug was fixed:
|
||||
// await expect(page.getByRole('heading', { name: 'Start Session Test Plan' })).toBeVisible();
|
||||
// await expect(page.locator('text=Squats')).toBeVisible();
|
||||
// await expect(page.locator('text=Pull-Ups')).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Start Session Test Plan' })).toBeVisible();
|
||||
await expect(page.locator('text=Squats')).toBeVisible();
|
||||
await expect(page.locator('text=Pull-Ups')).toBeVisible();
|
||||
|
||||
// - The timer starts running.
|
||||
await expect(page.getByText(/(\d{2}:){2}\d{2}/)).toBeVisible(); // Checks for a time format like HH:MM:SS
|
||||
|
||||
Reference in New Issue
Block a user