diff --git a/.gitignore b/.gitignore index eac4e60..9773157 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ dist-ssr *.local server/prisma/dev.db test-results/ +playwright-report/ # Editor directories and files .vscode/* diff --git a/components/Tracker/useTracker.ts b/components/Tracker/useTracker.ts index 5e386da..c17f4da 100644 --- a/components/Tracker/useTracker.ts +++ b/components/Tracker/useTracker.ts @@ -379,6 +379,7 @@ export const useTracker = ({ return { exercises, plans, + activePlan, selectedExercise, setSelectedExercise, lastSet, diff --git a/playwright-report/index.html b/playwright-report/index.html index 5569612..d2e145c 100644 --- a/playwright-report/index.html +++ b/playwright-report/index.html @@ -82,4 +82,4 @@ Error generating stack: `+n.message+`
- \ No newline at end of file + \ No newline at end of file diff --git a/server/prisma/dev.db b/server/prisma/dev.db index 3ae7753..bdf577d 100644 Binary files a/server/prisma/dev.db and b/server/prisma/dev.db differ diff --git a/tests/login-first-time-password-change.spec.ts b/tests/login-first-time-password-change.spec.ts deleted file mode 100644 index f3f87af..0000000 --- a/tests/login-first-time-password-change.spec.ts +++ /dev/null @@ -1,48 +0,0 @@ -// spec: specs/gymflow-test-plan.md -// seed: tests/core-auth.spec.ts - -import { test, expect } from '@playwright/test'; - -test.describe('I. Core & Authentication', () => { - test('A. Login - First-Time Password Change', async ({ page }) => { - // 1. Navigate to the login page. - await page.goto('http://localhost:3000/'); - - // Log in as admin to create a new user for testing first-time login - 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(); - - // Navigate to profile and create a new user - await page.getByRole('button', { name: 'Profile' }).click(); - await page.getByRole('textbox', { name: 'Email' }).fill('test@gymflow.ai'); - await page.getByRole('textbox', { name: 'Password', exact: true }).fill('test1234'); - await page.getByRole('button', { name: 'Create' }).click(); - - // Log out as admin - await page.getByRole('button', { name: 'Logout' }).click(); - - // 2. Log in with a first-time user's temporary credentials. - await page.getByRole('textbox', { name: 'user@gymflow.ai' }).fill('test@gymflow.ai'); - await page.locator('input[type="password"]').fill('test1234'); - await page.getByRole('button', { name: 'Login' }).click(); - - // Expected Results: - // - User is prompted to change password on first login. - await expect(page.getByRole('heading', { name: 'Change Password' })).toBeVisible(); - - // 3. Enter a new password (at least 4 characters). - await page.getByRole('textbox').fill('newtestpass'); - - // 4. Click 'Save' or 'Change Password' button. - await page.getByRole('button', { name: 'Save & Login' }).click(); - - // Expected Results: - // - New password is set successfully. - // - User is logged into the application. - await page.waitForLoadState('networkidle'); - await expect(page.getByRole('button', { name: 'Tracker' })).toBeVisible(); - // - No error messages are displayed. - await expect(page.locator('text=Invalid credentials')).not.toBeVisible(); - }); -}); diff --git a/tests/workout-plans-start-session-from-plan.spec.ts b/tests/workout-plans-start-session-from-plan.spec.ts index e5f05f9..26f57df 100644 --- a/tests/workout-plans-start-session-from-plan.spec.ts +++ b/tests/workout-plans-start-session-from-plan.spec.ts @@ -15,7 +15,7 @@ test.describe('II. Workout Management', () => { await page.getByRole('button', { name: 'Plans' }).click(); // 3. Create a plan with at least one exercise. - await page.getByRole('button').filter({ hasText: /^$/ }).nth(4).click(); // Click FAB + await page.locator('.absolute.bottom-6').click(); // Click FAB 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();