Files
bridge/e2e/package.json
T
zeekay e5b89d0c44 e2e: Playwright smoke + multi-tenant specs for tenant bridge SPA
Env-parametric specs covering bridge.lux.network (and bridge.zoo.network
+ future tenants). Mirrors the wider Lux e2e env routing convention:

  E2E_ENV=local (default) → http://localhost:3001 (auto-boots vite preview)
  E2E_ENV=dev             → https://bridge.lux-dev.network
  E2E_ENV=test            → https://bridge.lux-test.network
  E2E_ENV=main            → https://bridge.lux.network
  BRIDGE_TENANT=zoo       → https://bridge.zoo.network (mainnet only)

smoke.spec.ts (6 cases, ~16s):
  1. Renders, title matches brand, SVG brand logo from @luxfi/logo
  2. From-chain selector has ≥ 2 options
  3. From-asset selector has ≥ 2 options after switching to Ethereum
     (default chain Lux only has the native LUX asset)
  4. Connect-wallet button visible + clickable (no real wallet connect)
  5. Typing an amount updates the "You receive" estimate via useSwap
  6. Production gate: served HTML + JS bundles free of `DEADBEEF`
     (the dev-only stub MPC display address)

multi-tenant.spec.ts (skips unless E2E_ENV=main):
  - For each tenant in the registry, probe DNS, navigate, assert
    document.title and the --brand-primary CSS variable set by
    applyBrandMetadata reflect the tenant's pinned brand block.

Playwright config auto-boots `vite preview` on :3001 from app/bridge/
when E2E_ENV=local, so `pnpm test:smoke` is one-step after `pnpm build`.
README documents the build prereq and the runner contract.

Out of scope (TODOs in code):
  - Real wallet connect (Playwright wallet mocking is a separate PR)
  - Real backend swap submit (prod backend not reliably reachable from CI)
  - Visual regression / screenshot diffs (separate PR)
2026-05-21 17:00:58 -07:00

21 lines
628 B
JSON

{
"name": "@luxbridge/e2e",
"version": "1.0.0",
"private": true,
"description": "Playwright smoke + multi-tenant specs for bridge.lux.network and downstream tenants (Zoo, etc).",
"license": "MIT",
"type": "module",
"scripts": {
"test": "playwright test",
"test:smoke": "playwright test tests/smoke.spec.ts",
"test:multi-tenant": "playwright test tests/multi-tenant.spec.ts",
"test:headed": "playwright test --headed",
"install:browsers": "playwright install chromium"
},
"devDependencies": {
"@playwright/test": "^1.49.0",
"@types/node": "20.14.15",
"typescript": "5.7.2"
}
}