fix(e2e): read username_domain from /api/info — unblock CI on Release PR - #153
Merged
Merged
Conversation
…zkcoins.app PR #98 made `username_domain` server-reported per stage — dev.zkcoins.app now serves `dev.zkcoins.app` as the domain, so addresses render as `xxx@dev.zkcoins.app` on DEV. The e2e helpers had `@zkcoins.app` hardcoded into the wallet-chip regex and the copy-button locator, turning the post-#98 frontend rollout into an E2E-globalSetup failure on every Release PR. Fix: lazy-load `username_domain` from /api/info once per test session (cached, no fallback to a hardcoded domain — fail loud if /api/info is unreachable so a misconfigured CI surface doesn't silently match the wrong stage). All consumers — globalSetup's address-chip wait, the copy-button locator, doc comments — now derive the suffix at runtime. Validation: - `npx prettier --check e2e/` clean - `npx tsc --noEmit` clean
Contributor
[OK] Button-Inventory-Audit — all clearChecked 72 testid(s) in |
Subagent fix only touched the helpers; three specs had the chip-
locator inlined as `text=/[0-9a-f]{8}@zkcoins\\.app/` and so still
hard-coded the PRD suffix. Hook them onto the same
`getUsernameDomain()` + `zkAddressRegex()` pair as the helpers.
TaprootFreak
marked this pull request as ready for review
June 1, 2026 22:39
TaprootFreak
added a commit
that referenced
this pull request
Jun 1, 2026
… PR (#153) (#154) * fix(e2e): read username_domain from /api/info instead of hardcoding @zkcoins.app PR #98 made `username_domain` server-reported per stage — dev.zkcoins.app now serves `dev.zkcoins.app` as the domain, so addresses render as `xxx@dev.zkcoins.app` on DEV. The e2e helpers had `@zkcoins.app` hardcoded into the wallet-chip regex and the copy-button locator, turning the post-#98 frontend rollout into an E2E-globalSetup failure on every Release PR. Fix: lazy-load `username_domain` from /api/info once per test session (cached, no fallback to a hardcoded domain — fail loud if /api/info is unreachable so a misconfigured CI surface doesn't silently match the wrong stage). All consumers — globalSetup's address-chip wait, the copy-button locator, doc comments — now derive the suffix at runtime. Validation: - `npx prettier --check e2e/` clean - `npx tsc --noEmit` clean * fix(e2e): use dynamic zkAddressRegex in specs 02/03/04 too Subagent fix only touched the helpers; three specs had the chip- locator inlined as `text=/[0-9a-f]{8}@zkcoins\\.app/` and so still hard-coded the PRD suffix. Hook them onto the same `getUsernameDomain()` + `zkAddressRegex()` pair as the helpers. * fix(e2e): also remove hardcoded chip regex in 08-receive.spec.ts Co-authored-by: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #98 made
username_domainserver-reported per stage. The DEV node now answersusername_domain: "dev.zkcoins.app", so the wallet renders addresses asxxx@dev.zkcoins.appon DEV. The e2e helpers still had@zkcoins.appPRD-hardcoded in the address-chip regex and the copy-button locator — turning the post-#98 server rollout into an E2EglobalSetupfailure on every Release PR (most recently #152 just now).Fix
Lazy-load
username_domainfrom/api/infoonce per test session ine2e/_helpers/api.ts:cachedUsernameDomain)getUsernameDomain()(async, fetches once, cached)zkAddressRegex(domain)pure builder/api/infois unreachable or the field is missing — no silent fallback to a hardcoded PRD domain (would match the wrong stage)All consumers updated:
e2e/_helpers/wallet.ts—createSeedWallet,restoreSeedWallet,unlockWithPasswordnow derive the chip regex + copy-button locator at runtimee2e/_helpers/screenshot.ts—defaultMasksnow async, uses the dynamic regex for the chip mask;snap()awaits it (caller was already async, no public-API break)wallet.ts,05-disconnect.spec.ts,README.mdalignedTest plan
npx prettier --check e2e/— cleannpx tsc --noEmit— clean for these changes (two pre-existingsrc/__tests__/errors unchanged from staging)@zkcoins.appregex against DEV servingdev.zkcoins.app