Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.45 KB

File metadata and controls

53 lines (37 loc) · 1.45 KB

Running E2E Tests

End-to-end tests live in e2e/ and use Playwright (Chromium, headless).

Prerequisites

Before running E2E tests for the first time (or on a fresh checkout), install dependencies and Playwright browsers:

just install-e2e          # installs e2e/ Bun dependencies
just install-playwright   # installs headless Chromium

See e2e/README.md for full details on prerequisites and options.

Running Tests

  1. Build the UI and start the server in one terminal:

    just build-ui && SK_SERVER__MOQ_GATEWAY_URL=http://127.0.0.1:4545/moq SK_SERVER__ADDRESS=127.0.0.1:4545 just skit
  2. Run the tests in a second terminal:

    just e2e-external http://localhost:4545

Headless-Browser Pitfalls

  • Playwright runs headless Chromium with a default 1280x720 viewport. Elements rendered below the fold are not visible to IntersectionObserver. If a test relies on an element being observed (e.g. the <canvas> used by the MoQ video renderer), scroll it into view first:

    const canvas = page.locator('canvas');
    await canvas.scrollIntoViewIfNeeded();
  • The @moq/watch Video.Renderer enables the Video.Decoder (and therefore the video/data MoQ subscription) only when the canvas is intersecting. Forgetting to scroll will result in a permanently black canvas.