test(e2e): Account Management automation#981
Open
blockqa wants to merge 2 commits into
Open
Conversation
Add E2E coverage for Account Management (create account, import private key incl. XP-Chain and duplicate, recovery phrase, Ledger, keystore v4/v6, invalid keystore) with supporting data-testids, page object, constants, and CI secrets/keystore S3 sync. Also build the extension from the PR merge ref in the smoke workflow so the build and tests run against the same commit.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end automation for the Account Management area of the Core extension, including new Playwright coverage and the UI test hooks required to make those flows reliably automatable. Also updates CI workflows to align the built extension commit with the tests and to sync keystore fixtures from S3.
Changes:
- Added Playwright E2E spec + page object for Account Management flows (create account, import private key incl. duplicate, recovery phrase, Ledger, keystore v4/v6, invalid keystore).
- Added/propagated
data-testidattributes across Account Management UI components and shared primitives (wallet cards, address items, recovery phrase grid, etc.). - Updated E2E GitHub Actions workflows to avoid building from a stale ref and to download keystore fixtures from S3.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/tests/account-management.spec.ts | New Playwright spec covering Account Management flows and assertions. |
| e2e/pages/extension/AccountManagementPage.ts | New page object encapsulating Account Management interactions and navigation. |
| e2e/constants.ts | Adds env-backed constants for private key + keystore fixtures and expected XP address. |
| e2e/.gitignore | Ignores downloaded keystore fixture directories to prevent committing secrets. |
| e2e/.env.example | Documents new env vars/secrets required for Account Management import tests. |
| apps/next/src/pages/AccountManagement/components/Wallets/components/AccountListItem/AccountListItem.tsx | Adds data-testid to account list rows for stable selectors. |
| apps/next/src/pages/AccountManagement/components/ImportPrivateKey/components/ImportPrivateKeyForm.tsx | Adds testids for private key input and import button. |
| apps/next/src/pages/AccountManagement/components/ImportPrivateKey/components/DuplicatedAccountConfirmation.tsx | Adds testids for duplicate import screen and confirm button. |
| apps/next/src/pages/AccountManagement/components/ImportKeystoreFile/components/KeystoreFileUpload.tsx | Adds testids for keystore file input and “Next” button. |
| apps/next/src/pages/AccountManagement/components/ImportKeystoreFile/components/KeystoreFilePassword.tsx | Adds testids for keystore password input and import button. |
| apps/next/src/pages/AccountManagement/components/ImportKeystoreFile/components/KeystoreFileError.tsx | Adds testids for keystore error screen and “Try again” button. |
| apps/next/src/pages/AccountManagement/components/AddOrCreateWallet/components/FeatureFlaggedListItem.tsx | Threads optional testId through feature-flagged list items. |
| apps/next/src/pages/AccountManagement/components/AddOrCreateWallet/components/AccountListItem.tsx | Applies data-testid to add-wallet menu list items when provided. |
| apps/next/src/pages/AccountManagement/components/AddOrCreateWallet/AddOrConnectWalletButton.tsx | Adds testid to open the add/connect wallet menu. |
| apps/next/src/pages/AccountManagement/components/AddOrCreateWallet/AddOrConnectWallet.tsx | Adds testids for the add-wallet import options (private key, seedphrase, ledger, keystore). |
| apps/next/src/pages/AccountManagement/components/AddOrCreateWallet/AddAccountButton/AddAccountButton.tsx | Adds testid to “Add account” action. |
| apps/next/src/pages/AccountManagement/components/AccountDetails/components/AddressesCard.tsx | Passes testid to the X/P-chain address row for verification. |
| apps/next/src/components/WalletCard/WalletCard.tsx | Adds wallet-level testid and account-count testid for stable selectors. |
| apps/next/src/components/RecoveryPhraseForm/WordsGrid.tsx | Adds per-word data-testid hooks for recovery phrase import automation. |
| apps/next/src/components/Header/components/HeaderAccount/HeaderAccount.tsx | Adds testid to open Account Management from the header. |
| apps/next/src/components/ConnectLedger/ConnectAvalanche.tsx | Adds testid to the Ledger connection title for assertions. |
| apps/next/src/components/Address/AddressItem.tsx | Adds optional testid and data-address attribute to support address assertions. |
| .github/workflows/e2e_smoke_tests.yaml | Stops building from github.head_ref and adds keystore S3 sync for runs that need it. |
| .github/workflows/e2e_regression_tests.yaml | Adds keystore S3 sync and secrets wiring needed for the new regression tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use TEST_CONFIG.wallet/keystore instead of re-parsing env in the spec - Wait for the keystore import button to be enabled before clicking - Skip missing fixtures locally but fail loudly in CI (no silent coverage loss) - Only sync keystore fixtures from S3 on full smoke-workflow runs - Fix stale KEYSTORE_DIR doc reference in constants
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
e2e/tests/account-management.spec.ts+AccountManagementPage) for: create account, import private key (incl. XP-Chain and duplicate-key confirmation), recovery phrase, Ledger, keystore v4/v6, and invalid keystore. Adds the requireddata-testids to the Account Management source components, plus constants, CI secrets, and the keystore S3 sync. Mapped to TestRail viacustom_automation_idACC-001…ACC-009 (smoke = create-account; rest regression).github.head_ref, so the build and the tests run against the same commit (previously a stale branch could build an extension missing newer testids/DOM the tests expect).