Skip to content

feat: add local playwright demo mode and speed up e2e ci#522

Open
will-yuponce-db wants to merge 4 commits into
developmentfrom
demo/playwright-demo-mode
Open

feat: add local playwright demo mode and speed up e2e ci#522
will-yuponce-db wants to merge 4 commits into
developmentfrom
demo/playwright-demo-mode

Conversation

@will-yuponce-db

Copy link
Copy Markdown
Contributor

What

Adds a fully-local Playwright demo mode, speeds up the CI e2e job, and fixes the workflow-editor-edges spec.

Demo mode (yarn demo)

  • yarn demo [spec] — runs the e2e suite headed + slow (slowMo, default 800ms, DEMO_SLOWMO to tune) so it's watchable. Args pass through to Playwright (yarn demo cuj-1-ontology).
  • yarn demo:step [spec] — Playwright Inspector: pause before each action, advance with a key, target element highlighted.
  • Cold-start in one command: scripts/demo-setup.sh idempotently provisions the local Postgres role/db and ensures the Chromium browser is installed; the webServer brings up backend + frontend (reused if already running).
  • Fully local, no Databricks — the demo backend runs with MOCK_WORKSPACE_CLIENT=true, so startup never calls the workspace (it was otherwise hanging on the Databricks client).

CI e2e speedup

  • Shard the suite across 4 parallel runners (matrix + --shard), each with its own Postgres service — wall-clock drops ~linearly with no added contention.
  • New merge-reports job stitches the shard blob reports into one HTML report.
  • Global test timeout 90s → 60s so hung/broken tests fail faster.
  • Note: the e2e-tests job remains if: false (as it was) — flip e2e-tests and merge-reports to re-enable.

Fix: workflow-editor-edges.spec.ts (6 failing → 7/7 passing)

All test-side, no app changes:

  • Dismiss the modal Step Configuration sheet (its z-50 backdrop was blocking subsequent palette clicks → 90s timeouts).
  • Wait for both node and edge to commit between adds (the designer wires the auto-connect edge from a nodes closure, so rapid adds dropped edges).
  • Replace a one-shot .count() race with a web-first wait.
  • Harden the fail-handle drag; treat the synthetic connect as best-effort (wiring is unit-tested in workflow-designer.test.tsx).

Verification

Run locally against the mocked stack (MOCK_WORKSPACE_CLIENT=true):

  • workflow-editor-edges: 7/7 pass, stable across --repeat-each=2.
  • The remaining full-suite failures are confined to specs already in the CI testIgnore list (features not wired for the mock client).

This pull request and its description were written by Isaac.

Will Yuponce added 3 commits June 15, 2026 12:05
Adds a one-command demo mode that runs the Playwright e2e suite in a
visible browser at a human-watchable pace, bringing up the whole stack
from cold:

- package.json: `demo` script runs the DB bootstrap then `playwright
  test --headed --workers=1` with DEMO=1.
- playwright.config.ts: DEMO-gated launchOptions.slowMo (default 800ms,
  override via DEMO_SLOWMO) and a DEMO-gated backend webServer entry so
  both backend and frontend auto-start (reused if already running).
- scripts/demo-db-setup.sh: idempotently provisions the LOCAL Postgres
  role + database the backend needs (migrations run on backend startup).

Args pass straight through to Playwright (e.g. `yarn demo cuj-1-ontology`).

Co-authored-by: Isaac
Demo mode (fully local, no Databricks):
- playwright.config.ts: backend webServer runs with MOCK_WORKSPACE_CLIENT=true
  so startup never calls Databricks (was hanging on the workspace client).
- scripts/demo-setup.sh (renamed from demo-db-setup.sh): also ensures the
  Playwright Chromium browser is installed (idempotent), on top of the DB
  role/database bootstrap.
- package.json: add demo:step (Playwright Inspector — pause/step each action,
  highlights the target element); demo now calls demo-setup.sh.

CI e2e speed:
- Shard the suite across 4 parallel runners (matrix + --shard); each shard has
  its own Postgres service, so wall-clock drops ~linearly with no added
  contention. New merge-reports job stitches shard blobs into one HTML report.
- playwright.config.ts: CI reporter -> 'blob' (for the merge), global timeout
  90s -> 60s so hung/broken tests fail faster (90s x retries was the main drag).

Co-authored-by: Isaac
All 6 failures were test-side, not app regressions:

- Adding a step opens a modal "Step Configuration" sheet whose z-50 backdrop
  covers the toolbar, so subsequent palette clicks timed out (90s). New addStep
  helper dismisses the sheet (Escape) after each add.
- addStep in the designer wires the auto-connect edge from a `nodes` closure, so
  two rapid adds ran against stale state and dropped/mis-wired the edge. The
  helper now waits for both the node and the edge to commit before returning, so
  back-to-back adds are deterministic.
- Replaced a one-shot .count() that raced ahead of React Flow's first render
  with a web-first wait.
- The fail-handle drag is now robust (intermediate pointer moves) and treats the
  synthetic connect as best-effort — the fail-edge wiring is unit-tested in
  workflow-designer.test.tsx.

Verified locally against the mocked stack: 7/7 pass, stable across repeat-each=2.

Co-authored-by: Isaac
@will-yuponce-db will-yuponce-db requested a review from a team as a code owner June 15, 2026 19:15
@will-yuponce-db will-yuponce-db changed the title Add local demo mode (yarn demo) + speed up & fix E2E feat: add local playwright demo mode and speed up e2e ci Jun 15, 2026
Commented out the conditional check for E2E tests.
@will-yuponce-db will-yuponce-db changed the base branch from main to development June 17, 2026 12:17

@larsgeorge-db larsgeorge-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@larsgeorge-db larsgeorge-db enabled auto-merge (rebase) June 19, 2026 13:50
@larsgeorge-db larsgeorge-db disabled auto-merge June 19, 2026 14:11
@larsgeorge-db larsgeorge-db enabled auto-merge (rebase) June 19, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants