Skip to content

Add a headless-browser smoke test for the renderer, every layer type and MP4 export #14

Open

Description

@blixvip

The unit tests cover the storyboard schema, the server and every provider. The code that draws the video has no automated coverage at all:

  • web/engine/render.mjs
  • the 17 draw functions in web/engine/layers.mjs (only the pure helpers parseRuns and formatNumber are tested)
  • web/engine/export.mjs

A layer that throws, like the negative-size lens/glass case in this backlog, only shows up when someone opens the studio.

The app already exposes a hook meant for exactly this, window.genmotion, with storyboard, seek(), exportMp4() and preloadAll(). Nothing uses it yet.

Task: add scripts/browser-check.mjs, run by npm run check:browser, that:

  1. starts the server like scripts/check.mjs does
  2. opens the studio in headless Chrome
  3. loads a storyboard with one scene per LAYERS type, in each of 16:9, 9:16 and 1:1
  4. seeks to several times per scene and asserts that no error was thrown
  5. exports web/demo.genmotion.json and checks the MP4's size and duration

The project advertises zero dependencies, so keep the runtime free of them. Options: drive Chrome over the DevTools Protocol with Node's built-in WebSocket (Node 22+), or use playwright-core through npx without adding it to package.json. Explain the choice in the PR. A follow-up can wire this into CI.

Where: new scripts/browser-check.mjs; package.json:9-14; hook at web/app.mjs:657-658; web/engine/layers.mjs:480 (LAYER_DRAW); web/engine/storyboard.mjs:14-32 (LAYERS); server bootstrap to copy from scripts/check.mjs:1-30.


Getting started: Node 22, no npm install needed: git clone, then npm test and npm run check. Chrome or Edge for this one. Comment here to claim it. Questions → Discord.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions