Tests: 4. Submit Desires Functionality. Multiple User approcah needs to be fixed.
This commit is contained in:
58
tests/e2e/verify-private-desires-are-not-shared.e2e.test.ts
Normal file
58
tests/e2e/verify-private-desires-are-not-shared.e2e.test.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Results Display Functionality', () => {
|
||||
test.fixme('Verify Private Desires are Not Shared', async ({ page, browser }) => {
|
||||
// 1. Follow steps for "4.2 Multi-User - All Participants Submit Desires", ensuring User 1 submits a "Afraid to Ask (Private)" item.
|
||||
// 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');
|
||||
await page.getByRole('button', { name: 'Enter' }).click();
|
||||
await page.waitForURL(/.*\/session\/.*/);
|
||||
await page.getByRole('textbox', { name: 'Topic' }).fill('Private Desires Test');
|
||||
await page.getByRole('textbox', { name: 'Details (Optional)' }).fill('Verifying private desires are not shared between users.');
|
||||
await page.getByRole('spinbutton', { name: 'Number of Expected Responses' }).fill('2');
|
||||
await page.getByRole('button', { name: 'Start Session' }).click();
|
||||
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());
|
||||
|
||||
// User 1:
|
||||
// a. Enter desires into "What You Want" and "Afraid to Ask (Private)".
|
||||
await page.getByRole('textbox', { name: 'Enter items you want' }).fill('User1 Public Want');
|
||||
await page.getByRole('textbox', { name: 'Enter sensitive ideas privately' }).fill('User1 Secret Desire');
|
||||
|
||||
// b. Click "Submit Desires".
|
||||
await page.getByRole('button', { name: 'Submit Desires' }).click();
|
||||
await expect(page.getByText('Your desires have been submitted.')).toBeVisible();
|
||||
await expect(page.getByText('Waiting for 1 more responses...')).toBeVisible();
|
||||
|
||||
// User 2 (in a new browser context/page):
|
||||
// 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".
|
||||
// User 2 needs to log in first
|
||||
await user2Page.getByRole('textbox', { name: 'Passphrase' }).fill('HonorableHumansPrivilegeIsToBeAllowedHere');
|
||||
await user2Page.getByRole('button', { name: 'Enter' }).click();
|
||||
await user2Page.waitForURL(/.*\/session\/.*/);
|
||||
|
||||
await user2Page.getByRole('textbox', { name: 'Enter items you want' }).fill('User2 Public Want');
|
||||
|
||||
// c. Click "Submit Desires".
|
||||
await user2Page.getByRole('button', { name: 'Submit Desires' }).click();
|
||||
await expect(user2Page.getByText('Your desires have been submitted.')).toBeVisible();
|
||||
|
||||
// Expected Results:
|
||||
// - User 1's private desire is only visible to User 1 (if applicable, or not displayed at all on the results page).
|
||||
await expect(page.getByText('User1 Secret Desire')).toBeVisible(); // User 1 can see their own private desire
|
||||
await expect(user2Page.getByText('User1 Secret Desire')).not.toBeVisible(); // User 2 cannot see User 1's private desire
|
||||
|
||||
// - User 2's results page does not show User 1's private desire.
|
||||
await expect(user2Page.getByText('User2 Public Want')).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user