32 lines
1.7 KiB
TypeScript
32 lines
1.7 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('Session Creation', () => {
|
|
test('Attempt to Create Session with Invalid Number of Participants (More than 12)', 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 "13" into the "Number of Expected Responses" spinbutton.
|
|
await page.getByRole('spinbutton', { name: 'Number of Expected Responses' }).fill('13');
|
|
|
|
// 5. Click the "Start Session" button.
|
|
await page.getByRole('button', { name: 'Start Session' }).click();
|
|
|
|
// Expected Results:
|
|
// - An error message indicating that the number of participants cannot exceed 12 is displayed.
|
|
await expect(page.getByText('Must be an integer between 2 and 12')).toBeVisible();
|
|
|
|
// - The session is not created, and the user remains on the session creation page.
|
|
await expect(page).toHaveURL(/.*\/session\/.*/);
|
|
await expect(page.getByRole('heading', { name: 'Harmonize Desires' })).toBeVisible();
|
|
});
|
|
});
|