Files
unisono/tests/e2e/single-user-submit-only-what-you-want.e2e.test.ts

33 lines
1.7 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('Submit Desires Functionality', () => {
test('Single User - Submit Only "What You Want"', async ({ page }) => {
// Ensure a session is created and the user is on the active session 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 page.waitForURL(/.*\/session\/.*/);
await page.getByRole('textbox', { name: 'Topic' }).fill('Single User Only Want');
await page.getByRole('textbox', { name: 'Details (Optional)' }).fill('Testing submission of only \'What You Want\' by a single user.');
await page.getByRole('spinbutton', { name: 'Number of Expected Responses' }).fill('2');
await page.getByRole('button', { name: 'Start Session' }).click();
await page.waitForURL(/.*\/session\/.*/);
// 2. Enter items into "What You Want" textbox (e.g., "Only Want This").
await page.getByRole('textbox', { name: 'Enter items you want' }).fill('Only Want This');
// 3. Leave other desire fields empty.
// (Implicitly handled by not filling them)
// 4. Click the "Submit Desires" button.
await page.getByRole('button', { name: 'Submit Desires' }).click();
// Expected Results:
// - Desires are submitted successfully.
await expect(page.getByText('Your desires have been submitted.')).toBeVisible();
// - The page transitions to a "Waiting for other participants" or similar state.
await expect(page.getByText('Waiting for 1 more responses...')).toBeVisible();
});
});