25 lines
918 B
TypeScript
25 lines
918 B
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('A. Login - Invalid Credentials', async ({ page }) => {
|
|
// 1. Navigate to the login page.
|
|
await page.goto('http://localhost:3000/');
|
|
|
|
// 2. Enter an invalid email or password.
|
|
await page.getByRole('textbox', { name: 'user@gymflow.ai' }).fill('invalid@gymflow.ai');
|
|
await page.locator('input[type="password"]').fill('wrongpassword');
|
|
|
|
// 3. Click the 'Login' button.
|
|
await page.getByRole('button', { name: 'Login' }).click();
|
|
|
|
// Expected Results:
|
|
// - An error message 'Invalid credentials' or similar is displayed.
|
|
await expect(page.locator('text=Invalid credentials')).toBeVisible();
|
|
// - User remains on the login page.
|
|
await expect(page).toHaveURL('http://localhost:3000/');
|
|
});
|
|
});
|