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([]); });