Skip to content

Commit

Permalink
test: remove MMI tests (#29748)
Browse files Browse the repository at this point in the history
## **Description**

As part of the MMI deprecation, all the MMI tests must be removed first
to allow code removal PRs to pass.


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29748?quickstart=1)

## **Related issues**

Fixes: #29782

## **Manual testing steps**

None required, as this PR only removes tests

## **Screenshots/Recordings**

N/A

No features added or changed

## **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.

---------

Co-authored-by: Ramon Acitores <[email protected]>
  • Loading branch information
shane-t and racitores authored Jan 23, 2025
1 parent 009ad97 commit 1946d07
Show file tree
Hide file tree
Showing 148 changed files with 113 additions and 2,939 deletions.
66 changes: 0 additions & 66 deletions .circleci/scripts/check_mmi_trigger.sh

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ module.exports = {
files: [
'**/__snapshots__/*.snap',
'app/scripts/controllers/app-state-controller.test.ts',
'app/scripts/controllers/mmi-controller.test.ts',
'app/scripts/controllers/alert-controller.test.ts',
'app/scripts/metamask-controller.actions.test.js',
'app/scripts/detect-multiple-instances.test.js',
Expand Down
6 changes: 0 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ app/scripts/lib/transaction/metrics.* @MetaMask/confirmations
app/scripts/lib/transaction/util.* @MetaMask/confirmations
ui/pages/confirmations @MetaMask/confirmations

# MMI team is responsible for code related with Institutioanl version of MetaMask
ui/pages/institutional @MetaMask/mmi
ui/components/institutional @MetaMask/mmi
ui/ducks/institutional @MetaMask/mmi
ui/selectors/institutional @MetaMask/mmi

# Design System to own code for the component-library folder
# Slack handle: @metamask-design-system-team | Slack channel: #metamask-design-system
ui/components/component-library @MetaMask/design-system-engineers
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/add-mmi-reviewer-and-notify.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/trigger-metamask-institutional-e2e-ci.yml

This file was deleted.

10 changes: 2 additions & 8 deletions .github/workflows/update-lavamoat-policies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
matrix:
# Ensure this is synchronized with the list below in the "commit-updated-policies" job
# and with the build type list in `builds.yml`
build-type: [main, beta, flask, mmi]
build-type: [main, beta, flask]
name: Update LavaMoat ${{ matrix.build-type }} application policy
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
path: lavamoat/build-system
key: cache-build-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
# One restore step per build type: [main, beta, flask, mmi]
# One restore step per build type: [main, beta, flask]
# Ensure this is synchronized with the list above in the "update-lavamoat-webapp-policy" job
# and with the build type list in `builds.yml`
- name: Restore main application policy
Expand All @@ -175,12 +175,6 @@ jobs:
path: lavamoat/browserify/flask
key: cache-flask-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore mmi application policy
uses: actions/cache/restore@v4
with:
path: lavamoat/browserify/mmi
key: cache-mmi-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Check whether there are policy changes
id: policy-changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-lavamoat-policy-webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
build-type: [main, beta, flask, mmi]
build-type: [main, beta, flask]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,8 @@ test-results/
!.yarn/versions
development/generate-attributions/.yarn/*

# MMI Playwright
# Playwright
public/playwright
test/e2e/playwright/mmi/.env
test/e2e/playwright/mmi/playwright.config.ts
test/e2e/playwright/mmi/specs/**/*-darwin.png
test/e2e/playwright/mmi/dist/
lavamoat/**/policy-debug.json

# Attributions
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ Before running e2e tests, ensure you've run `yarn install` to download dependenc
2. Create a custom test build: for testing against different build types, use `yarn build:test`. This command allows you to generate test builds for various types, including:
- `yarn build:test` for main build
- `yarn build:test:flask` for flask build
- `yarn build:test:mmi` for mmi build
- `yarn build:test:mv2` for mv2 build
- `yarn build:test:mmi` for mmi build
3. Start a test build with live changes: `yarn start:test` is particularly useful for development. It starts a test build that automatically recompiles application code upon changes. This option is ideal for iterative testing and development. This command also allows you to generate test builds for various types, including:
- `yarn start:test` for main build
- `yarn start:test:flask` for flask build
Expand Down Expand Up @@ -192,18 +192,10 @@ This approach ensures that your e2e tests accurately reflect the user experience
Different build types have different e2e tests sets. In order to run them look in the `package.json` file. You will find:

```console
"test:e2e:chrome:mmi": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mmi",
"test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps",
"test:e2e:firefox": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js",
```

#### Note: Running MMI e2e tests

When running e2e on an MMI build you need to know that there are 2 separated set of tests:

- MMI runs a subset of MetaMask's e2e tests. To facilitate this, we have appended the `@no-mmi` tags to the names of those tests that are not applicable to this build type.
- MMI runs another specific set of e2e legacy tests which are better documented [here](test/e2e/mmi/README.md)

### Changing dependencies

Whenever you change dependencies (adding, removing, or updating, either in `package.json` or `yarn.lock`), there are various files that must be kept up-to-date.
Expand Down
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,9 @@
"test:integration": "npx webpack build --config ./development/webpack/webpack.integration.tests.config.ts && jest --config jest.integration.config.js",
"test:integration:coverage": "yarn test:integration --coverage",
"test:e2e:chrome": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js",
"test:e2e:chrome:mmi": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mmi",
"test:e2e:chrome:flask": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --build-type flask",
"test:e2e:chrome:webpack": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js",
"test:api-specs": "SELENIUM_BROWSER=chrome ts-node test/e2e/run-openrpc-api-test-coverage.ts",
"test:e2e:mmi:ci": "yarn playwright test --project=mmi --project=mmi.visual",
"test:e2e:mmi:all": "yarn playwright test --project=mmi && yarn test:e2e:mmi:visual",
"test:e2e:mmi:regular": "yarn playwright test --project=mmi",
"test:e2e:mmi:visual": "./test/e2e/playwright/mmi/scripts/run-visual-test.sh check",
"test:e2e:mmi:visual:update": "./test/e2e/playwright/mmi/scripts/run-visual-test.sh update",
"test:e2e:swap": "yarn playwright test --project=swap",
"test:e2e:global": "yarn playwright test --project=global",
"test:e2e:pw:report": "yarn playwright show-report public/playwright/playwright-reports/html",
Expand Down
17 changes: 0 additions & 17 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';
import dotenv from 'dotenv';
import { isHeadless } from './test/helpers/env';

dotenv.config({ path: './test/e2e/playwright/mmi/.env' });
const logOutputFolder = './public/playwright/playwright-reports';

/**
Expand Down Expand Up @@ -49,21 +47,6 @@ const config: PlaywrightTestConfig = {

/* Configure projects for major browsers */
projects: [
{
name: 'mmi',
testMatch: '/mmi/specs/**.spec.ts',
testIgnore: '/mmi/specs/visual.spec.ts',
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'mmi.visual',
testMatch: '/mmi/**/*visual.spec.ts',
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'swap',
testMatch: '/swap/specs/*swap.spec.ts',
Expand Down
8 changes: 1 addition & 7 deletions test/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,19 +851,13 @@ async function initBundler(bundlerServer, ganacheServer, usePaymaster) {
}

/**
* Opens the account options menu safely, handling potential race conditions
* with the MMI build.
* Opens the account options menu safely
*
* @param {WebDriver} driver - The WebDriver instance used to interact with the browser.
* @returns {Promise<void>} A promise that resolves when the menu is opened and any necessary waits are complete.
*/
async function openMenuSafe(driver) {
await driver.clickElement('[data-testid="account-options-menu-button"]');

// fix race condition with mmi build
if (process.env.MMI) {
await driver.waitForSelector('[data-testid="global-menu-mmi-portfolio"]');
}
}

const sentryRegEx = /^https:\/\/sentry\.io\/api\/\d+\/envelope/gu;
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/page-objects/pages/header-navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class HeaderNavbar {

private readonly lockMetaMaskButton = '[data-testid="global-menu-lock"]';

private readonly mmiPortfolioButton =
'[data-testid="global-menu-mmi-portfolio"]';

private readonly openAccountDetailsButton =
'[data-testid="account-list-menu-details"]';

Expand Down Expand Up @@ -66,10 +63,6 @@ class HeaderNavbar {
async openThreeDotMenu(): Promise<void> {
console.log('Open account options menu');
await this.driver.clickElement(this.threeDotMenuButton);
// fix race condition with mmi build
if (process.env.MMI) {
await this.driver.waitForSelector(this.mmiPortfolioButton);
}
}

async openPermissionsPage(): Promise<void> {
Expand Down
20 changes: 0 additions & 20 deletions test/e2e/playwright/mmi/.env.example

This file was deleted.

16 changes: 0 additions & 16 deletions test/e2e/playwright/mmi/Dockerfile

This file was deleted.

Loading

0 comments on commit 1946d07

Please sign in to comment.