chore(wallet): remove self-custody Playwright e2e suite#3175
Conversation
Self-custody is being turned off in Console as part of AEP-84. The Playwright specs in apps/deploy-web/tests/ui/ that drove the self-custody wallet via an injected Leap extension will break the moment the feature flag flips, since the UI they exercise stops rendering. Delete those specs and their helpers so the remaining managed-wallet e2e suite keeps CI green. Kept playwright.config.ts, the test:e2e script, and @playwright/test because the managed-wallet-*.spec.ts files (added since the issue was filed) still rely on them. Pruned WebWallet/walletType plumbing from the shared DeployPage and dropped TEST_WALLET_MNEMONIC from the env schema and CI inputs. Closes CON-265
📝 WalkthroughWalkthroughThis PR removes wallet extension and web wallet mock testing infrastructure from deploy-web tests, including Leap extension automation helpers, browser context fixtures, web wallet injection mocking, dependent test specs, page objects, and related environment configuration. The ChangesWallet Extension and Web Wallet Testing Infrastructure Removal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3175 +/- ##
==========================================
+ Coverage 63.66% 63.70% +0.04%
==========================================
Files 1088 1089 +1
Lines 26411 26447 +36
Branches 6404 6417 +13
==========================================
+ Hits 16814 16849 +35
- Misses 8401 8402 +1
Partials 1196 1196
🚀 New features to boost your workflow:
|
Knip flagged @cosmjs/crypto as an unused devDependency after the self-custody Playwright suite was removed. It was only consumed by tests/ui/fixture/web-wallet/CosmjsWebWallet.ts (deleted in the previous commit).
The previous commit deleted UI-only Playwright specs (build-template, deploy-from-a-template, deploy-linux, custom-container-form) together with their page objects and the closeDeployments cleanup script. None of those specs actually drove a self-custody wallet flow — they only verify the new-deployment UI up to the "connect wallet" prompt, so they still pass after self-custody is turned off. Bring them back along with the closeDeployments.ts cleanup script and its CI wiring. Drop the now-removed walletType option from the custom container spec and re-add the fillImageName / generateSSHKeys helpers on DeployPage that those specs depend on. Truly self-custody specs (authorize-spending, change-wallets, deploy-self-custody-hello-world) remain removed.
sdl-builder-deployment.spec.ts only exercises the SDL builder UI (preview, add service, YAML structure) and stops at the "connect wallet" prompt — no self-custody flow. Got swept up in the self-custody removal alongside the other UI-only specs.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/deploy-web/tests/ui/pages/DeployPage.tsx (1)
45-47: 💤 Low valuePotential TypeError if
NETWORK_IDisn't a key inPROVIDERS_WHITELIST.If
testEnvConfig.NETWORK_IDyields a key not present inPROVIDERS_WHITELIST,providerswill beundefinedand.lengthwill throw.🛡️ Defensive fallback
- const providers = PROVIDERS_WHITELIST[testEnvConfig.NETWORK_ID]; + const providers = PROVIDERS_WHITELIST[testEnvConfig.NETWORK_ID] ?? [];🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/deploy-web/tests/ui/pages/DeployPage.tsx` around lines 45 - 47, The code assumes PROVIDERS_WHITELIST[testEnvConfig.NETWORK_ID] is defined before accessing .length; change to defensively handle missing keys by resolving providers to an array (e.g., use a fallback like an empty array) and then check its length before clicking: update the binding that assigns providers (referencing PROVIDERS_WHITELIST and testEnvConfig.NETWORK_ID) to ensure providers is always an array, then keep the existing conditional that uses providers.length to decide whether to call this.page.getByRole(...).first().click().
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/deploy-web/tests/ui/pages/DeployPage.tsx`:
- Around line 45-47: The code assumes
PROVIDERS_WHITELIST[testEnvConfig.NETWORK_ID] is defined before accessing
.length; change to defensively handle missing keys by resolving providers to an
array (e.g., use a fallback like an empty array) and then check its length
before clicking: update the binding that assigns providers (referencing
PROVIDERS_WHITELIST and testEnvConfig.NETWORK_ID) to ensure providers is always
an array, then keep the existing conditional that uses providers.length to
decide whether to call this.page.getByRole(...).first().click().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f39a5844-a63b-4c0c-980b-e45df9f80c3c
📒 Files selected for processing (2)
apps/deploy-web/tests/ui/custom-container-form.spec.tsapps/deploy-web/tests/ui/pages/DeployPage.tsx
Why
Self-custody is being turned off in Console next Monday as part of AEP-84 (Console split into Managed Platform and Self-Custodial Air). The Playwright specs in
apps/deploy-web/tests/ui/that drove the self-custody flows via an injected Leap extension will start failing CI the moment the feature flag flips, since the UI they exercise will stop rendering. Removing them now keeps the release pipeline green through the cutover.Closes CON-265
What
Scope adjustment vs. the issue body: CON-265 was filed when
tests/ui/was self-custody-exclusive, so its acceptance criteria called for nuking the whole directory plusplaywright.config.tsand thetest:e2escript. Since then, sixmanaged-wallet-*.spec.tsfiles (onboarding, deployment, alerts, api-keys, credits, notification-channels) have landed in the same directory and share fixtures/page-objects. This PR is therefore a surgical removal that preserves the managed-wallet suite — config,test:e2escript, and@playwright/testall stay.The cut is narrower than the first pass: several specs in
tests/ui/only exercised the new-deployment UI up to the "connect wallet" prompt and never actually drove a self-custody wallet. Those — and their page objects, plus thecloseDeploymentspost-run cleanup — stay.Deleted (genuinely self-custody)
authorize-spending,change-wallets,deploy-self-custody-hello-worldcontext-with-extension,wallet-setup,testing-helpers,fixture/web-wallet/*WebWallet,AuthorizationsPageactions/selectChainNetwork,uiState/isWalletConnectedKept (wallet-agnostic UI checks)
build-template,custom-container-form,deploy-from-a-template,deploy-linux,sdl-builder-deploymentBuildTemplatePage,PlainLinuxPageapps/deploy-web/script/closeDeployments.ts+ its CI cleanup step — still useful as post-run cleanup of any test deployments left behind on sandbox.Modified
tests/ui/pages/DeployPage.tsx— droppedWebWalletimport,walletType/feeType/SignOptionsplumbing,signTransaction,withTxAccepted,createDeployment,validateLeaseAndClose. Managed flow only ever passedwalletType: "api", so the extension branch was dead code.fillImageName/generateSSHKeysstay — used by the kept specs.tests/ui/custom-container-form.spec.ts— dropped the now-removed{ walletType: "extension" }constructor arg; the test only verifies the "connect wallet" prompt.tests/ui/fixture/test-env.config.ts— droppedTEST_WALLET_MNEMONICfrom the schema (still consumed viaprocess.envby the cleanup script). KeptNETWORK_ID+PROVIDERS_WHITELISTbecause the sharedcreateLease(still used by managed specs) consumes them.managed-wallet-{alerts,deployment}.spec.ts— dropped the now-defaulted{ walletType: "api" }constructor arg.Kept (verified still used)
playwright.config.ts,npm run test:e2e,@playwright/test@cosmjs/*,@akashnetwork/chain-sdk,@akashnetwork/net— confirmed used bysrc/(wallet context, custom registry, faucet, etc.); not test-only.authenticated-test,onboarding-test,base-test), services (auth0-management,email-verification).Follow-ups
src/components/...onmain. Not addressed here.Test plan
grep -rE "context-with-extension|web-wallet|WebWallet|AuthorizationsPage|selectChainNetwork|isWalletConnected" apps/deploy-webreturns nothingnpx tsc --noEmitinapps/deploy-web— no new errors intests/ui/(pre-existing count unchanged)npx eslint tests/ui— cleannpm run test:unit -w apps/deploy-web— no new failuresconsole-web-ui-testingaction — confirm managed-wallet specs and the kept UI-only specs run and passSummary by CodeRabbit
Tests
Chores
@cosmjs/cryptodependency from build configuration.