Tests: Auth, Create Session
This commit is contained in:
27
tests/e2e/successful-login-with-valid-passphrase.e2e.test.ts
Normal file
27
tests/e2e/successful-login-with-valid-passphrase.e2e.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Authentication', () => {
|
||||
test('Successful Login with Valid Passphrase', async ({ page }) => {
|
||||
// 1. Navigate to the application URL
|
||||
await page.goto('https://unisono.aglink.duckdns.org');
|
||||
|
||||
// 2. On the login page, enter the valid AUTH_PASSPHRASE into the "Passphrase" textbox.
|
||||
await page.getByRole('textbox', { name: 'Passphrase' }).fill('HonorableHumansPrivilegeIsToBeAllowedHere');
|
||||
|
||||
// 3. Click the "Enter" button.
|
||||
await page.getByRole('button', { name: 'Enter' }).click();
|
||||
|
||||
// Expected Results:
|
||||
// - The user is redirected to a new session creation page (e.g., /session/<session-id>).
|
||||
await expect(page).toHaveURL(/.*\/session\/.*/);
|
||||
|
||||
// - The "Harmonize Desires" heading is visible.
|
||||
await expect(page.getByRole('heading', { name: 'Harmonize Desires' })).toBeVisible();
|
||||
|
||||
// - The session creation form (Topic, Details, Number of Expected Responses, Start Session button) is displayed.
|
||||
await expect(page.getByRole('textbox', { name: 'Topic' })).toBeVisible();
|
||||
await expect(page.getByRole('textbox', { name: 'Details (Optional)' })).toBeVisible();
|
||||
await expect(page.getByRole('spinbutton', { name: 'Number of Expected Responses' })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Start Session' })).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user