22 lines
890 B
TypeScript
22 lines
890 B
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('Authentication', () => {
|
|
test('Unsuccessful Login with Invalid Passphrase', async ({ page }) => {
|
|
// 1. Navigate to the application URL
|
|
await page.goto('https://unisono.aglink.duckdns.org/login');
|
|
|
|
// 2. On the login page, enter an invalid passphrase (e.g., "incorrect-passphrase") into the "Passphrase" textbox.
|
|
await page.getByRole('textbox', { name: 'Passphrase' }).fill('incorrect-passphrase');
|
|
|
|
// 3. Click the "Enter" button.
|
|
await page.getByRole('button', { name: 'Enter' }).click();
|
|
|
|
// Expected Results:
|
|
// - An error message indicating invalid credentials is displayed.
|
|
await expect(page.locator('.MuiAlert-standardError', { hasText: 'Invalid passphrase' })).toBeVisible();
|
|
|
|
// - The user remains on the login page.
|
|
await expect(page).toHaveURL(/.*\/login/);
|
|
});
|
|
});
|