Tests: Auth, Create Session
This commit is contained in:
36
tests/e2e/create-session-with-valid-data.e2e.test.ts
Normal file
36
tests/e2e/create-session-with-valid-data.e2e.test.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Session Creation', () => {
|
||||
test('Create Session with Valid Data', async ({ page }) => {
|
||||
// Ensure the user is logged in and on the session creation page.
|
||||
await page.goto('https://unisono.aglink.duckdns.org/login');
|
||||
await page.getByRole('textbox', { name: 'Passphrase' }).fill('HonorableHumansPrivilegeIsToBeAllowedHere');
|
||||
await page.getByRole('button', { name: 'Enter' }).click();
|
||||
await expect(page).toHaveURL(/.*\/session\/.*/);
|
||||
|
||||
// 2. Enter a valid topic (e.g., "Project Alpha Planning") into the "Topic" textbox.
|
||||
await page.getByRole('textbox', { name: 'Topic' }).fill('Project Alpha Planning');
|
||||
|
||||
// 3. Enter optional details (e.g., "Discuss Q4 goals and allocate resources") into the "Details (Optional)" textbox.
|
||||
await page.getByRole('textbox', { name: 'Details (Optional)' }).fill('Discuss Q4 goals and allocate resources');
|
||||
|
||||
// 4. Enter a valid number of participants (e.g., "3") into the "Number of Expected Responses" spinbutton.
|
||||
await page.getByRole('spinbutton', { name: 'Number of Expected Responses' }).fill('3');
|
||||
|
||||
// 5. Click the "Start Session" button.
|
||||
await page.getByRole('button', { name: 'Start Session' }).click();
|
||||
|
||||
// Expected Results:
|
||||
// - A new session is created.
|
||||
// - The user is redirected to the active session page.
|
||||
await expect(page).toHaveURL(/.*\/session\/.*/);
|
||||
|
||||
// - The session details (Topic, Details, Number of Expected Responses) are displayed correctly.
|
||||
await expect(page.getByRole('heading', { name: 'Project Alpha Planning' })).toBeVisible();
|
||||
await expect(page.getByText('Details: Discuss Q4 goals and allocate resources')).toBeVisible();
|
||||
await expect(page.getByText('Expected Responses: 3')).toBeVisible();
|
||||
|
||||
// - A "Copy Link" button is visible.
|
||||
await expect(page.getByRole('button', { name: 'Copy Link' })).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user