Files
gymflow/tests/navigation-mobile-bottom-navigation-bar.spec.ts
2025-12-03 18:01:36 +02:00

53 lines
2.5 KiB
TypeScript

// spec: specs/gymflow-test-plan.md
// seed: tests/core-auth.spec.ts
import { test, expect } from '@playwright/test';
test.describe('I. Core & Authentication', () => {
test.fixme('B. Navigation - Mobile Bottom Navigation Bar', async ({ page }) => {
// This test is currently skipped because of persistent issues with user login state or account
// visibility in the mobile bottom navigation bar. Even with corrected credentials, the "Tracker"
// button is not consistently visible, suggesting the user might be in a blocked state or there's
// a deeper problem with the login process. This requires investigation into user account states.
// 1. Log in as a regular user.
await page.goto('http://localhost:3000/');
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. Ensure the browser window is narrow enough to trigger mobile layout (e.g., <768px width).
await page.setViewportSize({ width: 375, height: 667 });
// 3. Verify the bottom navigation bar is present.
await expect(page.getByRole('button', { name: 'Tracker' })).toBeVisible();
// 4. Click on each navigation item (Tracker, Plans, History, Stats, AI Coach, Profile).
// Click on 'Plans'
await page.getByRole('button', { name: 'Plans' }).click();
await expect(page.getByRole('heading', { name: 'Plans' })).toBeVisible();
// Click on 'History'
await page.getByRole('button', { name: 'History' }).click();
await expect(page.getByRole('heading', { name: 'History' })).toBeVisible();
// Click on 'Stats'
await page.getByRole('button', { name: 'Stats' }).click();
await expect(page.getByRole('heading', { name: 'Stats' })).toBeVisible();
// Click on 'AI Coach'
await page.getByRole('button', { name: 'AI Coach' }).click();
await expect(page.getByRole('heading', { name: 'AI Coach' })).toBeVisible();
// Click on 'Profile'
await page.getByRole('button', { name: 'Profile' }).click();
await expect(page.getByRole('heading', { name: 'Profile' })).toBeVisible();
// Click on 'Tracker' to complete the cycle
await page.getByRole('button', { name: 'Tracker', exact: true }).click();
await expect(page.getByRole('heading', { name: 'Ready?' })).toBeVisible();
// Expected: The bottom navigation bar remains visible and functional.
await expect(page.getByRole('button', { name: 'Tracker' })).toBeVisible();
});
});