Skip to content

chore(wallet): remove self-custody Playwright e2e suite#3175

Merged
baktun14 merged 4 commits into
mainfrom
chore/deploy-web-remove-self-custody-e2e
May 19, 2026
Merged

chore(wallet): remove self-custody Playwright e2e suite#3175
baktun14 merged 4 commits into
mainfrom
chore/deploy-web-remove-self-custody-e2e

Conversation

@baktun14
Copy link
Copy Markdown
Contributor

@baktun14 baktun14 commented May 14, 2026

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 plus playwright.config.ts and the test:e2e script. Since then, six managed-wallet-*.spec.ts files (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:e2e script, and @playwright/test all 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 the closeDeployments post-run cleanup — stay.

Deleted (genuinely self-custody)

  • Specs: authorize-spending, change-wallets, deploy-self-custody-hello-world
  • Fixtures: context-with-extension, wallet-setup, testing-helpers, fixture/web-wallet/*
  • Page objects: WebWallet, AuthorizationsPage
  • actions/selectChainNetwork, uiState/isWalletConnected

Kept (wallet-agnostic UI checks)

  • Specs: build-template, custom-container-form, deploy-from-a-template, deploy-linux, sdl-builder-deployment
  • Page objects: BuildTemplatePage, PlainLinuxPage
  • apps/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 — dropped WebWallet import, walletType/feeType/SignOptions plumbing, signTransaction, withTxAccepted, createDeployment, validateLeaseAndClose. Managed flow only ever passed walletType: "api", so the extension branch was dead code. fillImageName / generateSSHKeys stay — 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 — dropped TEST_WALLET_MNEMONIC from the schema (still consumed via process.env by the cleanup script). Kept NETWORK_ID + PROVIDERS_WHITELIST because the shared createLease (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 by src/ (wallet context, custom registry, faucet, etc.); not test-only.
  • Managed-wallet specs, fixtures (authenticated-test, onboarding-test, base-test), services (auth0-management, email-verification).

Follow-ups

  • 117 pre-existing tsc errors and 3 pre-existing unit-test failures exist in src/components/... on main. Not addressed here.

Test plan

  • Self-custody traces gone — grep -rE "context-with-extension|web-wallet|WebWallet|AuthorizationsPage|selectChainNetwork|isWalletConnected" apps/deploy-web returns nothing
  • npx tsc --noEmit in apps/deploy-web — no new errors in tests/ui/ (pre-existing count unchanged)
  • npx eslint tests/ui — clean
  • npm run test:unit -w apps/deploy-web — no new failures
  • Beta release run of the console-web-ui-testing action — confirm managed-wallet specs and the kept UI-only specs run and pass

Summary by CodeRabbit

  • Tests

    • Removed multiple UI test specifications and test fixtures related to wallet extension testing, authorization workflows, and specific deployment scenarios.
    • Simplified test configuration by removing wallet-type and fee-type parameters from test setup.
  • Chores

    • Removed @cosmjs/crypto dependency from build configuration.

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
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

📝 Walkthrough

Walkthrough

This 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 DeployPage class is simplified by removing transaction-signing and wallet-type options. Dependency @cosmjs/crypto is removed from package.json.

Changes

Wallet Extension and Web Wallet Testing Infrastructure Removal

Layer / File(s) Summary
Extension and web wallet fixture removal
apps/deploy-web/tests/ui/fixture/wallet-setup.ts, apps/deploy-web/tests/ui/fixture/context-with-extension.ts, apps/deploy-web/tests/ui/fixture/testing-helpers.ts, apps/deploy-web/tests/ui/fixture/web-wallet/*
Removed complete Leap extension automation suite (getExtensionPage, setupWallet, createWallet, connectWalletViaLeap, approveWalletOperation, topUpWallet, restoreExtensionStorage), browser context fixture setup (test, expect, createPage, ExtensionContext), UI interaction helpers (clickWalletSelectorDropdown, clickConnectWalletButton, clickCopyAddressButton), and web wallet mocking infrastructure (injectWebWallet, initLeapWebWalletMock, CosmjsWebWallet).
Test specs depending on extension/wallet infrastructure
apps/deploy-web/tests/ui/authorize-spending.spec.ts, apps/deploy-web/tests/ui/change-wallets.spec.ts, apps/deploy-web/tests/ui/deploy-self-custody-hello-world.spec.ts, apps/deploy-web/tests/ui/sdl-builder-deployment.spec.ts
Removed entire test files that relied on extension wallet setup, wallet switching, approval popups, and web wallet mocking for self-custody and authorization flows.
DeployPage simplification and wallet-type option removal
apps/deploy-web/tests/ui/pages/DeployPage.tsx, apps/deploy-web/tests/ui/custom-container-form.spec.ts, apps/deploy-web/tests/ui/managed-wallet-alerts.spec.ts, apps/deploy-web/tests/ui/managed-wallet-deployment.spec.ts
Removed SignOptions, WalletType, FeeType types and constructor options from DeployPage; removed createDeployment(), validateLeaseAndClose(), and transaction-signing helpers (withTxAccepted, signTransaction); simplified createLease() to skip transaction-acceptance wrapper. Updated all test instantiations to pass only context and page without wallet-type overrides.
Page object and state helper removal
apps/deploy-web/tests/ui/pages/AuthorizationsPage.tsx, apps/deploy-web/tests/ui/pages/WebWallet.ts, apps/deploy-web/tests/ui/uiState/isWalletConnected.ts, apps/deploy-web/tests/ui/actions/selectChainNetwork.ts
Removed authorization page object (AuthorizationsPage, AuthorizationType), web wallet page object (WebWallet class with acceptTransaction, switchToNewWallet, disconnectWallet methods), and wallet state helpers (isWalletConnected, selectChainNetwork).
Environment and dependency cleanup
apps/deploy-web/tests/ui/fixture/test-env.config.ts, apps/deploy-web/package.json
Removed TEST_WALLET_MNEMONIC from testEnvSchema and testEnvConfig; removed @cosmjs/crypto dev dependency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • akash-network/console#3099: Directly related—this PR removes the managed-deployment test infrastructure and wallet/page fixtures that #3099 introduced.
  • akash-network/console#2990: Overlaps on removal of cosmjs/web-wallet testing approach (WebWallet.ts, injectWebWallet.ts, initLeapWebWalletMock.ts, context-with-extension.ts).

Suggested labels

size: L

Suggested reviewers

  • ygrishajev
  • stalniy
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/deploy-web-remove-self-custody-e2e

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.70%. Comparing base (02783ca) to head (54ec35e).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

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              
Flag Coverage Δ
api 84.32% <ø> (ø)
deploy-web 46.67% <ø> (-0.01%) ⬇️
log-collector 85.85% <ø> (ø)
notifications 91.06% <ø> (ø)
provider-console 81.48% <ø> (ø)
provider-inventory 81.23% <ø> (ø)
provider-proxy 86.08% <ø> (+0.87%) ⬆️
tx-signer 78.14% <ø> (ø)
see 7 files with indirect coverage changes
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

baktun14 added 3 commits May 13, 2026 22:37
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.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/deploy-web/tests/ui/pages/DeployPage.tsx (1)

45-47: 💤 Low value

Potential TypeError if NETWORK_ID isn't a key in PROVIDERS_WHITELIST.

If testEnvConfig.NETWORK_ID yields a key not present in PROVIDERS_WHITELIST, providers will be undefined and .length will 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

📥 Commits

Reviewing files that changed from the base of the PR and between a6e74c4 and 6fb4475.

📒 Files selected for processing (2)
  • apps/deploy-web/tests/ui/custom-container-form.spec.ts
  • apps/deploy-web/tests/ui/pages/DeployPage.tsx

@baktun14 baktun14 added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 92cb5fd May 19, 2026
57 checks passed
@baktun14 baktun14 deleted the chore/deploy-web-remove-self-custody-e2e branch May 19, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants