Skip to content

Commit ffe70fa

Browse files
chore: moves api-mocking and framework to tests (#25031)
<!-- 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** Following #24313 we're looking to centralize all tools and test resources in one place. This PR moves `framework` and `api-mocking` to `/tests`. Previous related PRs: - #24988 - #24313 <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **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** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/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] > Consolidates E2E tooling under `tests/` and updates the codebase accordingly. > > - Migrates TypeScript E2E framework and API mocking from `e2e/framework` and `e2e/api-mocking` to `tests/framework` and `tests/api-mocking` > - Updates imports across E2E specs, page objects, helpers, Playwright config, and select app-side test utilities to reference `tests/framework/*` and `tests/api-mocking/*` > - Adjusts `.eslintrc.js` extends path, BUGBOT rules, and E2E documentation links to the new locations > - Updates CODEOWNERS and security code scanner ignore paths to reflect `tests/` > - Removes obsolete `e2e/framework` re-export files no longer used > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 635d96f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 51aa798 commit ffe70fa

576 files changed

Lines changed: 1811 additions & 1764 deletions

File tree

Some content is hidden

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

.cursor/BUGBOT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ Use the rules in the [unit testing guidelines](rules/unit-testing-guidelines.mdc
1818

1919
- **ALWAYS** load and reference [e2e-testing-guidelines](rules/e2e-testing-guidelines.mdc)
2020
- Verify test file naming pattern: `e2e/specs/**/*.spec.{js,ts}`
21-
- Check for proper imports and framework utilities from `e2e/framework/index.ts`
21+
- Check for proper imports and framework utilities from `tests/framework/index.ts`
2222

2323
Use the rules in the [e2e-testing-guidelines](rules/e2e-testing-guidelines.mdc) to enforce the test quality and bug detection.

.cursor/rules/e2e-testing-guidelines.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default new LoginPage();
163163
```
164164

165165
### Framework Imports - MANDATORY
166-
- ALWAYS import framework utilities from `e2e/framework/index.ts`, not from individual utility files
166+
- ALWAYS import framework utilities from `tests/framework/index.ts`, not from individual utility files
167167
- Use the centralized framework exports for consistency and maintainability
168168

169169
### Element State Checking Configuration

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
'tests/**/*.{js,ts}',
2727
'appwright/**/*.{js,ts}',
2828
],
29-
extends: ['./e2e/framework/.eslintrc.js'],
29+
extends: ['./tests/framework/.eslintrc.js'],
3030
},
3131
{
3232
files: ['*.{ts,tsx}'],

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ app/core/Engine/controllers/gator-permissions-controller @MetaMask/
244244
app/core/Engine/messengers/gator-permissions-controller-messenger @MetaMask/delegation
245245

246246
# QA Team - E2E Framework
247-
e2e/api-mocking/ @MetaMask/qa
247+
tests/api-mocking/ @MetaMask/qa
248248
e2e/fixtures/ @MetaMask/qa
249-
e2e/framework/ @MetaMask/qa
249+
tests/framework/ @MetaMask/qa
250250
e2e/pages/ @MetaMask/qa
251251
e2e/utils/ @MetaMask/qa
252252
e2e/viewHelper.ts @MetaMask/qa

.github/workflows/security-code-scanner.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
repo: ${{ github.repository }}
2424
paths_ignored: |
2525
e2e/
26+
tests/
2627
docs/
2728
.storybook/
2829
'**/*.test.js'

app/components/UI/Perps/utils/e2eBridgePerps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '../../../../util/test/utils';
1414
import { Linking } from 'react-native';
1515
import axios, { AxiosResponse } from 'axios';
16-
import { PerpsModifiersCommandTypes } from '../../../../../e2e/framework/types';
16+
import { PerpsModifiersCommandTypes } from '../../../../../tests/framework/types';
1717

1818
// Global bridge for E2E mock injection
1919
export interface E2EBridgePerpsStreaming {

app/features/SampleFeature/e2e/pages/SampleFeatureView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable import/prefer-default-export */
2-
import Matchers from '../../../../../e2e/framework/Matchers';
3-
import Gestures from '../../../../../e2e/framework/Gestures';
4-
import Assertions from '../../../../../e2e/framework/Assertions';
2+
import Matchers from '../../../../../tests/framework/Matchers';
3+
import Gestures from '../../../../../tests/framework/Gestures';
4+
import Assertions from '../../../../../tests/framework/Assertions';
55
import {
66
SampleFeatureSelectorsIDs,
77
SampleFeatureSelectorsText,

app/features/SampleFeature/e2e/specs/sample-feature-counter.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22
import SampleFeatureView from '../pages/SampleFeatureView';
33
import { RegressionSampleFeature } from '../../../../../e2e/tags';
4-
import FixtureBuilder from '../../../../../e2e/framework/fixtures/FixtureBuilder';
5-
import { withFixtures } from '../../../../../e2e/framework/fixtures/FixtureHelper';
4+
import FixtureBuilder from '../../../../../tests/framework/fixtures/FixtureBuilder';
5+
import { withFixtures } from '../../../../../tests/framework/fixtures/FixtureHelper';
66
import { navigateToSampleFeature } from '../utils';
7-
import Assertions from '../../../../../e2e/framework/Assertions';
7+
import Assertions from '../../../../../tests/framework/Assertions';
88

99
describe(RegressionSampleFeature('Sample Feature Counter'), () => {
1010
it('displays counter feature', async () => {

app/features/SampleFeature/e2e/specs/sample-feature-petname.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22
import SampleFeatureView from '../pages/SampleFeatureView';
33
import { RegressionSampleFeature } from '../../../../../e2e/tags';
4-
import FixtureBuilder from '../../../../../e2e/framework/fixtures/FixtureBuilder';
5-
import { withFixtures } from '../../../../../e2e/framework/fixtures/FixtureHelper';
4+
import FixtureBuilder from '../../../../../tests/framework/fixtures/FixtureBuilder';
5+
import { withFixtures } from '../../../../../tests/framework/fixtures/FixtureHelper';
66
import { navigateToSampleFeature } from '../utils';
7-
import Assertions from '../../../../../e2e/framework/Assertions';
7+
import Assertions from '../../../../../tests/framework/Assertions';
88

99
interface TestAddress {
1010
address: string;

app/features/SampleFeature/e2e/specs/sample-feature.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22
import SampleFeatureView from '../pages/SampleFeatureView';
33
import { RegressionSampleFeature } from '../../../../../e2e/tags';
4-
import FixtureBuilder from '../../../../../e2e/framework/fixtures/FixtureBuilder';
5-
import { withFixtures } from '../../../../../e2e/framework/fixtures/FixtureHelper';
4+
import FixtureBuilder from '../../../../../tests/framework/fixtures/FixtureBuilder';
5+
import { withFixtures } from '../../../../../tests/framework/fixtures/FixtureHelper';
66
import { navigateToSampleFeature } from '../utils';
7-
import Assertions from '../../../../../e2e/framework/Assertions';
7+
import Assertions from '../../../../../tests/framework/Assertions';
88

99
describe(RegressionSampleFeature('Sample Feature'), () => {
1010
it('Navigates to sample feature', async () => {

0 commit comments

Comments
 (0)