Skip to content

Multi-persona walks

Pass only the actors you need:

ts
await runDemoWalk({ browser, page }, ['ADMIN', 'PLAYER'], async (walk) => {
  await demoFocus(walk.page.ADMIN, '1 / 2', 'Create the player');
  await demoFocus(walk.page.PLAYER, '2 / 2', 'First login');
});

On E2E_DEMO=1 each key is an isolated browser context (own cookies). The admin can stay signed in to read mail while the player uses another window.

On the fast path every key is the same browser page, branded with that persona. demoFocus(walk.page.PLAYER, …) updates the HUD chip and the transcript actor. Pass walk.page[id], not the fixture page, so the chip does not stay on the lead persona after the chapter title and route have already moved.

Logout still requires resumeOnSharedPage before the next privileged action.

Persona video files are <id>.webm in lowercase (admin.webm), only when E2E_DEMO=1 (unless E2E_DEMO_VIDEO=0). Teaching shots still write on the shared-page fast path.

This repo dogfoods the shared-page chip in e2e/multi-persona-walk.spec.ts (AUTHORREVIEWERREADER).

Released under the MIT License.