Files
gymflow/tests/login-invalid-credentials.spec.ts
2025-12-06 20:21:41 +02:00

25 lines
900 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.locator('input[type="email"]').fill('invalid@gymflow.com');
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/');
});
});