Skip to content

Commit 5181212

Browse files
authored
test: update onboarding fixture and paths (#38232)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR is in preparation for the upcoming work around fixtures. It does - Moves the related fixtures files to the `fixtures` and updates all paths - Updates the onboarding-fixture.json to the latest state and adds the related changes in specs <img width="283" height="165" alt="image" src="https://github.com/user-attachments/assets/bc3cb26c-d863-4e2c-89a8-5edcfec39485" /> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/38232?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** 1. Check ci ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Moves E2E fixtures into `test/e2e/fixtures`, updates all import paths, and adjusts specs (balances/flows) to align with the updated onboarding fixture. > > - **E2E / Fixtures Migration**: > - Move fixture files to `test/e2e/fixtures/` and update imports for `FixtureBuilder`, `default-fixture`, and `fixture-server` across tests and helpers. > - **Onboarding & Flows Updates**: > - Update specs to match the new onboarding fixture/state: adjust expected balances (e.g., `$127,500.00`, `$5,100.00`) and remove interactions like `clickBackupRemindMeLaterButton`. > - Align various confirmation/permissions/network tests with updated flows where necessary. > - **Broad Test Touches**: > - Apply path updates across Flask, snaps, networks, tokens, hardware wallets, request-queuing, PPOM, metrics, multichain, Solana, and other suites. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 4373ad9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 85115d6 commit 5181212

File tree

323 files changed

+896
-1352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+896
-1352
lines changed

app/scripts/background.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,8 @@ export async function loadStateFromPersistence(backup) {
918918
migrations,
919919
defaultVersion: process.env.WITH_STATE
920920
? // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, node/global-require
921-
require('../../test/e2e/default-fixture').FIXTURE_STATE_METADATA_VERSION
921+
require('../../test/e2e/fixtures/fixture-builder')
922+
.FIXTURE_STATE_METADATA_VERSION
922923
: null,
923924
});
924925

app/scripts/fixtures/generate-wallet-state.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import { cloneDeep } from 'lodash';
55
import { hexToDecimal } from '../../../shared/modules/conversion.utils';
66
import { UI_NOTIFICATIONS } from '../../../shared/notifications';
77
import { WALLET_PASSWORD } from '../../../test/e2e/constants';
8-
import { E2E_SRP, defaultFixture } from '../../../test/e2e/default-fixture';
9-
import FixtureBuilder from '../../../test/e2e/fixture-builder';
8+
import {
9+
E2E_SRP,
10+
defaultFixture,
11+
} from '../../../test/e2e/fixtures/default-fixture';
12+
import FixtureBuilder from '../../../test/e2e/fixtures/fixture-builder';
1013
import { encryptorFactory } from '../lib/encryptor-factory';
1114
import { normalizeSafeAddress } from '../lib/multichain/address';
1215
import { getRootMessenger } from '../lib/messenger';

test/e2e/accounts/snap-account-eth-swap.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { withFixtures, WINDOW_TITLES } from '../helpers';
22
import { Driver } from '../webdriver/driver';
3-
import FixtureBuilder from '../fixture-builder';
3+
import FixtureBuilder from '../fixtures/fixture-builder';
44
import {
55
buildQuote,
66
reviewQuote,

test/e2e/benchmarks/benchmark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
getFirstParentDirectoryThatExists,
1212
isWritable,
1313
} from '../../helpers/file';
14-
import FixtureBuilder from '../fixture-builder';
14+
import FixtureBuilder from '../fixtures/fixture-builder';
1515
import { unlockWallet, withFixtures } from '../helpers';
1616
import AccountListPage from '../page-objects/pages/account-list-page';
1717
import HeaderNavbar from '../page-objects/pages/header-navbar';

test/e2e/benchmarks/user-actions-benchmark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
getFirstParentDirectoryThatExists,
99
isWritable,
1010
} from '../../helpers/file';
11-
import FixtureBuilder from '../fixture-builder';
11+
import FixtureBuilder from '../fixtures/fixture-builder';
1212
import { unlockWallet, withFixtures } from '../helpers';
1313
import { loginWithBalanceValidation } from '../page-objects/flows/login.flow';
1414
import BridgeQuotePage from '../page-objects/pages/bridge/quote-page';

test/e2e/default-fixture.js renamed to test/e2e/fixtures/default-fixture.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const { mockNetworkStateOld } = require('../stub/networks');
2-
const { CHAIN_IDS } = require('../../shared/constants/network');
3-
const { FirstTimeFlowType } = require('../../shared/constants/onboarding');
1+
const { mockNetworkStateOld } = require('../../stub/networks');
2+
const { CHAIN_IDS } = require('../../../shared/constants/network');
3+
const { FirstTimeFlowType } = require('../../../shared/constants/onboarding');
44

55
// TODO: Should we bump this?
66
// The e2e tests currently configure state in the schema of migration 74.

test/e2e/fixture-builder.js renamed to test/e2e/fixtures/fixture-builder.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {
44
} = require('@metamask/snaps-utils');
55
const { merge, mergeWith } = require('lodash');
66
const { toHex } = require('@metamask/controller-utils');
7-
const { mockNetworkStateOld } = require('../stub/networks');
7+
const { mockNetworkStateOld } = require('../../stub/networks');
88

99
const {
1010
AVALANCHE_DISPLAY_NAME,
@@ -13,19 +13,19 @@ const {
1313
LOCALHOST_DISPLAY_NAME,
1414
POLYGON_DISPLAY_NAME,
1515
ZK_SYNC_ERA_DISPLAY_NAME,
16-
} = require('../../shared/constants/network');
17-
const { SMART_CONTRACTS } = require('./seeder/smart-contracts');
16+
} = require('../../../shared/constants/network');
17+
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
1818
const {
1919
DAPP_URL,
2020
DAPP_URL_LOCALHOST,
2121
DAPP_ONE_URL,
2222
DEFAULT_FIXTURE_ACCOUNT,
23-
} = require('./constants');
23+
} = require('../constants');
2424
const {
2525
defaultFixture,
2626
FIXTURE_STATE_METADATA_VERSION,
2727
} = require('./default-fixture');
28-
const onboardingFixtureJson = require('./fixtures/onboarding-fixture.json');
28+
const onboardingFixtureJson = require('./onboarding-fixture.json');
2929

3030
function onboardingFixture() {
3131
return onboardingFixtureJson;
File renamed without changes.

0 commit comments

Comments
 (0)