Planned session start fixed.
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user