14. Testing and CI

The headless Chromium runs use Playwright (a development dependency) against the dev server.

Esta página está em inglês; a tradução está a caminho.

14.1 Suites#

Suite Location Runs in Covers SRS
Unit test/unit/ Node, mocha tdd core (fold, indexes, resolve, drafts, undo, rebase, tolerant reading), layout, text, render (display lists, SVG and PDF writers, hit testing), schema validator, selectors, UDX NFR-5
Registry conformance test/conformance/ Node §3.7 CMD-17, CMD-19, CMD-20, CMD-23
Command cases test/commands/cases/*.json Node, through ud run in-process every command’s events CMD-19
Figma tool schema test/mcp/ Node §9.2; MCP server over a stdio pair CMD-7, CMD-8
Plugin API conformance test/plugin-api/ Node + QuickJS §8.6 CMD-10 to CMD-15
CLI, headless, bridge test/cli/ Node, private bridge folder arguments, exit codes, JSON errors, locks, bridge round trips, fileKey/nodeId forms CMD-1 to CMD-3, CMD-27 to CMD-30
Golden images test/golden/ Node (resvg) + headless Chromium (Canvas2D) §7.5 NFR-8, CMD-32
Layout and text identity test/layout/, test/text/ Node + headless Chromium §5.8, §6.5 LAY-9, TXT-5
Webview check scripts/check-webview.mjs Node page contract (§11.6) UI-3, CMD-18
Layer rules scripts/check-layers.mjs Node §2.2 —
Merge test/unit/merge.test.ts Node, real git two branches, merge=union, fold, conflicts reported COL-4, NFR-2
Integration test/integration/ VS Code via @vscode/test-cli open, edit, undo, save, backup and hot exit, external change merge, bridge from a terminal, commands in the palette PLT-1, PLT-5, PLT-8
Benchmarks test/bench/ Node + headless Chromium §12 NFR-1, CMD-31
Agent scenarios test/scenarios/ Claude Code against ud mcp CMD-9 scenarios with Figma’s and UI Designer’s skills CMD-9

The headless Chromium runs use Playwright (a development dependency) against the dev server. Agent scenarios need a Claude account and cost money; they run nightly and before a release, not on every pull request.

14.2 CI#

.github/workflows/test.yml runs on Linux, Windows and macOS with Node 24 (npm ci, then npm test, with xvfb-run -a on Linux) (NFR-5). It is extended to:

  1. npm run compile (both tsconfigs, the esbuild bundles, WASM copy, generated files check);
  2. npm run lint (ESLint, layer rules), npm run check:webview and npm run check:licences (the dependency licence allowlist and the THIRD-PARTY-NOTICES freshness check, ADR-11);
  3. npm run test:unit (unit, conformance, command cases, schema, Plugin API, CLI);
  4. on Linux only: Playwright Chromium with GPU rasterisation off (ADR-8), golden images, identity tests, benchmarks (results uploaded as an artifact);
  5. npm run test:integration under xvfb-run on Linux, directly elsewhere;
  6. a job on Node 22 that runs the CLI tests, because the CLI promises Node 22 (§2.4 of the SRS); Node 22 and 24 are the two versions tested, and the matrix moves when Node’s release schedule does;
  7. npm run package followed by scripts/check-vsix-size.mjs, which fails over 25 MB (§12).

The workflow currently triggers on main; the repository’s default branch is master, so the trigger must be changed (or the branch renamed) for CI to run at all.

.github/workflows/release.yml packages the .vsix on a v*.*.* tag and attaches it to a GitHub release; its file name changes from the scaffold’s to softforge-ui-designer-<version>.vsix.