Playwright re-established. 54 test cases generated.
This commit is contained in:
26
tests/login-successful-authentication.spec.ts
Normal file
26
tests/login-successful-authentication.spec.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// 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 - Successful Authentication', async ({ page }) => {
|
||||
// 1. Navigate to the login page (http://192.168.50.234:3000/).
|
||||
await page.goto('http://192.168.50.234:3000/');
|
||||
|
||||
// 2. Enter a valid email in the email field.
|
||||
await page.getByRole('textbox', { name: 'user@gymflow.ai' }).fill('admin@gymflow.ai');
|
||||
|
||||
// 3. Enter a valid password in the password field.
|
||||
await page.locator('input[type="password"]').fill('admin1234');
|
||||
|
||||
// 4. Click the 'Login' button.
|
||||
await page.getByRole('button', { name: 'Login' }).click();
|
||||
|
||||
// Expected Results:
|
||||
// - User is redirected to the main application dashboard (e.g., Tracker view).
|
||||
await expect(page).toHaveURL('http://192.168.50.234:3000/#/tracker');
|
||||
// - No error messages are displayed.
|
||||
await expect(page.locator('text=Invalid credentials')).not.toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user