E2e Tests updated
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Submit Desires Functionality', () => {
|
||||
test.fixme('Multi-User - Different Desire Submissions', async ({ page, browser }) => {
|
||||
test('Multi-User - Different Desire Submissions', async ({ page, browser }) => {
|
||||
// 1. Create a session with `Number of Expected Responses` set to 2.
|
||||
await page.goto('https://unisono.aglink.duckdns.org/login');
|
||||
await page.getByRole('textbox', { name: 'Passphrase' }).fill('HonorableHumansPrivilegeIsToBeAllowedHere');
|
||||
@@ -14,11 +14,9 @@ test.describe('Submit Desires Functionality', () => {
|
||||
await page.waitForURL(/.*\/session\/.*/);
|
||||
|
||||
// Copy the session link.
|
||||
await page.getByRole('button', { name: 'Copy Link' }).click();
|
||||
await expect(page.getByText('Link copied to clipboard!')).toBeVisible();
|
||||
const sessionLink = await page.evaluate(() => navigator.clipboard.readText());
|
||||
const sessionLink = page.url();
|
||||
|
||||
// 3. User 1:
|
||||
// 3. User 1 (in the initial browser context):
|
||||
// a. Enter items into "What You Want" (e.g., "User1 Want A").
|
||||
await page.getByRole('textbox', { name: 'Enter items you want' }).fill('User1 Want A');
|
||||
|
||||
@@ -30,26 +28,24 @@ test.describe('Submit Desires Functionality', () => {
|
||||
await expect(page.getByText('Your desires have been submitted.')).toBeVisible();
|
||||
await expect(page.getByText('Waiting for 1 more responses...')).toBeVisible();
|
||||
|
||||
// 4. User 2 (in a new browser context/page):
|
||||
// 4. User 2 (in a new browser context, e.g., using `browser.newContext()` in Playwright):
|
||||
// a. Navigate to the copied session link.
|
||||
const user2Context = await browser.newContext();
|
||||
const user2Page = await user2Context.newPage();
|
||||
await user2Page.goto(sessionLink);
|
||||
|
||||
// b. Enter desires into "What You Want" (e.g., "User2 Want C").
|
||||
// User 2 needs to log in first
|
||||
await user2Page.goto('https://unisono.aglink.duckdns.org/login');
|
||||
await user2Page.getByRole('textbox', { name: 'Passphrase' }).fill('HonorableHumansPrivilegeIsToBeAllowedHere');
|
||||
await user2Page.getByRole('button', { name: 'Enter' }).click();
|
||||
await user2Page.waitForURL(/.*\/session\/.*/);
|
||||
await user2Page.goto(sessionLink);
|
||||
|
||||
// c. Enter items into "What You Want" (e.g., "User2 Want C").
|
||||
await user2Page.getByRole('textbox', { name: 'Enter items you want' }).fill('User2 Want C');
|
||||
|
||||
// c. Enter items into "What You Accept" (e.g., "User2 Accept D").
|
||||
// d. Enter items into "What You Accept" (e.g., "User2 Accept D").
|
||||
await user2Page.getByRole('textbox', { name: 'Enter items you accept' }).fill('User2 Accept D');
|
||||
|
||||
// d. Click "Submit Desires".
|
||||
// e. Click "Submit Desires".
|
||||
await user2Page.getByRole('button', { name: 'Submit Desires' }).click();
|
||||
await expect(user2Page.getByText('Your desires have been submitted.')).toBeVisible();
|
||||
|
||||
// Expected Results:
|
||||
// - Both users' pages transition to the "Results Display" page.
|
||||
|
||||
Reference in New Issue
Block a user