Add Playwright E2E suite (46 tests) + app testids + test_cases.md
- e2e/: full Playwright suite covering every spec case (staff auth/UI, welcome + session check-in, attendee access/gating, connections, profile visibility, speaker material, sponsor, feedback, E2E journeys, role security matrix). 46/46 passing. - apps/convivo: add data-testid attributes (gate, tabs, scanner, toggles) to support the E2E suite. - test_cases.md: spec-case-to-test coverage map (all cases fully covered). - .gitignore: ignore e2e node_modules/reports/test-results. Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
b08a439949
commit
d5ec009cb5
44 files changed
+3715
-26
No files matched your search
@@ -0,0 +1,50 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
|
||||
/**
|
||||
* §12 Attendee Core Navigation — CONV-ATT-UI-001.
|
||||
*
|
||||
* A successfully admitted attendee can access Home, Agenda, Connections and
|
||||
* Profile. The application must remain associated with the Demo Event, display
|
||||
* the demo timetable, navigate successfully between areas, not produce frontend
|
||||
* errors, and not lose authenticated state during normal navigation.
|
||||
*/
|
||||
test('CONV-ATT-UI-001 an admitted attendee can navigate all areas without errors', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
|
||||
// Collect console + page errors for the report.
|
||||
const errors: string[] = [];
|
||||
page.on('console', (m) => m.type() === 'error' && errors.push(m.text()));
|
||||
page.on('pageerror', (e) => errors.push(`pageerror: ${e.message}`));
|
||||
|
||||
// ATTENDEE_A is a normal attendee (welcome-checked-in at reset).
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Home — the app is associated with the Demo Event.
|
||||
await app.gotoTab('home');
|
||||
await expect(app.eventTitle()).toBeVisible();
|
||||
|
||||
// Agenda — the demo timetable renders.
|
||||
await app.gotoTab('agenda');
|
||||
await expect(app.eventTitle()).toBeVisible();
|
||||
await expect(page.getByText(/slots/)).toBeVisible();
|
||||
|
||||
// Connections — the area renders (My connections tab present).
|
||||
await app.gotoTab('connections');
|
||||
await expect(page.getByTestId('connections-tab-mine')).toBeVisible();
|
||||
|
||||
// Profile — the area renders (save control present).
|
||||
await app.gotoTab('profile');
|
||||
await expect(page.getByTestId('profile-save')).toBeVisible();
|
||||
|
||||
// Authenticated state is not lost during navigation: the tab bar (admitted)
|
||||
// is still present and the user is not re-gated.
|
||||
await expect(page.getByTestId('tab-home')).toBeVisible();
|
||||
expect(await app.isGated()).toBe(false);
|
||||
|
||||
// No frontend errors were produced during navigation.
|
||||
expect(errors, `Uncaught frontend errors: ${errors.join(' | ')}`).toEqual([]);
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
import { test as base, expect } from '@playwright/test';
|
||||
import { resetAll } from '../src/helpers/reset';
|
||||
|
||||
/**
|
||||
* Shared fixture: resets the demo rows the suite touches before every test, so
|
||||
* tests are self-contained and execution order never matters (spec §3).
|
||||
*
|
||||
* Multi-user tests use the built-in `browser` fixture to create isolated
|
||||
* `BrowserContext`s (one per user) so real-time behaviour is observed naturally
|
||||
* (spec §2, §40).
|
||||
*/
|
||||
type Fixtures = {
|
||||
/** Auto: reset state before the test. */
|
||||
reset: void;
|
||||
};
|
||||
|
||||
export const test = base.extend<Fixtures>({
|
||||
reset: [
|
||||
async ({}, use) => {
|
||||
resetAll();
|
||||
await use();
|
||||
},
|
||||
{ auto: true },
|
||||
],
|
||||
});
|
||||
|
||||
export { expect };
|
||||
@@ -0,0 +1,121 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { db } from '../src/helpers/db';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ScanPage } from '../src/pages/ScanPage';
|
||||
|
||||
/**
|
||||
* §8 Staff Welcome Check-In, §9 First-Time Attendee Access, §10 Real-Time
|
||||
* Welcome Check-In Activation.
|
||||
*/
|
||||
|
||||
test.describe('Welcome Check-In + attendee access', () => {
|
||||
test('CONV-CHECKIN-001 welcome check-in via QR (manual code) persists state', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.staff);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Staff mode + Welcome Check-In.
|
||||
await app.gotoTab('scan');
|
||||
await scan.setStaffMode();
|
||||
await scan.setWelcomeMode();
|
||||
|
||||
// Scan ATTENDEE_NEW (manual code = the QR payload).
|
||||
await scan.scanCode(ID.attendeeNew.qrToken);
|
||||
await expect(scan.welcomeResult()).toBeVisible();
|
||||
|
||||
// Backend state is persisted: ATTENDEE_NEW is now welcome-checked-in.
|
||||
expect(await db.waitForWelcomeCheckedIn(ID.attendeeNew.email)).toBe(true);
|
||||
});
|
||||
|
||||
test('CONV-CHECKIN-002 welcome check-in via manual code is equivalent to QR', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.staff);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('scan');
|
||||
await scan.setStaffMode();
|
||||
await scan.setWelcomeMode();
|
||||
|
||||
// Manual code input (the same token the QR would carry).
|
||||
await scan.scanCode(ID.attendeeNew.qrToken);
|
||||
await expect(scan.welcomeResult()).toBeVisible();
|
||||
|
||||
// Equivalent backend state: welcome-checked-in, no session check-in created.
|
||||
expect(await db.waitForWelcomeCheckedIn(ID.attendeeNew.email)).toBe(true);
|
||||
// Give the commit a moment, then confirm no session check-in was created.
|
||||
await new Promise((r) => setTimeout(r, 300));
|
||||
expect(db.sessionCheckins(ID.attendeeNew.email)).toEqual([]);
|
||||
});
|
||||
|
||||
test('CONV-ATT-AUTH-001 first-time attendee is gated before welcome check-in', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
|
||||
// ATTENDEE_NEW (never checked in) logs in.
|
||||
await login(page, APP_URL, ID.attendeeNew);
|
||||
|
||||
// The gate is shown; normal functionality is unavailable.
|
||||
await app.waitForGated();
|
||||
await expect(page.getByText(/Please see a staff member/)).toBeVisible();
|
||||
await expect(page.getByTestId('tab-home')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('CONV-ATT-AUTH-002 attendee activates automatically after staff welcome check-in (real-time)', async ({ browser }) => {
|
||||
// Two simultaneous contexts: the attendee stays open; the staff checks them in.
|
||||
const attendee = await createUser(browser, 'attendeeNew');
|
||||
const staff = await createUser(browser, 'staff');
|
||||
try {
|
||||
const aApp = new AppPage(attendee.page, APP_URL);
|
||||
const sApp = new AppPage(staff.page, APP_URL);
|
||||
const sScan = new ScanPage(staff.page);
|
||||
|
||||
// 1. The attendee logs in and is gated (waiting screen).
|
||||
await login(attendee.page, APP_URL, ID.attendeeNew);
|
||||
await aApp.waitForGated();
|
||||
|
||||
// 2. The staff (separate context) logs in and performs the welcome check-in.
|
||||
await login(staff.page, APP_URL, ID.staff);
|
||||
await sApp.waitForAdmitted();
|
||||
await sApp.gotoTab('scan');
|
||||
await sScan.setStaffMode();
|
||||
await sScan.setWelcomeMode();
|
||||
await sScan.scanCode(ID.attendeeNew.qrToken);
|
||||
await expect(sScan.welcomeResult()).toBeVisible();
|
||||
|
||||
// 3. The attendee's open browser lifts the gate automatically (4s poll) —
|
||||
// no refresh, no restart, no re-login.
|
||||
await aApp.waitForAdmitted();
|
||||
await expect(await aApp.isGated()).toBe(false);
|
||||
|
||||
// Home/application content becomes available.
|
||||
await expect(attendee.page.getByTestId('tab-home')).toBeVisible();
|
||||
} finally {
|
||||
await attendee.close();
|
||||
await staff.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-ATT-AUTH-003 returning attendee is not re-gated on re-login', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
|
||||
// ATTENDEE_RETURNING (previously checked in) logs in → admitted directly.
|
||||
await login(page, APP_URL, ID.attendeeReturning);
|
||||
await app.waitForAdmitted();
|
||||
await expect(await app.isGated()).toBe(false);
|
||||
|
||||
// Log out, then log in again → still admitted (no staff intervention).
|
||||
await app.gotoTab('profile');
|
||||
await page.getByTestId('profile-logout').click();
|
||||
await page.getByTestId('login-splash').waitFor({ state: 'visible' });
|
||||
|
||||
await login(page, APP_URL, ID.attendeeReturning);
|
||||
await app.waitForAdmitted();
|
||||
await expect(await app.isGated()).toBe(false);
|
||||
await expect(page.getByText(/Please see a staff member/)).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,372 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { signInJwt, userRpc } from '../src/helpers/api';
|
||||
import { db, psql, sqlQuote } from '../src/helpers/db';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ScanPage } from '../src/pages/ScanPage';
|
||||
import { ConnectionsPage } from '../src/pages/ConnectionsPage';
|
||||
|
||||
/**
|
||||
* §13–§20 Connections.
|
||||
*
|
||||
* The connection flow: a user scans a peer's lanyard (manual code = the QR
|
||||
* payload) → the connect sheet → "Connect" → `create_connection_request`. The
|
||||
* recipient sees it under Requests → Incoming and Accepts/Declines.
|
||||
*/
|
||||
|
||||
test.describe('Connections', () => {
|
||||
test('CONV-CONN-001 connection request by scanning a peer (QR)', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
const conns = new ConnectionsPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Scan ATTENDEE_B's lanyard (manual code = the QR payload) and request.
|
||||
await app.gotoTab('scan');
|
||||
await scan.setAttendeeMode();
|
||||
await scan.scanCode(ID.attendeeB.qrToken);
|
||||
await scan.sendConnection();
|
||||
|
||||
// A sees B as a pending (outgoing) request.
|
||||
await conns.gotoRequests();
|
||||
expect(await conns.outgoingContains('Jonas Unger')).toBe(true);
|
||||
|
||||
// B must NOT yet appear as an established connection.
|
||||
await conns.gotoMine();
|
||||
expect(await conns.mineContains('Jonas Unger')).toBe(false);
|
||||
|
||||
// Backend: a pending connection row exists (A → B).
|
||||
const rows = db.connections(ID.attendeeA.email);
|
||||
expect(rows.some((r) => r.status === 'pending' && r.to === ID.attendeeB.email)).toBe(true);
|
||||
});
|
||||
|
||||
test('CONV-CONN-002 connection request by manual code is equivalent to QR', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
const conns = new ConnectionsPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('scan');
|
||||
await scan.setAttendeeMode();
|
||||
|
||||
// Manual code input (the same token the QR would carry).
|
||||
await scan.scanCode(ID.attendeeB.qrToken);
|
||||
await scan.sendConnection();
|
||||
|
||||
// Pending state behaves exactly as with QR scanning.
|
||||
await conns.gotoRequests();
|
||||
expect(await conns.outgoingContains('Jonas Unger')).toBe(true);
|
||||
await conns.gotoMine();
|
||||
expect(await conns.mineContains('Jonas Unger')).toBe(false);
|
||||
|
||||
// Backend: pending A → B.
|
||||
const rows = db.connections(ID.attendeeA.email);
|
||||
expect(rows.some((r) => r.status === 'pending' && r.to === ID.attendeeB.email)).toBe(true);
|
||||
});
|
||||
|
||||
test('CONV-CONN-003 recipient sees the incoming request with Accept/Decline', async ({ browser }) => {
|
||||
const a = await createUser(browser, 'attendeeA');
|
||||
const b = await createUser(browser, 'attendeeB');
|
||||
try {
|
||||
const aApp = new AppPage(a.page, APP_URL);
|
||||
const aScan = new ScanPage(a.page);
|
||||
const bApp = new AppPage(b.page, APP_URL);
|
||||
const bConns = new ConnectionsPage(b.page);
|
||||
|
||||
// A sends a request to B.
|
||||
await login(a.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('scan');
|
||||
await aScan.setAttendeeMode();
|
||||
await aScan.scanCode(ID.attendeeB.qrToken);
|
||||
await aScan.sendConnection();
|
||||
|
||||
// B sees A as an incoming request with Accept + Decline actions.
|
||||
await login(b.page, APP_URL, ID.attendeeB);
|
||||
await bApp.waitForAdmitted();
|
||||
await bConns.gotoRequests();
|
||||
await expect(b.page.getByText('Mia Moser', { exact: true })).toBeVisible();
|
||||
await expect(b.page.getByTestId('connection-accept')).toBeVisible();
|
||||
await expect(b.page.getByTestId('connection-decline')).toBeVisible();
|
||||
|
||||
// A still sees the request as pending (outgoing) until B responds.
|
||||
const aConns = new ConnectionsPage(a.page);
|
||||
await aConns.gotoRequests();
|
||||
expect(await aConns.outgoingContains('Jonas Unger')).toBe(true);
|
||||
} finally {
|
||||
await a.close();
|
||||
await b.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-CONN-004 recipient accepts → established connection both ways', async ({ browser }) => {
|
||||
const a = await createUser(browser, 'attendeeA');
|
||||
const b = await createUser(browser, 'attendeeB');
|
||||
try {
|
||||
const aApp = new AppPage(a.page, APP_URL);
|
||||
const aScan = new ScanPage(a.page);
|
||||
const aConns = new ConnectionsPage(a.page);
|
||||
const bApp = new AppPage(b.page, APP_URL);
|
||||
const bConns = new ConnectionsPage(b.page);
|
||||
|
||||
// A sends to B.
|
||||
await login(a.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('scan');
|
||||
await aScan.setAttendeeMode();
|
||||
await aScan.scanCode(ID.attendeeB.qrToken);
|
||||
await aScan.sendConnection();
|
||||
|
||||
// B accepts.
|
||||
await login(b.page, APP_URL, ID.attendeeB);
|
||||
await bApp.waitForAdmitted();
|
||||
await bConns.gotoRequests();
|
||||
await bConns.accept();
|
||||
|
||||
// Both see each other in "My connections".
|
||||
await bConns.gotoMine();
|
||||
expect(await bConns.mineContains('Mia Moser')).toBe(true);
|
||||
await aConns.gotoMine();
|
||||
expect(await aConns.mineContains('Jonas Unger')).toBe(true);
|
||||
|
||||
// The pending request is no longer actionable.
|
||||
await bConns.gotoRequests();
|
||||
expect(await bConns.incomingContains('Mia Moser')).toBe(false);
|
||||
|
||||
// Backend: an accepted connection row exists.
|
||||
const rows = db.connections(ID.attendeeA.email);
|
||||
expect(rows.some((r) => r.status === 'accepted' && r.to === ID.attendeeB.email)).toBe(true);
|
||||
} finally {
|
||||
await a.close();
|
||||
await b.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-CONN-005 recipient declines → no connection is created', async ({ browser }) => {
|
||||
const a = await createUser(browser, 'attendeeA');
|
||||
const b = await createUser(browser, 'attendeeB');
|
||||
try {
|
||||
const aApp = new AppPage(a.page, APP_URL);
|
||||
const aScan = new ScanPage(a.page);
|
||||
const aConns = new ConnectionsPage(a.page);
|
||||
const bApp = new AppPage(b.page, APP_URL);
|
||||
const bConns = new ConnectionsPage(b.page);
|
||||
|
||||
// A sends to B.
|
||||
await login(a.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('scan');
|
||||
await aScan.setAttendeeMode();
|
||||
await aScan.scanCode(ID.attendeeB.qrToken);
|
||||
await aScan.sendConnection();
|
||||
|
||||
// B declines.
|
||||
await login(b.page, APP_URL, ID.attendeeB);
|
||||
await bApp.waitForAdmitted();
|
||||
await bConns.gotoRequests();
|
||||
await bConns.decline();
|
||||
|
||||
// No connection is created; the request is removed from actionable incoming.
|
||||
await bConns.gotoRequests();
|
||||
expect(await bConns.incomingContains('Mia Moser')).toBe(false);
|
||||
// A must not see B as an established connection.
|
||||
await aConns.gotoMine();
|
||||
expect(await aConns.mineContains('Jonas Unger')).toBe(false);
|
||||
|
||||
// Backend: no accepted connection row.
|
||||
const rows = db.connections(ID.attendeeA.email);
|
||||
expect(rows.some((r) => r.status === 'accepted')).toBe(false);
|
||||
} finally {
|
||||
await a.close();
|
||||
await b.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-CONN-006 the Connections area correctly distinguishes the three states', async ({ page }) => {
|
||||
const conns = new ConnectionsPage(page);
|
||||
|
||||
// Set up A's three states via the backend (as the relevant users):
|
||||
// A ↔ B accepted (established), A → C pending (outgoing), D → A pending (incoming).
|
||||
const aJwt = await signInJwt(ID.attendeeA.email, ID.attendeeA.qrToken);
|
||||
const bJwt = await signInJwt(ID.attendeeB.email, ID.attendeeB.qrToken);
|
||||
const cJwt = await signInJwt(ID.attendeeC.email, ID.attendeeC.qrToken);
|
||||
const dJwt = await signInJwt(ID.attendeeD.email, ID.attendeeD.qrToken);
|
||||
|
||||
// A → B (then B accepts).
|
||||
await userRpc(aJwt, 'create_connection_request', { p_target_qr: ID.attendeeB.qrToken });
|
||||
// accept_connection needs the connection id; fetch it.
|
||||
const abId = psql(
|
||||
`select id from public.connections where from_email = ${sqlQuote(ID.attendeeA.email)} and to_email = ${sqlQuote(ID.attendeeB.email)} limit 1`,
|
||||
);
|
||||
await userRpc(bJwt, 'accept_connection', { p_connection_id: abId });
|
||||
|
||||
// A → C (pending, outgoing).
|
||||
await userRpc(aJwt, 'create_connection_request', { p_target_qr: ID.attendeeC.qrToken });
|
||||
// D → A (pending, incoming to A).
|
||||
await userRpc(dJwt, 'create_connection_request', { p_target_qr: ID.attendeeA.qrToken });
|
||||
|
||||
// Now verify the UI separates the three states for A.
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await conns.gotoMine();
|
||||
// Established: B (Jonas) is in My connections.
|
||||
expect(await conns.mineContains('Jonas Unger')).toBe(true);
|
||||
// Outgoing + incoming are NOT in My connections.
|
||||
expect(await conns.mineContains('Emma Dorfer')).toBe(false);
|
||||
expect(await conns.mineContains('Paul Klein')).toBe(false);
|
||||
|
||||
await conns.gotoRequests();
|
||||
// Outgoing (Sent): C (Emma).
|
||||
expect(await conns.outgoingContains('Emma Dorfer')).toBe(true);
|
||||
// Incoming: D (Paul).
|
||||
expect(await conns.incomingContains('Paul Klein')).toBe(true);
|
||||
// The established B is NOT in Requests.
|
||||
expect(await conns.incomingContains('Jonas Unger')).toBe(false);
|
||||
expect(await conns.outgoingContains('Jonas Unger')).toBe(false);
|
||||
});
|
||||
|
||||
test('CONV-CONN-007 staff can send, receive, accept, and decline connection requests', async ({ browser }) => {
|
||||
const staff = await createUser(browser, 'staff');
|
||||
const mia = await createUser(browser, 'attendeeA');
|
||||
const jonas = await createUser(browser, 'attendeeB');
|
||||
const emma = await createUser(browser, 'attendeeC');
|
||||
try {
|
||||
const sApp = new AppPage(staff.page, APP_URL);
|
||||
const sScan = new ScanPage(staff.page);
|
||||
const sConns = new ConnectionsPage(staff.page);
|
||||
const mApp = new AppPage(mia.page, APP_URL);
|
||||
const mConns = new ConnectionsPage(mia.page);
|
||||
const jApp = new AppPage(jonas.page, APP_URL);
|
||||
const jScan = new ScanPage(jonas.page);
|
||||
const eApp = new AppPage(emma.page, APP_URL);
|
||||
const eScan = new ScanPage(emma.page);
|
||||
|
||||
// 1. Staff sends a connection request to Mia.
|
||||
await login(staff.page, APP_URL, ID.staff);
|
||||
await sApp.waitForAdmitted();
|
||||
await sApp.gotoTab('scan');
|
||||
await sScan.setAttendeeMode();
|
||||
await sScan.scanCode(ID.attendeeA.qrToken);
|
||||
await sScan.sendConnection();
|
||||
|
||||
// 2. Mia accepts.
|
||||
await login(mia.page, APP_URL, ID.attendeeA);
|
||||
await mApp.waitForAdmitted();
|
||||
await mConns.gotoRequests();
|
||||
await mConns.accept();
|
||||
|
||||
// 3. Verify the connection both ways.
|
||||
await mConns.gotoMine();
|
||||
expect(await mConns.mineContains('Jose Lago')).toBe(true);
|
||||
await sConns.gotoMine();
|
||||
expect(await sConns.mineContains('Mia Moser')).toBe(true);
|
||||
|
||||
// 4. Jonas (a different attendee) sends the staff a request; the staff accepts.
|
||||
await login(jonas.page, APP_URL, ID.attendeeB);
|
||||
await jApp.waitForAdmitted();
|
||||
await jApp.gotoTab('scan');
|
||||
await jScan.setAttendeeMode();
|
||||
await jScan.scanCode(ID.staff.qrToken);
|
||||
await jScan.sendConnection();
|
||||
await sConns.gotoRequests();
|
||||
await sConns.accept();
|
||||
|
||||
// 5. The staff–Jonas connection is established both ways.
|
||||
await sConns.gotoMine();
|
||||
expect(await sConns.mineContains('Jonas Unger')).toBe(true);
|
||||
await jApp.gotoTab('connections');
|
||||
const jConns = new ConnectionsPage(jonas.page);
|
||||
await jConns.gotoMine();
|
||||
expect(await jConns.mineContains('Jose Lago')).toBe(true);
|
||||
|
||||
// 6. Emma sends the staff a request; the staff declines → no connection.
|
||||
await login(emma.page, APP_URL, ID.attendeeC);
|
||||
await eApp.waitForAdmitted();
|
||||
await eApp.gotoTab('scan');
|
||||
await eScan.setAttendeeMode();
|
||||
await eScan.scanCode(ID.staff.qrToken);
|
||||
await eScan.sendConnection();
|
||||
await sConns.gotoRequests();
|
||||
await sConns.decline();
|
||||
|
||||
// 7. Emma is NOT in the staff's established connections.
|
||||
await sConns.gotoMine();
|
||||
expect(await sConns.mineContains('Emma Dorfer')).toBe(false);
|
||||
} finally {
|
||||
await staff.close();
|
||||
await mia.close();
|
||||
await jonas.close();
|
||||
await emma.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-CONN-008 networking works across roles (staff, attendee, speaker, sponsor)', async ({ browser }) => {
|
||||
// Representative cross-role pairs covering all four roles:
|
||||
// speaker → attendee, and sponsor → attendee.
|
||||
// (Staff networking is covered by CONV-CONN-007.)
|
||||
const spk = await createUser(browser, 'speaker');
|
||||
const spo = await createUser(browser, 'sponsor');
|
||||
const att = await createUser(browser, 'attendeeB');
|
||||
try {
|
||||
const sApp = new AppPage(spk.page, APP_URL);
|
||||
const sScan = new ScanPage(spk.page);
|
||||
const sConns = new ConnectionsPage(spk.page);
|
||||
const oApp = new AppPage(spo.page, APP_URL);
|
||||
const oScan = new ScanPage(spo.page);
|
||||
const oConns = new ConnectionsPage(spo.page);
|
||||
const aApp = new AppPage(att.page, APP_URL);
|
||||
const aConns = new ConnectionsPage(att.page);
|
||||
|
||||
// Speaker sends to attendee.
|
||||
await login(spk.page, APP_URL, ID.speaker);
|
||||
await sApp.waitForAdmitted();
|
||||
await sApp.gotoTab('scan');
|
||||
await sScan.setAttendeeMode();
|
||||
await sScan.scanCode(ID.attendeeB.qrToken);
|
||||
await sScan.sendConnection();
|
||||
|
||||
// Sponsor sends to the same attendee.
|
||||
await login(spo.page, APP_URL, ID.sponsor);
|
||||
await oApp.waitForAdmitted();
|
||||
await oApp.gotoTab('scan');
|
||||
await oScan.setAttendeeMode();
|
||||
await oScan.scanCode(ID.attendeeB.qrToken);
|
||||
await oScan.sendConnection();
|
||||
|
||||
// Attendee accepts both (two incoming requests → accept one at a time).
|
||||
await login(att.page, APP_URL, ID.attendeeB);
|
||||
await aApp.waitForAdmitted();
|
||||
await aConns.gotoRequests();
|
||||
await att.page.getByTestId('connection-accept').first().click();
|
||||
await aConns.gotoRequests();
|
||||
await att.page.getByTestId('connection-accept').first().click();
|
||||
|
||||
// Both see the established connections.
|
||||
await aConns.gotoMine();
|
||||
expect(await aConns.mineContains('Duncan Boyne')).toBe(true);
|
||||
expect(await aConns.mineContains('Demo Sponsor')).toBe(true);
|
||||
// Force the speaker's + sponsor's Connections screens to re-fetch (they
|
||||
// were already mounted, so navigate away + back to trigger a fresh load).
|
||||
await sApp.gotoTab('home');
|
||||
await sConns.gotoMine();
|
||||
expect(await sConns.mineContains('Jonas Unger')).toBe(true);
|
||||
await oApp.gotoTab('home');
|
||||
await oConns.gotoMine();
|
||||
expect(await oConns.mineContains('Jonas Unger')).toBe(true);
|
||||
|
||||
// Backend: accepted cross-role connections exist (speaker + sponsor).
|
||||
const spkRows = db.connections(ID.speaker.email);
|
||||
expect(spkRows.some((r) => r.status === 'accepted' && r.to === ID.attendeeB.email)).toBe(true);
|
||||
const spoRows = db.connections(ID.sponsor.email);
|
||||
expect(spoRows.some((r) => r.status === 'accepted' && r.to === ID.attendeeB.email)).toBe(true);
|
||||
} finally {
|
||||
await spk.close();
|
||||
await spo.close();
|
||||
await att.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,313 @@
|
||||
import path from 'node:path';
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID, SESSION_A, SESSION_B } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { signInJwt, userRpcResult } from '../src/helpers/api';
|
||||
import { db } from '../src/helpers/db';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ScanPage } from '../src/pages/ScanPage';
|
||||
import { ConnectionsPage } from '../src/pages/ConnectionsPage';
|
||||
import { AgendaPage } from '../src/pages/AgendaPage';
|
||||
import { HomePage } from '../src/pages/HomePage';
|
||||
import { FeedbackPage } from '../src/pages/FeedbackPage';
|
||||
|
||||
/**
|
||||
* §38 End-to-end journeys + §39 Role security matrix.
|
||||
*
|
||||
* CONV-E2E-001: First-time attendee complete journey (3 contexts).
|
||||
* CONV-E2E-002: Speaker journey (login → pending material → upload → done).
|
||||
* Role security matrix: backend authorization checks across roles.
|
||||
*/
|
||||
|
||||
/** The speaker's session title (slot 1). */
|
||||
const SPEAKER_SESSION_TITLE = 'From Vision to Reality';
|
||||
/** SESSION_B title (slot 2, "now" — not done). */
|
||||
const SESSION_B_TITLE = '10 Essential tips to kickstart Power Platform Governance';
|
||||
|
||||
/** A small, valid test file for the material upload. */
|
||||
const MATERIAL_FILE = path.join(__dirname, '..', 'fixtures', 'material.txt');
|
||||
|
||||
/** Poll until a session has material (robust against commit timing). */
|
||||
async function waitForMaterial(sessionId: string, timeoutMs = 5000): Promise<boolean> {
|
||||
const deadline = Date.now() + timeoutMs;
|
||||
for (;;) {
|
||||
if (db.sessionHasMaterial(sessionId)) return true;
|
||||
if (Date.now() > deadline) return db.sessionHasMaterial(sessionId);
|
||||
await new Promise((r) => setTimeout(r, 200));
|
||||
}
|
||||
}
|
||||
|
||||
test.describe('E2E Journeys', () => {
|
||||
test('CONV-E2E-001 first-time attendee complete journey', async ({ browser }) => {
|
||||
// Three isolated contexts: the new attendee, the staff, and a second
|
||||
// attendee (ATTENDEE_B) for the connection sub-journey.
|
||||
const attendee = await createUser(browser, 'attendeeNew');
|
||||
const staff = await createUser(browser, 'staff');
|
||||
const other = await createUser(browser, 'attendeeB');
|
||||
try {
|
||||
const aApp = new AppPage(attendee.page, APP_URL);
|
||||
const aScan = new ScanPage(attendee.page);
|
||||
const aConns = new ConnectionsPage(attendee.page);
|
||||
const aAgenda = new AgendaPage(attendee.page);
|
||||
const sApp = new AppPage(staff.page, APP_URL);
|
||||
const sScan = new ScanPage(staff.page);
|
||||
const oApp = new AppPage(other.page, APP_URL);
|
||||
const oConns = new ConnectionsPage(other.page);
|
||||
|
||||
// 1–2. The new attendee logs in and is gated (waiting screen).
|
||||
await login(attendee.page, APP_URL, ID.attendeeNew);
|
||||
await aApp.waitForGated();
|
||||
await expect(attendee.page.getByText(/Please see a staff member/)).toBeVisible();
|
||||
await expect(attendee.page.getByTestId('tab-home')).toHaveCount(0);
|
||||
|
||||
// 3–6. The staff (separate context) logs in and performs the welcome check-in.
|
||||
await login(staff.page, APP_URL, ID.staff);
|
||||
await sApp.waitForAdmitted();
|
||||
await sApp.gotoTab('scan');
|
||||
await sScan.setStaffMode();
|
||||
await sScan.setWelcomeMode();
|
||||
await sScan.scanCode(ID.attendeeNew.qrToken);
|
||||
await expect(sScan.welcomeResult()).toBeVisible();
|
||||
|
||||
// Backend: the attendee is now welcome-checked-in.
|
||||
expect(await db.waitForWelcomeCheckedIn(ID.attendeeNew.email)).toBe(true);
|
||||
|
||||
// Dismiss the welcome result sheet so it doesn't intercept later clicks.
|
||||
await sScan.dismissResult();
|
||||
|
||||
// 7. The attendee's open browser lifts the gate automatically (4s poll) —
|
||||
// no refresh, no restart, no re-login.
|
||||
await aApp.waitForAdmitted();
|
||||
await expect(await aApp.isGated()).toBe(false);
|
||||
|
||||
// 8–11. The app is fully usable: Home, Agenda, Connections, Profile.
|
||||
const home = new HomePage(attendee.page);
|
||||
await expect(home.greeting()).toBeVisible();
|
||||
await expect(attendee.page.getByTestId('tab-home')).toBeVisible();
|
||||
await aApp.gotoTab('agenda');
|
||||
await expect(aApp.eventTitle()).toBeVisible();
|
||||
await aApp.gotoTab('connections');
|
||||
await expect(attendee.page.getByTestId('connections-tab-mine')).toBeVisible();
|
||||
await aApp.gotoTab('profile');
|
||||
await expect(attendee.page.getByTestId('profile-save')).toBeVisible();
|
||||
|
||||
// 12–14. ATTENDEE_NEW scans ATTENDEE_B and sends a connection request.
|
||||
await aApp.gotoTab('scan');
|
||||
await aScan.setAttendeeMode();
|
||||
await aScan.scanCode(ID.attendeeB.qrToken);
|
||||
await aScan.sendConnection();
|
||||
await aConns.gotoRequests();
|
||||
expect(await aConns.outgoingContains('Jonas Unger')).toBe(true);
|
||||
|
||||
// 15–17. ATTENDEE_B observes the incoming request and accepts it.
|
||||
await login(other.page, APP_URL, ID.attendeeB);
|
||||
await oApp.waitForAdmitted();
|
||||
await oConns.gotoRequests();
|
||||
await oConns.accept();
|
||||
|
||||
// 18–19. The established connection is visible from both parties.
|
||||
await oConns.gotoMine();
|
||||
expect(await oConns.mineContains('Lena Huber')).toBe(true);
|
||||
// Force the attendee's Connections screen to re-fetch (it was already
|
||||
// mounted, so navigate away + back to trigger a fresh load).
|
||||
await aApp.gotoTab('home');
|
||||
await aConns.gotoMine();
|
||||
expect(await aConns.mineContains('Jonas Unger')).toBe(true);
|
||||
|
||||
// 20–22. STAFF_01 selects SESSION_A and checks ATTENDEE_NEW into it.
|
||||
await sApp.gotoTab('scan');
|
||||
await sScan.setSessionMode();
|
||||
await sScan.selectSession(SESSION_A);
|
||||
await sScan.scanCode(ID.attendeeNew.qrToken);
|
||||
await expect(sScan.sessionResult()).toBeVisible();
|
||||
// Backend: SESSION_A attendance is persisted.
|
||||
expect(await db.waitForSessionCheckin(ID.attendeeNew.email, SESSION_A)).toBe(true);
|
||||
|
||||
// 23–24. SESSION_A feedback becomes available; SESSION_B remains unavailable.
|
||||
await aApp.gotoTab('agenda');
|
||||
await aAgenda.openSession('From Vision to Reality');
|
||||
await expect(aAgenda.giveFeedbackButton()).toBeVisible();
|
||||
await attendee.page.getByRole('button', { name: '✕' }).click();
|
||||
await aAgenda.openSession(SESSION_B_TITLE);
|
||||
await expect(aAgenda.giveFeedbackButton()).toHaveCount(0);
|
||||
await attendee.page.getByRole('button', { name: '✕' }).click();
|
||||
|
||||
// 25–27. Navigate away, then return: SESSION_A feedback is still available.
|
||||
await aApp.gotoTab('home');
|
||||
await aApp.gotoTab('agenda');
|
||||
await aAgenda.openSession('From Vision to Reality');
|
||||
await expect(aAgenda.giveFeedbackButton()).toBeVisible();
|
||||
|
||||
// 28. Submit SESSION_A feedback.
|
||||
await aAgenda.giveFeedbackButton().click();
|
||||
const feedback = new FeedbackPage(attendee.page);
|
||||
await feedback.rate(5);
|
||||
await feedback.setComment('Great journey!');
|
||||
await feedback.submit();
|
||||
// Backend: the feedback is persisted for (ATTENDEE_NEW, SESSION_A).
|
||||
const fbRows = db.feedback(ID.attendeeNew.email);
|
||||
expect(fbRows.some((r) => r.sessionId === SESSION_A)).toBe(true);
|
||||
|
||||
// 29–32. Logout, log in again: Welcome Check-In is not requested again,
|
||||
// and normal functionality remains available.
|
||||
await aApp.gotoTab('profile');
|
||||
await attendee.page.getByTestId('profile-logout').click();
|
||||
await attendee.page.getByTestId('login-splash').waitFor({ state: 'visible' });
|
||||
await login(attendee.page, APP_URL, ID.attendeeNew);
|
||||
await aApp.waitForAdmitted();
|
||||
await expect(await aApp.isGated()).toBe(false);
|
||||
await expect(attendee.page.getByText(/Please see a staff member/)).toHaveCount(0);
|
||||
await expect(home.greeting()).toBeVisible();
|
||||
} finally {
|
||||
await attendee.close();
|
||||
await staff.close();
|
||||
await other.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-E2E-002 speaker journey: login → material → networking → participant functionality', async ({ browser }) => {
|
||||
// Two contexts: the speaker and an attendee (for the networking sub-journey).
|
||||
const speaker = await createUser(browser, 'speaker');
|
||||
const attendee = await createUser(browser, 'attendeeA');
|
||||
try {
|
||||
const app = new AppPage(speaker.page, APP_URL);
|
||||
const scan = new ScanPage(speaker.page);
|
||||
const conns = new ConnectionsPage(speaker.page);
|
||||
const agenda = new AgendaPage(speaker.page);
|
||||
const aApp = new AppPage(attendee.page, APP_URL);
|
||||
const aConns = new ConnectionsPage(attendee.page);
|
||||
|
||||
// 1. The speaker logs in and is admitted.
|
||||
await login(speaker.page, APP_URL, ID.speaker);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// 2. The pending-material pill is visible (the speaker's session has no material).
|
||||
const home = new HomePage(speaker.page);
|
||||
await expect(home.materialPill()).toBeVisible();
|
||||
|
||||
// 3. Open the session in the Agenda — the upload notice is visible.
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
await expect(agenda.materialUploadInput()).toBeVisible();
|
||||
|
||||
// 4. Upload the material.
|
||||
await agenda.uploadMaterial(MATERIAL_FILE);
|
||||
|
||||
// 5. Backend: the session now has material.
|
||||
expect(await waitForMaterial(SESSION_A)).toBe(true);
|
||||
|
||||
// 6. Reload so the app picks up the updated session data, then verify
|
||||
// the "Download material" link is visible.
|
||||
await speaker.page.reload({ waitUntil: 'domcontentloaded' });
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
await expect(speaker.page.getByText(/Download material/)).toBeVisible();
|
||||
// Close the session sheet.
|
||||
await speaker.page.getByRole('button', { name: '✕' }).click();
|
||||
|
||||
// 7. Verify normal participant functionality: Agenda + Profile.
|
||||
await app.gotoTab('profile');
|
||||
await expect(speaker.page.getByTestId('profile-save')).toBeVisible();
|
||||
|
||||
// 8. Send a connection request to an attendee (speaker networking).
|
||||
await app.gotoTab('scan');
|
||||
await scan.setAttendeeMode();
|
||||
await scan.scanCode(ID.attendeeA.qrToken);
|
||||
await scan.sendConnection();
|
||||
await conns.gotoRequests();
|
||||
expect(await conns.outgoingContains('Mia Moser')).toBe(true);
|
||||
|
||||
// 9. The attendee sees the incoming request and accepts it.
|
||||
await login(attendee.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aConns.gotoRequests();
|
||||
await aConns.accept();
|
||||
|
||||
// 10. The connection is established both ways.
|
||||
await aConns.gotoMine();
|
||||
expect(await aConns.mineContains('Duncan Boyne')).toBe(true);
|
||||
// Force the speaker's Connections screen to re-fetch (it was already
|
||||
// mounted, so navigate away + back to trigger a fresh load).
|
||||
await app.gotoTab('home');
|
||||
await conns.gotoMine();
|
||||
expect(await conns.mineContains('Mia Moser')).toBe(true);
|
||||
|
||||
// 11. The speaker remains able to use all normal participant functionality.
|
||||
await app.gotoTab('agenda');
|
||||
await expect(app.eventTitle()).toBeVisible();
|
||||
await app.gotoTab('profile');
|
||||
await expect(speaker.page.getByTestId('profile-save')).toBeVisible();
|
||||
} finally {
|
||||
await speaker.close();
|
||||
await attendee.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Role Security Matrix (§39)', () => {
|
||||
test('welcome_checkin: only staff can call (non-staff → error)', async () => {
|
||||
// Staff can call welcome_checkin (takes the attendee's QR token).
|
||||
const staffJwt = await signInJwt(ID.staff.email, ID.staff.password!);
|
||||
const staffResult = await userRpcResult(staffJwt, 'welcome_checkin', {
|
||||
p_attendee_qr: ID.attendeeNew.qrToken,
|
||||
});
|
||||
expect(staffResult.ok).toBe(true);
|
||||
|
||||
// A non-staff attendee cannot call welcome_checkin.
|
||||
const attendeeJwt = await signInJwt(ID.attendeeA.email, ID.attendeeA.qrToken);
|
||||
const attendeeResult = await userRpcResult(attendeeJwt, 'welcome_checkin', {
|
||||
p_attendee_qr: ID.attendeeB.qrToken,
|
||||
});
|
||||
expect(attendeeResult.ok).toBe(false);
|
||||
});
|
||||
|
||||
test('checkin_attendee: only staff can call (non-staff → error)', async () => {
|
||||
// Staff can call checkin_attendee (session check-in; takes QR + session).
|
||||
const staffJwt = await signInJwt(ID.staff.email, ID.staff.password!);
|
||||
const staffResult = await userRpcResult(staffJwt, 'checkin_attendee', {
|
||||
p_attendee_qr: ID.attendeeA.qrToken,
|
||||
p_session_id: SESSION_A,
|
||||
});
|
||||
expect(staffResult.ok).toBe(true);
|
||||
|
||||
// A non-staff attendee cannot call checkin_attendee.
|
||||
const attendeeJwt = await signInJwt(ID.attendeeB.email, ID.attendeeB.qrToken);
|
||||
const attendeeResult = await userRpcResult(attendeeJwt, 'checkin_attendee', {
|
||||
p_attendee_qr: ID.attendeeC.qrToken,
|
||||
p_session_id: SESSION_A,
|
||||
});
|
||||
expect(attendeeResult.ok).toBe(false);
|
||||
});
|
||||
|
||||
test('set_session_material: only speaker/admin can call (attendee → error)', async () => {
|
||||
// The speaker can call set_session_material for their own session.
|
||||
const speakerJwt = await signInJwt(ID.speaker.email, ID.speaker.qrToken);
|
||||
const speakerResult = await userRpcResult(speakerJwt, 'set_session_material', {
|
||||
p_session_id: SESSION_A,
|
||||
p_material_path: 'sessions/test/security-matrix.txt',
|
||||
});
|
||||
expect(speakerResult.ok).toBe(true);
|
||||
|
||||
// An attendee cannot call set_session_material.
|
||||
const attendeeJwt = await signInJwt(ID.attendeeA.email, ID.attendeeA.qrToken);
|
||||
const attendeeResult = await userRpcResult(attendeeJwt, 'set_session_material', {
|
||||
p_session_id: SESSION_A,
|
||||
p_material_path: 'sessions/test/attendee-should-fail.txt',
|
||||
});
|
||||
expect(attendeeResult.ok).toBe(false);
|
||||
});
|
||||
|
||||
test('submit_feedback: only for attended sessions (not checked in → error)', async () => {
|
||||
// An attendee who is NOT checked in to SESSION_A cannot submit feedback.
|
||||
const attendeeJwt = await signInJwt(ID.attendeeD.email, ID.attendeeD.qrToken);
|
||||
const result = await userRpcResult(attendeeJwt, 'submit_feedback', {
|
||||
p_session_id: SESSION_A,
|
||||
p_rating: 5,
|
||||
p_comment: 'Security matrix test',
|
||||
});
|
||||
expect(result.ok).toBe(false);
|
||||
expect(result.message).toMatch(/checked in/i);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,244 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID, SESSION_A, SESSION_B, EVENT_ID } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { signInJwt, userRpcResult } from '../src/helpers/api';
|
||||
import { db, psql } from '../src/helpers/db';
|
||||
import { setSessionCheckin } from '../src/helpers/reset';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ScanPage } from '../src/pages/ScanPage';
|
||||
import { AgendaPage } from '../src/pages/AgendaPage';
|
||||
import { HomePage } from '../src/pages/HomePage';
|
||||
import { FeedbackPage } from '../src/pages/FeedbackPage';
|
||||
|
||||
/**
|
||||
* §29 Feedback.
|
||||
*
|
||||
* Feedback is available only for a session that is (a) done and (b) the user
|
||||
* was checked into. The `give-feedback` button in the Agenda session sheet is
|
||||
* shown when `selStatus === 'done' && selCheckedIn`. The backend RPC
|
||||
* `submit_feedback` raises if the caller is not checked in to the session.
|
||||
*
|
||||
* Points: 10 with a comment, 5 without, 0 on resubmit (updates existing row).
|
||||
*
|
||||
* SESSION_A — slot 1 (09:15–10:00, "done" at the simulated 10:20 clock).
|
||||
* SESSION_B — slot 2 (10:15–11:00, "now" — not done).
|
||||
*/
|
||||
|
||||
/** SESSION_A title (for opening the session sheet). */
|
||||
const SESSION_A_TITLE = 'From Vision to Reality';
|
||||
/** SESSION_B title (for opening the session sheet). */
|
||||
const SESSION_B_TITLE = '10 Essential tips to kickstart Power Platform Governance';
|
||||
|
||||
/** The full feedback row for a contact + session (event_id|contact_email|session_id|rating). */
|
||||
function feedbackRow(contactEmail: string, sessionId: string): string {
|
||||
return psql(
|
||||
`select event_id || '|' || contact_email || '|' || session_id || '|' || rating
|
||||
from public.feedback where contact_email = '${contactEmail.replace(/'/g, "''")}' and session_id = '${sessionId}' limit 1`,
|
||||
);
|
||||
}
|
||||
|
||||
/** The number of feedback rows a contact has for a session. */
|
||||
function feedbackRowCount(contactEmail: string, sessionId: string): number {
|
||||
const n = psql(
|
||||
`select count(*) from public.feedback where contact_email = '${contactEmail.replace(/'/g, "''")}' and session_id = '${sessionId}'`,
|
||||
);
|
||||
return Number(n);
|
||||
}
|
||||
|
||||
test.describe('Feedback', () => {
|
||||
test('CONV-FEEDBACK-001 feedback unavailable for unattended session', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
|
||||
// ATTENDEE_A is NOT checked into SESSION_A (reset clears all check-ins).
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Frontend: the "Give feedback" button is absent; the "not checked in"
|
||||
// notice is shown instead (SESSION_A is done but the user wasn't there).
|
||||
await app.gotoTab('agenda');
|
||||
const agenda = new AgendaPage(page);
|
||||
await agenda.openSession(SESSION_A_TITLE);
|
||||
await expect(agenda.giveFeedbackButton()).toHaveCount(0);
|
||||
await expect(agenda.notCheckedInNotice()).toBeVisible();
|
||||
|
||||
// Backend: submit_feedback raises (the user is not checked in).
|
||||
const jwt = await signInJwt(ID.attendeeA.email, ID.attendeeA.qrToken);
|
||||
const result = await userRpcResult(jwt, 'submit_feedback', {
|
||||
p_session_id: SESSION_A,
|
||||
p_rating: 5,
|
||||
p_comment: 'Great session!',
|
||||
});
|
||||
expect(result.ok).toBe(false);
|
||||
});
|
||||
|
||||
test('CONV-FEEDBACK-002 session attendance unlocks feedback (staff checks in via scanner)', async ({ browser }) => {
|
||||
// Two contexts: the attendee stays open; the staff checks them in via the
|
||||
// scanner. The attendee app must react without logout/login.
|
||||
const attendee = await createUser(browser, 'attendeeA');
|
||||
const staff = await createUser(browser, 'staff');
|
||||
try {
|
||||
const aApp = new AppPage(attendee.page, APP_URL);
|
||||
const aAgenda = new AgendaPage(attendee.page);
|
||||
const sApp = new AppPage(staff.page, APP_URL);
|
||||
const sScan = new ScanPage(staff.page);
|
||||
|
||||
// 1. Confirm feedback for SESSION_A is unavailable to ATTENDEE_A.
|
||||
await login(attendee.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('agenda');
|
||||
await aAgenda.openSession(SESSION_A_TITLE);
|
||||
await expect(aAgenda.giveFeedbackButton()).toHaveCount(0);
|
||||
// Close the session sheet (it intercepts pointer events on the tab bar).
|
||||
await attendee.page.getByRole('button', { name: '✕' }).click();
|
||||
await attendee.page.locator('.backdrop').waitFor({ state: 'detached', timeout: 3000 }).catch(() => {});
|
||||
|
||||
// 2. STAFF_01 selects SESSION_A and checks ATTENDEE_A into it (scanner).
|
||||
await login(staff.page, APP_URL, ID.staff);
|
||||
await sApp.waitForAdmitted();
|
||||
await sApp.gotoTab('scan');
|
||||
await sScan.setStaffMode();
|
||||
await sScan.setSessionMode();
|
||||
await sScan.selectSession(SESSION_A);
|
||||
await sScan.scanCode(ID.attendeeA.qrToken);
|
||||
await expect(sScan.sessionResult()).toBeVisible();
|
||||
|
||||
// Backend: the session check-in is persisted.
|
||||
expect(await db.waitForSessionCheckin(ID.attendeeA.email, SESSION_A)).toBe(true);
|
||||
|
||||
// 3. The attendee app reacts without logout/login: navigating to the
|
||||
// Agenda re-fetches check-ins, and SESSION_A is now eligible.
|
||||
await aApp.gotoTab('home');
|
||||
await aApp.gotoTab('agenda');
|
||||
await aAgenda.openSession(SESSION_A_TITLE);
|
||||
await expect(aAgenda.giveFeedbackButton()).toBeVisible();
|
||||
|
||||
// Close the session sheet (it intercepts pointer events on the tab bar).
|
||||
await attendee.page.getByRole('button', { name: '✕' }).click();
|
||||
await attendee.page.locator('.backdrop').waitFor({ state: 'detached', timeout: 3000 }).catch(() => {});
|
||||
|
||||
// The feedback-pill on Home is also visible (pending feedback for a done
|
||||
// session the user attended).
|
||||
await aApp.gotoTab('home');
|
||||
const home = new HomePage(attendee.page);
|
||||
await expect(home.feedbackPill()).toBeVisible();
|
||||
} finally {
|
||||
await attendee.close();
|
||||
await staff.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-FEEDBACK-003 feedback can be given later (persists across navigation + reload)', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const agenda = new AgendaPage(page);
|
||||
|
||||
// ATTENDEE_A attended SESSION_A (direct DB — check-in is a precondition).
|
||||
setSessionCheckin(ID.attendeeA.email, SESSION_A, ID.staff.email);
|
||||
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// 1. Do not immediately submit: confirm eligibility, then navigate away.
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SESSION_A_TITLE);
|
||||
await expect(agenda.giveFeedbackButton()).toBeVisible();
|
||||
// Close the session sheet (it intercepts pointer events on the tab bar).
|
||||
// The Sheet only closes on backdrop click (not Escape).
|
||||
await page.locator('.backdrop').click({ position: { x: 10, y: 10 } });
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// 3. Return later to the feedback functionality: SESSION_A is still eligible.
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SESSION_A_TITLE);
|
||||
await expect(agenda.giveFeedbackButton()).toBeVisible();
|
||||
});
|
||||
|
||||
test('CONV-FEEDBACK-004 feedback is session-specific (attended A, not B)', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const agenda = new AgendaPage(page);
|
||||
|
||||
// ATTENDEE_A attended SESSION_A but did NOT attend SESSION_B.
|
||||
setSessionCheckin(ID.attendeeA.email, SESSION_A, ID.staff.email);
|
||||
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Feedback is available for SESSION_A (done + checked-in).
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SESSION_A_TITLE);
|
||||
await expect(agenda.giveFeedbackButton()).toBeVisible();
|
||||
|
||||
// Feedback is unavailable for SESSION_B (not checked in).
|
||||
await page.locator('.backdrop').click({ position: { x: 10, y: 10 } });
|
||||
await agenda.openSession(SESSION_B_TITLE);
|
||||
await expect(agenda.giveFeedbackButton()).toHaveCount(0);
|
||||
|
||||
// Backend: the per-session check is enforced — SESSION_A ok, SESSION_B not.
|
||||
const jwt = await signInJwt(ID.attendeeA.email, ID.attendeeA.qrToken);
|
||||
const aRes = await userRpcResult(jwt, 'submit_feedback', {
|
||||
p_session_id: SESSION_A,
|
||||
p_rating: 5,
|
||||
p_comment: 'A',
|
||||
});
|
||||
const bRes = await userRpcResult(jwt, 'submit_feedback', {
|
||||
p_session_id: SESSION_B,
|
||||
p_rating: 5,
|
||||
p_comment: 'B',
|
||||
});
|
||||
expect(aRes.ok).toBe(true);
|
||||
expect(bRes.ok).toBe(false);
|
||||
});
|
||||
|
||||
test('CONV-FEEDBACK-005 submit session feedback (association + duplicate prevention)', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const agenda = new AgendaPage(page);
|
||||
|
||||
// ATTENDEE_A attended SESSION_A.
|
||||
setSessionCheckin(ID.attendeeA.email, SESSION_A, ID.staff.email);
|
||||
|
||||
// Capture the baseline points (should be 0 after reset).
|
||||
const beforePoints = db.registration(ID.attendeeA.email)?.points ?? 0;
|
||||
|
||||
await login(page, APP_URL, ID.attendeeA);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Open the session and click "Give feedback".
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SESSION_A_TITLE);
|
||||
await agenda.giveFeedbackButton().click();
|
||||
|
||||
// Complete all required fields and submit.
|
||||
const feedback = new FeedbackPage(page);
|
||||
await feedback.rate(5);
|
||||
await feedback.setComment('Excellent session, very insightful!');
|
||||
await feedback.submit();
|
||||
|
||||
// Backend: the feedback is associated with the correct attendee, session,
|
||||
// and event.
|
||||
const row = feedbackRow(ID.attendeeA.email, SESSION_A);
|
||||
expect(row).toContain(`${EVENT_ID}|`);
|
||||
expect(row).toContain(`|${ID.attendeeA.email}|`);
|
||||
expect(row).toContain(`|${SESSION_A}|`);
|
||||
|
||||
// Points: 10 awarded (with a comment).
|
||||
const afterPoints = db.registration(ID.attendeeA.email)?.points ?? 0;
|
||||
expect(afterPoints).toBe(beforePoints + 10);
|
||||
|
||||
// Duplicate submission: submit again (a different rating, no comment). The
|
||||
// existing row is updated in place — no second independent response is
|
||||
// created, and no further points are awarded.
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SESSION_A_TITLE);
|
||||
await agenda.giveFeedbackButton().click();
|
||||
await feedback.rate(4);
|
||||
await feedback.submit();
|
||||
|
||||
// Still exactly one feedback row for SESSION_A.
|
||||
expect(feedbackRowCount(ID.attendeeA.email, SESSION_A)).toBe(1);
|
||||
// The rating was updated in place (5 → 4).
|
||||
expect(feedbackRow(ID.attendeeA.email, SESSION_A)).toContain(`|${SESSION_A}|4`);
|
||||
// Points unchanged by the resubmit (0 earned on resubmit).
|
||||
const resubmitPoints = db.registration(ID.attendeeA.email)?.points ?? 0;
|
||||
expect(resubmitPoints).toBe(beforePoints + 10);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,171 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { signInJwt, userRpc } from '../src/helpers/api';
|
||||
import { db } from '../src/helpers/db';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ProfilePage } from '../src/pages/ProfilePage';
|
||||
import { ConnectionsPage } from '../src/pages/ConnectionsPage';
|
||||
|
||||
/**
|
||||
* §24–§26 Profile Email/LinkedIn visibility.
|
||||
*
|
||||
* Visibility is enforced by the `lanyard_lookup` / `get_public_contacts` RPCs
|
||||
* (which respect the contact's show_email / show_linkedin toggles). We verify
|
||||
* the persisted setting (DB) and the value another user actually sees (via the
|
||||
* public RPC, which is what the app's connection detail + scan use).
|
||||
*/
|
||||
|
||||
/** What another user sees for a contact (via the public directory RPC). */
|
||||
async function publicView(viewerJwt: string, targetEmail: string) {
|
||||
const rows = await userRpc<{ email: string; show_email: boolean; linkedin_url: string | null }[]>(
|
||||
viewerJwt,
|
||||
'get_public_contacts',
|
||||
{},
|
||||
);
|
||||
return rows.find((r) => r.email === targetEmail) ?? null;
|
||||
}
|
||||
|
||||
test.describe('Profile visibility', () => {
|
||||
test('CONV-PROFILE-001 Show Email enabled → visible to another user', async ({ browser }) => {
|
||||
const a = await createUser(browser, 'userA');
|
||||
const b = await createUser(browser, 'userB');
|
||||
try {
|
||||
const aApp = new AppPage(a.page, APP_URL);
|
||||
const aProfile = new ProfilePage(a.page);
|
||||
|
||||
// A enables Show Email and saves.
|
||||
await login(a.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('profile');
|
||||
await aProfile.setShowEmail(true);
|
||||
await aProfile.save();
|
||||
|
||||
// The setting persists (DB).
|
||||
expect(db.contact(ID.attendeeA.email)?.showEmail).toBe(true);
|
||||
|
||||
// B can see A's email (via the public RPC the app uses).
|
||||
const bJwt = await signInJwt(ID.attendeeB.email, ID.attendeeB.qrToken);
|
||||
const view = await publicView(bJwt, ID.attendeeA.email);
|
||||
expect(view?.show_email).toBe(true);
|
||||
} finally {
|
||||
await a.close();
|
||||
await b.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-PROFILE-002 Show Email disabled → hidden from another user', async ({ browser }) => {
|
||||
const a = await createUser(browser, 'userA');
|
||||
const b = await createUser(browser, 'userB');
|
||||
try {
|
||||
const aApp = new AppPage(a.page, APP_URL);
|
||||
const aProfile = new ProfilePage(a.page);
|
||||
|
||||
// A disables Show Email and saves.
|
||||
await login(a.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('profile');
|
||||
await aProfile.setShowEmail(false);
|
||||
await aProfile.save();
|
||||
|
||||
// The setting persists (DB).
|
||||
expect(db.contact(ID.attendeeA.email)?.showEmail).toBe(false);
|
||||
|
||||
// B cannot see A's email (the public RPC omits it).
|
||||
const bJwt = await signInJwt(ID.attendeeB.email, ID.attendeeB.qrToken);
|
||||
const view = await publicView(bJwt, ID.attendeeA.email);
|
||||
expect(view?.show_email).toBe(false);
|
||||
} finally {
|
||||
await a.close();
|
||||
await b.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-PROFILE-003 Show LinkedIn enabled → visible to another user', async ({ browser }) => {
|
||||
const a = await createUser(browser, 'userA');
|
||||
const b = await createUser(browser, 'userB');
|
||||
try {
|
||||
const aApp = new AppPage(a.page, APP_URL);
|
||||
const aProfile = new ProfilePage(a.page);
|
||||
|
||||
// A sets a LinkedIn URL, enables Show LinkedIn, and saves.
|
||||
await login(a.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('profile');
|
||||
await aProfile.setLinkedinUrl('https://linkedin.com/in/mia-moser');
|
||||
await aProfile.setShowLinkedin(true);
|
||||
await aProfile.save();
|
||||
|
||||
// The setting persists (DB).
|
||||
expect(db.contact(ID.attendeeA.email)?.showLinkedin).toBe(true);
|
||||
|
||||
// B can see A's LinkedIn (via the public RPC).
|
||||
const bJwt = await signInJwt(ID.attendeeB.email, ID.attendeeB.qrToken);
|
||||
const view = await publicView(bJwt, ID.attendeeA.email);
|
||||
expect(view?.linkedin_url).toBe('https://linkedin.com/in/mia-moser');
|
||||
} finally {
|
||||
await a.close();
|
||||
await b.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-PROFILE-004 Show LinkedIn disabled → hidden from another user', async ({ browser }) => {
|
||||
const a = await createUser(browser, 'userA');
|
||||
const b = await createUser(browser, 'userB');
|
||||
try {
|
||||
const aApp = new AppPage(a.page, APP_URL);
|
||||
const aProfile = new ProfilePage(a.page);
|
||||
|
||||
// A sets a LinkedIn URL but disables Show LinkedIn, and saves.
|
||||
await login(a.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aApp.gotoTab('profile');
|
||||
await aProfile.setLinkedinUrl('https://linkedin.com/in/mia-moser');
|
||||
await aProfile.setShowLinkedin(false);
|
||||
await aProfile.save();
|
||||
|
||||
// The setting persists (DB).
|
||||
expect(db.contact(ID.attendeeA.email)?.showLinkedin).toBe(false);
|
||||
|
||||
// B cannot see A's LinkedIn (the public RPC omits it).
|
||||
const bJwt = await signInJwt(ID.attendeeB.email, ID.attendeeB.qrToken);
|
||||
const view = await publicView(bJwt, ID.attendeeA.email);
|
||||
expect(view?.linkedin_url).toBeNull();
|
||||
} finally {
|
||||
await a.close();
|
||||
await b.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('CONV-PROFILE-005 visibility settings behave consistently across roles', async ({ browser }) => {
|
||||
// Representative users from each role: staff, attendee, speaker, sponsor.
|
||||
const roles = [ID.staff, ID.attendeeA, ID.speaker, ID.sponsor];
|
||||
const contexts = [];
|
||||
for (const r of roles) contexts.push(await createUser(browser, r.label));
|
||||
try {
|
||||
// Each role enables Show Email and saves; the setting persists and is
|
||||
// respected (visible) regardless of role.
|
||||
for (let i = 0; i < roles.length; i++) {
|
||||
const ctx = contexts[i];
|
||||
const app = new AppPage(ctx.page, APP_URL);
|
||||
const profile = new ProfilePage(ctx.page);
|
||||
await login(ctx.page, APP_URL, roles[i]);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('profile');
|
||||
await profile.setShowEmail(true);
|
||||
await profile.save();
|
||||
expect(db.contact(roles[i].email)?.showEmail).toBe(true);
|
||||
}
|
||||
|
||||
// A viewer (attendee B) sees each role's email as visible.
|
||||
const bJwt = await signInJwt(ID.attendeeB.email, ID.attendeeB.qrToken);
|
||||
for (const r of roles) {
|
||||
const view = await publicView(bJwt, r.email);
|
||||
expect(view?.show_email, `${r.label} show_email should be visible`).toBe(true);
|
||||
}
|
||||
} finally {
|
||||
for (const c of contexts) await c.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,92 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID, SESSION_A, SESSION_B } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { db } from '../src/helpers/db';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ScanPage } from '../src/pages/ScanPage';
|
||||
|
||||
/**
|
||||
* §21–§23 Session Check-In + Welcome/Session independence.
|
||||
*/
|
||||
|
||||
test.describe('Session Check-In', () => {
|
||||
test('CONV-SESSION-001 staff checks an attendee into a session (QR)', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.staff);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('scan');
|
||||
await scan.setStaffMode();
|
||||
await scan.setSessionMode();
|
||||
|
||||
// SESSION_A is explicitly selected.
|
||||
await scan.selectSession(SESSION_A);
|
||||
|
||||
// Scan ATTENDEE_A and complete the check-in.
|
||||
await scan.scanCode(ID.attendeeA.qrToken);
|
||||
await expect(scan.sessionResult()).toBeVisible();
|
||||
|
||||
// Attendance is registered for (ATTENDEE_A, SESSION_A) and persisted.
|
||||
expect(await db.waitForSessionCheckin(ID.attendeeA.email, SESSION_A)).toBe(true);
|
||||
|
||||
// Attendance is NOT automatically created for other sessions.
|
||||
const checkins = db.sessionCheckins(ID.attendeeA.email);
|
||||
expect(checkins).toContain(SESSION_A);
|
||||
expect(checkins).not.toContain(SESSION_B);
|
||||
});
|
||||
|
||||
test('CONV-SESSION-002 session check-in via manual code is equivalent to QR', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.staff);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('scan');
|
||||
await scan.setStaffMode();
|
||||
await scan.setSessionMode();
|
||||
await scan.selectSession(SESSION_A);
|
||||
|
||||
// Manual code input (the same token the QR would carry).
|
||||
await scan.scanCode(ID.attendeeA.qrToken);
|
||||
await expect(scan.sessionResult()).toBeVisible();
|
||||
|
||||
// Equivalent backend state: (ATTENDEE_A, SESSION_A) checked in.
|
||||
expect(await db.waitForSessionCheckin(ID.attendeeA.email, SESSION_A)).toBe(true);
|
||||
});
|
||||
|
||||
test('CONV-SESSION-003 welcome check-in and session check-in are independent states', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.staff);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('scan');
|
||||
|
||||
// 1. Welcome check-in only (no session).
|
||||
await scan.setWelcomeMode();
|
||||
await scan.scanCode(ID.attendeeA.qrToken);
|
||||
await expect(scan.welcomeResult()).toBeVisible();
|
||||
expect(await db.waitForWelcomeCheckedIn(ID.attendeeA.email)).toBe(true);
|
||||
|
||||
// Welcome check-in must NOT create any session attendance.
|
||||
await new Promise((r) => setTimeout(r, 300));
|
||||
expect(db.sessionCheckins(ID.attendeeA.email)).toEqual([]);
|
||||
|
||||
// Dismiss the result sheet so its backdrop doesn't block the mode toggle.
|
||||
await scan.dismissResult();
|
||||
|
||||
// 2. Now a session check-in (SESSION_A) — a distinct, session-specific state.
|
||||
await scan.setSessionMode();
|
||||
await scan.selectSession(SESSION_A);
|
||||
await scan.scanCode(ID.attendeeA.qrToken);
|
||||
await expect(scan.sessionResult()).toBeVisible();
|
||||
expect(await db.waitForSessionCheckin(ID.attendeeA.email, SESSION_A)).toBe(true);
|
||||
|
||||
// The session check-in references a specific session (SESSION_A, not SESSION_B).
|
||||
const checkins = db.sessionCheckins(ID.attendeeA.email);
|
||||
expect(checkins).toContain(SESSION_A);
|
||||
expect(checkins).not.toContain(SESSION_B);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,169 @@
|
||||
import path from 'node:path';
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID, SPEAKER_SESSION } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { signInJwt, userRpcResult } from '../src/helpers/api';
|
||||
import { db } from '../src/helpers/db';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { AgendaPage } from '../src/pages/AgendaPage';
|
||||
import { HomePage } from '../src/pages/HomePage';
|
||||
|
||||
/**
|
||||
* §27 Speaker role + §28 Speaker session material upload.
|
||||
*
|
||||
* SPEAKER_01 (Duncan Boyne) is a `session_speakers` row for SESSION_A (slot 1,
|
||||
* "From Vision to Reality – A Live Launch Moment"). The seed leaves the
|
||||
* speaker's `qr_token` NULL (a real gap — see findings), so the reset helper
|
||||
* assigns a token + re-hashes the auth password.
|
||||
*
|
||||
* Material upload is a two-step backend operation: a Supabase Storage write to
|
||||
* the `materials` bucket (RLS: `is_speaker_or_admin()`) + the `set_session_material`
|
||||
* RPC (security definer; raises unless the caller is admin or a speaker of the
|
||||
* session). We verify both the UI and the backend authorization.
|
||||
*/
|
||||
|
||||
/** The speaker's session title (slot 1). */
|
||||
const SPEAKER_SESSION_TITLE = 'From Vision to Reality';
|
||||
|
||||
/** A small, valid test file for the material upload. */
|
||||
const MATERIAL_FILE = path.join(__dirname, '..', 'fixtures', 'material.txt');
|
||||
|
||||
/** Poll until a session has material (robust against commit timing). */
|
||||
async function waitForMaterial(sessionId: string, timeoutMs = 5000): Promise<boolean> {
|
||||
const deadline = Date.now() + timeoutMs;
|
||||
for (;;) {
|
||||
if (db.sessionHasMaterial(sessionId)) return true;
|
||||
if (Date.now() > deadline) return db.sessionHasMaterial(sessionId);
|
||||
await new Promise((r) => setTimeout(r, 200));
|
||||
}
|
||||
}
|
||||
|
||||
test.describe('Speaker + material upload', () => {
|
||||
test('CONV-SPEAKER-001 session assignment grants the Speaker role automatically', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
|
||||
// SPEAKER_01 is a session_speakers row for SESSION_A (slot 1).
|
||||
await login(page, APP_URL, ID.speaker);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// The registration type is 'speaker' (auto-promoted by the trigger).
|
||||
expect(db.registration(ID.speaker.email)?.type).toBe('speaker');
|
||||
|
||||
// Speaker-specific functionality is available: the Agenda marks the session
|
||||
// with the "🎤 you" speaker tag.
|
||||
await app.gotoTab('agenda');
|
||||
const agenda = new AgendaPage(page);
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
await expect(agenda.speakerTag()).toBeVisible();
|
||||
});
|
||||
|
||||
test('CONV-MATERIAL-001 speaker sees the pending material request (red attachment)', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const home = new HomePage(page);
|
||||
|
||||
await login(page, APP_URL, ID.speaker);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Home displays the pending-material area (the red 📎 attachment pill).
|
||||
await expect(home.materialPill()).toBeVisible();
|
||||
|
||||
// The material request references the relevant session (the Agenda shows the
|
||||
// upload notice for the speaker's session).
|
||||
await app.gotoTab('agenda');
|
||||
const agenda = new AgendaPage(page);
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
await expect(page.getByTestId('material-upload-notice')).toBeVisible();
|
||||
});
|
||||
|
||||
test('CONV-MATERIAL-002 speaker uploads material and it persists across reload', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const agenda = new AgendaPage(page);
|
||||
|
||||
await login(page, APP_URL, ID.speaker);
|
||||
await app.waitForAdmitted();
|
||||
const home = new HomePage(page);
|
||||
|
||||
// The pending-material pill count before the upload (this session is one of
|
||||
// the pending ones; the speaker may have other pending sessions too).
|
||||
const beforeCount = Number(((await home.materialPill().textContent()) ?? '').replace(/\D/g, ''));
|
||||
|
||||
await app.gotoTab('agenda');
|
||||
|
||||
// Open the speaker's session and upload a valid test file.
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
await agenda.uploadMaterial(MATERIAL_FILE);
|
||||
|
||||
// The upload is persisted (material_path set on the session).
|
||||
expect(await waitForMaterial(SPEAKER_SESSION)).toBe(true);
|
||||
|
||||
// The upload state survives a reload: the session shows the material (📎) +
|
||||
// a download link, and the pending-material pill no longer counts this
|
||||
// session (the speaker's other session may still be pending, so the pill
|
||||
// count decreases rather than reaching 0).
|
||||
await page.reload();
|
||||
await app.waitForAdmitted();
|
||||
const afterCount = Number(((await home.materialPill().textContent()) ?? '').replace(/\D/g, ''));
|
||||
expect(afterCount).toBe(beforeCount - 1);
|
||||
await app.gotoTab('agenda');
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
await expect(page.getByText(/Download material/)).toBeVisible();
|
||||
});
|
||||
|
||||
test('CONV-MATERIAL-003 material upload is available whenever it is still relevant', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const agenda = new AgendaPage(page);
|
||||
|
||||
// The speaker's session (slot 1) is a "done" slot at the simulated clock,
|
||||
// but the upload control is not time-gated (selNeedsMaterial has no time
|
||||
// check) — it is available as long as the session is the user's and has no
|
||||
// material yet.
|
||||
await login(page, APP_URL, ID.speaker);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('agenda');
|
||||
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
|
||||
// The upload control is present (the session is the speaker's + no material).
|
||||
await expect(agenda.materialUploadInput()).toBeVisible();
|
||||
|
||||
// The upload notice is shown (non-dismissible until uploaded).
|
||||
await expect(page.getByTestId('material-upload-notice')).toBeVisible();
|
||||
});
|
||||
|
||||
test('CONV-MATERIAL-004 material upload authorization (backend + frontend)', async ({ browser }) => {
|
||||
// Authorized: the speaker can upload (storage write allowed for speakers).
|
||||
const spk = await createUser(browser, 'speaker');
|
||||
// Unauthorized: a plain attendee (no session/material assignment).
|
||||
const att = await createUser(browser, 'attendeeA');
|
||||
try {
|
||||
// Backend: the speaker's JWT can call set_session_material.
|
||||
const spkJwt = await signInJwt(ID.speaker.email, ID.speaker.qrToken);
|
||||
const spkRes = await userRpcResult(spkJwt, 'set_session_material', {
|
||||
p_session_id: SPEAKER_SESSION,
|
||||
p_material_path: 'sessions/test/speaker.txt',
|
||||
});
|
||||
expect(spkRes.ok, `speaker set_session_material should succeed: ${spkRes.message}`).toBe(true);
|
||||
|
||||
// Backend: a plain attendee's JWT is rejected (not a speaker/admin).
|
||||
const attJwt = await signInJwt(ID.attendeeA.email, ID.attendeeA.qrToken);
|
||||
const attRes = await userRpcResult(attJwt, 'set_session_material', {
|
||||
p_session_id: SPEAKER_SESSION,
|
||||
p_material_path: 'sessions/test/attendee.txt',
|
||||
});
|
||||
expect(attRes.ok, `attendee set_session_material should be rejected`).toBe(false);
|
||||
|
||||
// Frontend: the plain attendee does not see the material upload control.
|
||||
await login(att.page, APP_URL, ID.attendeeA);
|
||||
const app = new AppPage(att.page, APP_URL);
|
||||
await app.waitForAdmitted();
|
||||
await app.gotoTab('agenda');
|
||||
const agenda = new AgendaPage(att.page);
|
||||
await agenda.openSession(SPEAKER_SESSION_TITLE);
|
||||
await expect(att.page.getByTestId('material-upload')).toHaveCount(0);
|
||||
} finally {
|
||||
await spk.close();
|
||||
await att.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,127 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { createUser } from '../src/helpers/multi';
|
||||
import { signInJwt, userRpc, userRpcResult } from '../src/helpers/api';
|
||||
import { db } from '../src/helpers/db';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ScanPage } from '../src/pages/ScanPage';
|
||||
import { ConnectionsPage } from '../src/pages/ConnectionsPage';
|
||||
import { ProfilePage } from '../src/pages/ProfilePage';
|
||||
import { HomePage } from '../src/pages/HomePage';
|
||||
|
||||
/**
|
||||
* CONV-SPONSOR-001 — validate a Sponsor account.
|
||||
*
|
||||
* A sponsor can log in via the normal participant flow and use the app like any
|
||||
* non-staff participant (Home, Agenda, Connections, Profile, connection
|
||||
* requests, Show Email / Show LinkedIn). A sponsor must NOT automatically
|
||||
* receive Staff privileges: it cannot perform Welcome Check-In or Session
|
||||
* Check-In (enforced by the backend, not just the UI).
|
||||
*/
|
||||
|
||||
/** What another user sees for a contact (via the public directory RPC). */
|
||||
async function publicView(viewerJwt: string, targetEmail: string) {
|
||||
const rows = await userRpc<{ email: string; show_email: boolean; linkedin_url: string | null }[]>(
|
||||
viewerJwt,
|
||||
'get_public_contacts',
|
||||
{},
|
||||
);
|
||||
return rows.find((r) => r.email === targetEmail) ?? null;
|
||||
}
|
||||
|
||||
test.describe('CONV-SPONSOR-001 — sponsor functionality', () => {
|
||||
test('sponsor can use the app like a participant (Home, Agenda, Connections, Profile, privacy)', async ({ browser }) => {
|
||||
const sponsor = await createUser(browser, 'sponsor');
|
||||
const attendee = await createUser(browser, 'attendeeA');
|
||||
try {
|
||||
const sApp = new AppPage(sponsor.page, APP_URL);
|
||||
const sScan = new ScanPage(sponsor.page);
|
||||
const sConns = new ConnectionsPage(sponsor.page);
|
||||
const sProfile = new ProfilePage(sponsor.page);
|
||||
const aApp = new AppPage(attendee.page, APP_URL);
|
||||
const aConns = new ConnectionsPage(attendee.page);
|
||||
|
||||
// 1. Log in via the normal participant flow (QR + ticket email).
|
||||
await login(sponsor.page, APP_URL, ID.sponsor);
|
||||
await sApp.waitForAdmitted();
|
||||
|
||||
// Backend: registration type is 'sponsor' (NOT staff) and checked in.
|
||||
expect(db.registration(ID.sponsor.email)?.type).toBe('sponsor');
|
||||
expect(db.registration(ID.sponsor.email)?.checkedIn).toBe(true);
|
||||
|
||||
// 2. Access Home (greeting renders).
|
||||
const home = new HomePage(sponsor.page);
|
||||
await expect(home.greeting()).toBeVisible();
|
||||
|
||||
// 3. Access Agenda (the demo timetable renders).
|
||||
await sApp.gotoTab('agenda');
|
||||
await expect(sApp.eventTitle()).toBeVisible();
|
||||
await expect(sponsor.page.getByText(/slots/)).toBeVisible();
|
||||
|
||||
// 4. Access Profile (save control present).
|
||||
await sApp.gotoTab('profile');
|
||||
await expect(sponsor.page.getByTestId('profile-save')).toBeVisible();
|
||||
|
||||
// 5. Send a connection request to an attendee (sponsor networking).
|
||||
await sApp.gotoTab('scan');
|
||||
await sScan.setAttendeeMode();
|
||||
await sScan.scanCode(ID.attendeeA.qrToken);
|
||||
await sScan.sendConnection();
|
||||
await sConns.gotoRequests();
|
||||
expect(await sConns.outgoingContains('Mia Moser')).toBe(true);
|
||||
|
||||
// 6. The attendee sees the incoming request and accepts it.
|
||||
await login(attendee.page, APP_URL, ID.attendeeA);
|
||||
await aApp.waitForAdmitted();
|
||||
await aConns.gotoRequests();
|
||||
await aConns.accept();
|
||||
|
||||
// 7. The connection is established both ways.
|
||||
await aConns.gotoMine();
|
||||
expect(await aConns.mineContains('Demo Sponsor')).toBe(true);
|
||||
// Force the sponsor's Connections screen to re-fetch (it was already
|
||||
// mounted from step 5, so navigate away + back to trigger a fresh load).
|
||||
await sApp.gotoTab('home');
|
||||
await sConns.gotoMine();
|
||||
expect(await sConns.mineContains('Mia Moser')).toBe(true);
|
||||
|
||||
// 8. Use Show Email + Show LinkedIn (privacy controls work for sponsors).
|
||||
await sApp.gotoTab('profile');
|
||||
await sProfile.setShowEmail(true);
|
||||
await sProfile.setLinkedinUrl('https://linkedin.com/in/demo-sponsor');
|
||||
await sProfile.setShowLinkedin(true);
|
||||
await sProfile.save();
|
||||
// The settings persist (DB).
|
||||
expect(db.contact(ID.sponsor.email)?.showEmail).toBe(true);
|
||||
expect(db.contact(ID.sponsor.email)?.showLinkedin).toBe(true);
|
||||
// The attendee can see the sponsor's email + LinkedIn (via the public RPC).
|
||||
const aJwt = await signInJwt(ID.attendeeA.email, ID.attendeeA.qrToken);
|
||||
const view = await publicView(aJwt, ID.sponsor.email);
|
||||
expect(view?.show_email).toBe(true);
|
||||
expect(view?.linkedin_url).toBe('https://linkedin.com/in/demo-sponsor');
|
||||
} finally {
|
||||
await sponsor.close();
|
||||
await attendee.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('sponsor does not receive staff privileges (cannot perform check-ins)', async () => {
|
||||
// Backend: a sponsor's JWT cannot call welcome_checkin (staff only).
|
||||
const sponsorJwt = await signInJwt(ID.sponsor.email, ID.sponsor.qrToken);
|
||||
const welcomeRes = await userRpcResult(sponsorJwt, 'welcome_checkin', {
|
||||
p_attendee_qr: ID.attendeeNew.qrToken,
|
||||
});
|
||||
expect(welcomeRes.ok).toBe(false);
|
||||
|
||||
// Backend: a sponsor's JWT cannot call checkin_attendee (staff only).
|
||||
const checkinRes = await userRpcResult(sponsorJwt, 'checkin_attendee', {
|
||||
p_attendee_qr: ID.attendeeA.qrToken,
|
||||
p_session_id: '37ab7060-3d81-4221-9322-6971e97d1175',
|
||||
});
|
||||
expect(checkinRes.ok).toBe(false);
|
||||
|
||||
// The registration type is 'sponsor', not 'staff' (no role elevation).
|
||||
expect(db.registration(ID.sponsor.email)?.type).toBe('sponsor');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,119 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID } from '../src/helpers/config';
|
||||
import { toScanStep } from '../src/helpers/auth';
|
||||
import { signInJwt } from '../src/helpers/api';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
|
||||
/**
|
||||
* §6 Staff Authentication.
|
||||
*
|
||||
* In this app the staff identity is provided via the lanyard QR (which resolves
|
||||
* to the staff contact — i.e. the staff's email), and the staff password is
|
||||
* always required. CONV-STAFF-AUTH-001 ("email + password") and -002 ("QR +
|
||||
* password") therefore both exercise the same QR→identity + password flow; the
|
||||
* QR is what carries the identity (the staff's email).
|
||||
*/
|
||||
|
||||
test.describe('CONV-STAFF-AUTH', () => {
|
||||
test('CONV-STAFF-AUTH-001 staff login (identity + password) succeeds and loads the demo event', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
await toScanStep(page, APP_URL);
|
||||
|
||||
// Provide the staff identity (QR) + the correct staff password.
|
||||
await page.getByTestId('scanner-manual-code').fill(ID.staff.qrToken);
|
||||
await page.getByTestId('scanner-manual-go').click();
|
||||
await page.getByTestId('staff-login-password').fill(ID.staff.password!);
|
||||
await page.getByTestId('login-confirm').click();
|
||||
|
||||
// Admitted: the tab bar is visible and the staff is recognized.
|
||||
await app.waitForAdmitted();
|
||||
await expect(await app.isGated()).toBe(false);
|
||||
|
||||
// Staff functionality is available: the Scan screen offers the Staff mode.
|
||||
await app.gotoTab('scan');
|
||||
await expect(page.getByTestId('scan-mode-staff')).toBeVisible();
|
||||
|
||||
// The Demo Event + timetable load.
|
||||
await app.gotoTab('agenda');
|
||||
await expect(app.eventTitle()).toBeVisible();
|
||||
await expect(page.getByText(/slots/)).toBeVisible();
|
||||
|
||||
// No authentication error remains visible.
|
||||
await expect(page.getByTestId('login-error')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('CONV-STAFF-AUTH-002 staff login via QR + password succeeds', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
await toScanStep(page, APP_URL);
|
||||
|
||||
// The QR resolves to the staff (the confirm screen shows "Staff sign in").
|
||||
await page.getByTestId('scanner-manual-code').fill(ID.staff.qrToken);
|
||||
await page.getByTestId('scanner-manual-go').click();
|
||||
await expect(page.getByTestId('staff-login-password')).toBeVisible();
|
||||
|
||||
// The password is mandatory and, once provided, authentication succeeds.
|
||||
await page.getByTestId('staff-login-password').fill(ID.staff.password!);
|
||||
await page.getByTestId('login-confirm').click();
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Demo event + timetable load.
|
||||
await app.gotoTab('agenda');
|
||||
await expect(app.eventTitle()).toBeVisible();
|
||||
});
|
||||
|
||||
test('CONV-STAFF-AUTH-003 QR alone does not authenticate staff (password mandatory)', async ({ page }) => {
|
||||
await toScanStep(page, APP_URL);
|
||||
|
||||
// Provide the QR but no password.
|
||||
await page.getByTestId('scanner-manual-code').fill(ID.staff.qrToken);
|
||||
await page.getByTestId('scanner-manual-go').click();
|
||||
await page.getByTestId('staff-login-password').waitFor({ state: 'visible' });
|
||||
|
||||
// The confirm control is disabled without a password → cannot continue.
|
||||
await expect(page.getByTestId('login-confirm')).toBeDisabled();
|
||||
|
||||
// Backend: the QR token is NOT the staff's auth password.
|
||||
const res = await signInJwt(ID.staff.email, ID.staff.qrToken).then(
|
||||
() => 'ok',
|
||||
() => 'rejected',
|
||||
);
|
||||
expect(res).toBe('rejected');
|
||||
});
|
||||
|
||||
test('CONV-STAFF-AUTH-004 identity (email) alone does not authenticate staff', async ({ page }) => {
|
||||
await toScanStep(page, APP_URL);
|
||||
|
||||
// Provide the identity (QR → staff email) but no password.
|
||||
await page.getByTestId('scanner-manual-code').fill(ID.staff.qrToken);
|
||||
await page.getByTestId('scanner-manual-go').click();
|
||||
await page.getByTestId('staff-login-password').waitFor({ state: 'visible' });
|
||||
await expect(page.getByTestId('login-confirm')).toBeDisabled();
|
||||
|
||||
// Backend: the staff email with an empty password does not authenticate.
|
||||
const res = await signInJwt(ID.staff.email, '').then(
|
||||
() => 'ok',
|
||||
() => 'rejected',
|
||||
);
|
||||
expect(res).toBe('rejected');
|
||||
});
|
||||
|
||||
test('CONV-STAFF-AUTH-005 incorrect staff password is rejected (email + QR variants)', async ({ page }) => {
|
||||
// Variant A: identity + wrong password.
|
||||
await toScanStep(page, APP_URL);
|
||||
await page.getByTestId('scanner-manual-code').fill(ID.staff.qrToken);
|
||||
await page.getByTestId('scanner-manual-go').click();
|
||||
await page.getByTestId('staff-login-password').fill('wrong-password-xyz');
|
||||
await page.getByTestId('login-confirm').click();
|
||||
|
||||
// A suitable authentication error is displayed and no session is created.
|
||||
await expect(page.getByTestId('login-error')).toBeVisible();
|
||||
await expect(page.getByTestId('tab-home')).toHaveCount(0);
|
||||
|
||||
// Variant B: QR + wrong password (backend).
|
||||
const res = await signInJwt(ID.staff.email, 'wrong-password-xyz').then(
|
||||
() => 'ok',
|
||||
() => 'rejected',
|
||||
);
|
||||
expect(res).toBe('rejected');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
import { test, expect } from './base';
|
||||
import { APP_URL, ID } from '../src/helpers/config';
|
||||
import { login } from '../src/helpers/auth';
|
||||
import { AppPage } from '../src/pages/AppPage';
|
||||
import { ScanPage } from '../src/pages/ScanPage';
|
||||
|
||||
/**
|
||||
* §7 Staff Frontend — CONV-STAFF-UI-001.
|
||||
*
|
||||
* After a successful staff login, verify the staff can see and use the
|
||||
* appropriate application areas and that no major component fails to render.
|
||||
*/
|
||||
test('CONV-STAFF-UI-001 staff frontend renders all areas without errors', async ({ page }) => {
|
||||
const app = new AppPage(page, APP_URL);
|
||||
const scan = new ScanPage(page);
|
||||
|
||||
// Collect console errors + failed requests for the report.
|
||||
const errors: string[] = [];
|
||||
page.on('console', (m) => m.type() === 'error' && errors.push(m.text()));
|
||||
page.on('pageerror', (e) => errors.push(`pageerror: ${e.message}`));
|
||||
|
||||
await login(page, APP_URL, ID.staff);
|
||||
await app.waitForAdmitted();
|
||||
|
||||
// Demo Event information + timetable.
|
||||
await app.gotoTab('agenda');
|
||||
await expect(app.eventTitle()).toBeVisible();
|
||||
await expect(page.getByText(/slots/)).toBeVisible();
|
||||
|
||||
// Session information (a session detail sheet opens).
|
||||
await page.getByRole('button', { name: /From Vision to Reality/ }).first().click();
|
||||
await expect(page.locator('.sheet')).toBeVisible();
|
||||
await page.getByRole('button', { name: '✕' }).click();
|
||||
|
||||
// Scanner + manual code input.
|
||||
await app.gotoTab('scan');
|
||||
await expect(page.getByTestId('scanner-manual-code')).toBeVisible();
|
||||
await expect(page.getByTestId('scanner-manual-go')).toBeVisible();
|
||||
|
||||
// Welcome Check-In + Session Check-In functionality (staff mode + toggle + session selector).
|
||||
await scan.setStaffMode();
|
||||
await expect(page.getByTestId('welcome-checkin-toggle')).toBeVisible();
|
||||
await scan.setSessionMode();
|
||||
await expect(page.getByTestId('session-selector')).toBeVisible();
|
||||
|
||||
// Normal Connections functionality.
|
||||
await app.gotoTab('connections');
|
||||
await expect(page.getByTestId('connections-tab-mine')).toBeVisible();
|
||||
|
||||
// Profile.
|
||||
await app.gotoTab('profile');
|
||||
await expect(page.getByTestId('profile-save')).toBeVisible();
|
||||
|
||||
// No uncaught errors.
|
||||
expect(errors, `Uncaught frontend errors: ${errors.join(' | ')}`).toEqual([]);
|
||||
});
|
||||
Reference in new issue
Block a user