Skip to content

test(viewer): Cypress 15 + run e2e against live deployments#252

Merged
jamesdabbs merged 3 commits into
mainfrom
test/viewer-e2e-multi-target
Jun 28, 2026
Merged

test(viewer): Cypress 15 + run e2e against live deployments#252
jamesdabbs merged 3 commits into
mainfrom
test/viewer-e2e-multi-target

Conversation

@jamesdabbs

@jamesdabbs jamesdabbs commented Jun 28, 2026

Copy link
Copy Markdown
Member

Reworks the viewer e2e suite so one set of specs can validate every deployment — local fixture, production Pages, and the new Workers site — and runs the deployed targets against their real R2 bundle to confirm Pages and Workers serve identical content. Supports the Workers migration. Also bumps Cypress 14 → 15.

CYPRESS_ENV picks the target (and its data mode); default stays local/fixture, so CI is unchanged and hermetic.

Review notes

Easiest to review commit-by-commit:

  1. Cypress 14 → 15 + retries — dependency bump; retries absorb transient flake on live runs. No usage hits any v15 breaking change.
  2. Run e2e against live deploymentscypress.config.ts resolves CYPRESS_ENV{ baseUrl, mode }; setup() only intercepts the bundle in fixture mode. bin/e2e takes targets (default = pages+workers consistency check). Start at cypress.config.ts and doc/testing.md.
  3. Refresh fixture so the full suite runs live — two specs were skipped on live because fixture space names had drifted; their display names/assertions are refreshed to hold in both modes. ⚠️ Only per-entity display fields were touched — the fixture predates a property-ID reorg, so a bulk by-uid remap would corrupt the trait/theorem corpus.

Validation

Fixture 16/16; live pages 16/16; live workers 16/16 (identical to pages).

preview needs PREVIEW_URL (Workers preview URLs are per-version, not per-branch) — automating per-PR previews is a possible follow-up.

Bump cypress 14.3.2 → 15.18.0. Node 22 satisfies v15's engines
(^20.1 || ^22 || >=24) and none of v15's breaking changes touch how we
use it (no component testing, no cy.stub 3-arg, no SelectorPlayground).
v15 routing cy.url()/location()/title() through CDP/BiDi is a plus when
pointing at live cross-origin deployments. Test Replay comes for free on
`cypress run --record` (already used in CI).

Add `retries: { runMode: 2, openMode: 0 }` to absorb transient flake on
remote/live runs (network hiccups, async client-side deduction).

Verified 16/16 green in the hermetic path (local build + fixture).
Add a CYPRESS_ENV target axis that resolves both the base URL and a data
mode (fixture | live). local/CI stay hermetic (intercept the bundle with
main.min.json); deployed targets (pages, workers, graphs, preview) run
against the site's real R2 bundle, so we verify the actual deployments and
their cross-consistency.

- cypress.config.ts: resolveTarget() -> { baseUrl, mode }; expose mode via
  Cypress.env. Workers URLs added; preview reads PREVIEW_URL (per-version).
- support: setup() intercepts only in fixture mode; add fixtureOnly() to
  skip exact, fixture-pinned assertions on live runs.
- deduction/typesetting: move fixture-specific assertions (renumbered space
  IDs, snapshotted KaTeX HTML) under fixtureOnly; data-stable deduction
  checks still run live.
- bin/e2e: take targets (default pages+workers consistency check) and
  health-check each; package scripts cy:run:{pages,workers,preview,graphs}.
- doc/testing.md: document fixture vs live and the target table.

Verified: hermetic 16/16; live pages and workers each 14 passed /
2 fixture-only skipped / 0 failed (identical).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
pi-base-topology e1e8fb9 Commit Preview URL

Branch Preview URL
Jun 28 2026, 05:51 AM

@jamesdabbs jamesdabbs self-assigned this Jun 28, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying topology with  Cloudflare Pages  Cloudflare Pages

Latest commit: e1e8fb9
Status: ✅  Deploy successful!
Preview URL: https://34187df6.topology.pages.dev
Branch Preview URL: https://test-viewer-e2e-multi-target.topology.pages.dev

View logs

These two specs were fixtureOnly because the curated fixture's space names had
drifted from live (live now embeds LaTeX, e.g. S000001 = "Discrete topology on
$\{0,1\}$"). Refresh the two tested spaces' display name/aliases (S000001,
S000004) to current live values and rewrite the assertions to hold in both
modes: a math-free name prefix for deduction, and a behavioral check (refs
resolve; embedded math is typeset via KaTeX) instead of an exact HTML snapshot
for typesetting. Drop the now-unused fixtureOnly helper.

NB: the fixture predates a pi-base property-ID reorganization, so its property
uids are NOT interchangeable with the live bundle's — only per-entity display
fields were refreshed (a bulk by-uid remap would corrupt the trait/theorem
corpus).

Verified: hermetic 16/16; live pages and workers each 16/16 (identical) — the
full suite now runs against the live deployments.
@jamesdabbs jamesdabbs marked this pull request as ready for review June 28, 2026 14:19
@jamesdabbs jamesdabbs merged commit 471ed4f into main Jun 28, 2026
4 checks passed
@jamesdabbs jamesdabbs deleted the test/viewer-e2e-multi-target branch June 28, 2026 14:19
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.

1 participant