Skip to content

Add 1p wallet chooser layout test suite + harness (tooling only)#179

Merged
dlongley merged 7 commits into
mainfrom
add-1p-dialog-test-harness-tooling-only
Jun 14, 2026
Merged

Add 1p wallet chooser layout test suite + harness (tooling only)#179
dlongley merged 7 commits into
mainfrom
add-1p-dialog-test-harness-tooling-only

Conversation

@djscruggs

@djscruggs djscruggs commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Lands the automated test tooling for the first party wallet chooser dialog with no style changes, so the dialog's CSS can be reworked later against code we own — after the components we use are pulled out of vue-web-request-mediator and that dependency is removed.

This supersedes the tooling portion of #177. #177 also changed web/app.less; this branch deliberately does not (web/app.less is byte-identical to main).

What's here

  • Dev-only harness route/test/wallet-chooser?hints=N&qr=1 mounts the presentational dialog with fake state across wallet counts (0/1/5/15) and the cross-device QR section. No CHAPI registration, wallets, popups, or certs. Excluded from production builds (NODE_ENV !== 'production').
  • Layout suite (npm run test:e2e) — Playwright geometric invariants on desktop Chromium, WebKit, Firefox + emulated iPhone 15 and Pixel 7. Asserts structure, not pixels: expected hints render, no scrollbar, header pinned while the list scrolls, panel fills the popup, header border bleeds edge-to-edge, expander/QR behave per wallet count. A small custom reporter (test/e2e/totalsReporter.js) prints an explicit Totals: N/M passed line at the end of the run, alongside the default list output, so the total test count is visible without scrolling up and summing the per-outcome counts (currently 215 = 43 states/assertions × 5 browser projects).
  • Screenshot gallery (npm run gallery) — every state × theme × engine, collapsed and expanded, with an index.html contact sheet. Output in the git-ignored test/e2e/gallery/.
  • README documents both commands; CHANGELOG entry added (7.5.0).

One intentionally-failing test

has no horizontal overflow is an active test that fails today — left red on purpose, not skipped or fixme'd. It fails because the dialog still relies on the overflow-x: hidden band-aid to hide a real overflow (the headers/separators bleed their border with a negative side-margin that overhangs the border-box flex layout). Running npm run test:e2e locally shows it red as a standing reminder of the deferred CSS work. Once the styles are reworked (see Sequencing), it turns green and proves the band-aid can be removed.

Testing

npm run test:e2e locally → Totals: 190/215 passed · 25 failed. The 25 failures are the has no horizontal overflow cases (one per wallet-count state × 5 engines), which fail as described above; everything else is green. npm run gallery green; lint clean; web/app.less unchanged from main.

CI: deferred for now

This PR intentionally does not run the layout suite in CI — the lint workflow is unchanged, and there's no test-e2e job. If we wired it in now, that job would be red on every push/PR because of the intentionally-failing overflow test above. Our deploy (packaging.yml) triggers on v* tags and does not depend on the test workflow, so a red suite wouldn't actually block a release — but a perpetually-failing check is noise we don't want while the CSS fix is outstanding.

How to add it later (once the overflow test passes), as a sibling of the lint job in .github/workflows/main.yml:

  test-e2e:
    runs-on: ubuntu-latest
    timeout-minutes: 20
    strategy:
      matrix:
        node-version: [24.x]
    steps:
    - uses: actions/checkout@v6
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v6
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install
    # the dev server binds the `authn.localhost` domain; map it to loopback
    - run: echo "127.0.0.1 authn.localhost" | sudo tee -a /etc/hosts
    - run: npx playwright install --with-deps chromium webkit firefox
    - run: npm run test:e2e

Verified working: this exact job ran green in CI on an earlier commit of this branch (lint 30s, e2e ~2m18s across all five projects) before the overflow test was made active. Optionally pair it with the github Playwright reporter (reporter: process.env.CI ? [['list'], ['github']] : 'list') to surface failed/skipped tests as inline annotations on the PR.

Sequencing (after this lands)

  1. Pull the used vue-web-request-mediator pieces into authn.io and drop the dependency.
  2. Rework the dialog CSS against owned code; the has no horizontal overflow test then passes, and CI can be wired in per the snippet above.

Land the automated tooling on its own, with no style changes, so the
dialog's CSS can be reworked later against code we own (after the
components we use are pulled out of vue-web-request-mediator and that
dependency is removed).

- Add a dev-only `/test/wallet-chooser` harness route that mounts the
  presentational dialog with fake state across wallet counts and the
  cross-device QR section. Excluded from production builds.
- Add a Playwright geometric-invariant suite (`npm run test:e2e`) on
  desktop Chromium, WebKit, and Firefox plus emulated iPhone and Pixel
  sizes: expected hints render, no scrollbar, header pinned while the
  list scrolls, panel fills the popup, header border bleeds edge to
  edge, expander/QR behave per wallet count.
- Add a screenshot gallery (`npm run gallery`) that captures every
  state across themes and engines and builds a contact sheet.
- Document both commands in the README.

`web/app.less` is unchanged from main; no production behavior or styles
change. The strict "no horizontal overflow" assertion is skipped: it
fails only because the dialog still relies on the `overflow-x: hidden`
band-aid to hide a real overflow, which is the deferred CSS work. The
test stays in the suite as the guard that will prove the band-aid can
be removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
djscruggs and others added 4 commits June 14, 2026 08:50
`test.fixme` reports the deferred "has no horizontal overflow" check as
a known-broken test to re-enable, instead of a silent skip, so the CSS
rework that removes the `overflow-x: hidden` band-aid is visible in the
runner output as outstanding work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a `test-e2e` job as a sibling of the lint job (both run in
parallel, no `needs:`). It installs the Playwright browsers, maps the
`authn.localhost` server domain to loopback so the auto-started dev
server is reachable, and runs `npm run test:e2e` across the desktop
and emulated-phone projects.

Set `permissions: {}` and rename the workflow to reflect that it now
lints and tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In CI, emit the `github` reporter alongside `list` so failed and
skipped/fixme tests surface as inline GitHub annotations on the run and
PR, instead of collapsing into the summary's skipped count. Keep plain
`list` locally, where the workflow-command output is just noise.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hold off on running the layout suite in CI for now. Revert the
`test-e2e` workflow job and the CI-only `github` reporter, leaving the
lint workflow as it was.

Leave the "has no horizontal overflow" test active (not skipped or
fixme) rather than green-by-deferral. It fails today against the
band-aid CSS, so a local `npm run test:e2e` run shows it red as a
standing reminder of the deferred CSS rework; since the suite is not in
CI, the failure gates nothing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@djscruggs djscruggs marked this pull request as ready for review June 14, 2026 14:47
@djscruggs djscruggs requested a review from dlongley June 14, 2026 14:47
Comment thread package.json Outdated
Assembling this branch pulled `package.json`/`package-lock.json` from an
older harness branch cut before `main` reached 7.4.4, which dragged its
stale `7.4.3` version back in — a backwards version bump. Set the
version to 7.5.0 to match the CHANGELOG entry for the added tooling, and
sync the lockfile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@dlongley dlongley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, I'll apply my suggestions and merge this in.

Comment thread package.json Outdated
Comment thread playwright.config.js Outdated
Comment thread test/e2e/build-gallery-index.js Outdated
Comment thread test/e2e/gallery.spec.js Outdated
Comment thread test/e2e/wallet-chooser.spec.js Outdated
Comment thread web/routes/TestWalletChooser.vue Outdated
Comment thread web/router.js Outdated
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
@dlongley dlongley merged commit edd522a into main Jun 14, 2026
1 check passed
@dlongley dlongley deleted the add-1p-dialog-test-harness-tooling-only branch June 14, 2026 18:08
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.

3 participants