Skip to content

Commit bdeebbd

Browse files
racitoressalimtb
authored andcommitted
test: first test in smoke perps (#21953)
<!-- 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 splitting the content of another much bigger [PR](#20936) to simplify the review and merge I'll be adding add funds in perps <!-- 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] > Adds Perps E2E smoke tests and infrastructure (HTTP command-queue bridge, mocks, Sentry module aliasing) and runs them on iOS/Android CI. > > - **E2E Perps Infrastructure**: > - Add HTTP command-queue polling in `app/components/UI/Perps/utils/e2eBridgePerps.ts` with deep link handler refinements, mock deposit, and duplicate-link protection. > - Introduce command queue server (`e2e/framework/fixtures/CommandQueueServer.ts`) and plumb ports via `app/util/test/utils.js`, `shim.js`, Detox reverse ports, and fixture lifecycle. > - Expand Perps controller mixin (`e2e/controller-mocking/mock-config/perps-controller-mixin.ts`) with overrides for orders, fills, funding, cancel order, TP/SL updates, deterministic liquidation price, and provider wrapping. > - Enhance Perps mock service (`e2e/.../perps-e2e-mocks.ts`) with deposits, close fills, orders history, TP/SL trigger orders, price/liq handling, and seeded data. > - Add Arbitrum RPC and API mocks (`e2e/api-mocking/perps-arbitrum-mocks.ts`). > - **New Tests & Page Objects**: > - Add Perps “Add funds” smoke spec (`e2e/specs/perps/perps-add-funds.spec.ts`) and helpers/pages (`PerpsDepositView`, `PerpsDepositProcessingView`, updates to `PerpsTabView`, `TabBarComponent`, `Matchers`). > - Update deep link mapping to `metamask://e2e/perps/` (`e2e/framework/DeepLink.ts`) and add server-driven modifiers. > - **CI**: > - Add `perps-android-smoke` and `perps-ios-smoke` jobs and include them in report steps. > - **Module Aliasing**: > - Alias Sentry packages to E2E no-op mocks via `metro.config.js`; add mock files under `e2e/module-mocking/sentry/`. > - **Config/Quality**: > - Exclude `e2eBridgePerps.ts` from Sonar analysis; add docs (`e2e/docs/*`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c904dce. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent b7ed33d commit bdeebbd

File tree

26 files changed

+1453
-105
lines changed

26 files changed

+1453
-105
lines changed

.github/workflows/run-e2e-smoke-tests-android.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ jobs:
2929
changed_files: ${{ inputs.changed_files }}
3030
secrets: inherit
3131

32+
perps-android-smoke:
33+
strategy:
34+
matrix:
35+
split: [1]
36+
fail-fast: false
37+
uses: ./.github/workflows/run-e2e-workflow.yml
38+
with:
39+
test-suite-name: perps-android-smoke-${{ matrix.split }}
40+
platform: android
41+
test_suite_tag: 'SmokePerps'
42+
split_number: ${{ matrix.split }}
43+
total_splits: 1
44+
changed_files: ${{ inputs.changed_files }}
45+
secrets: inherit
46+
3247
wallet-platform-android-smoke:
3348
strategy:
3449
matrix:
@@ -155,6 +170,7 @@ jobs:
155170
if: ${{ !cancelled() }}
156171
needs:
157172
- trade-android-smoke
173+
- perps-android-smoke
158174
- wallet-platform-android-smoke
159175
- identity-android-smoke
160176
- accounts-android-smoke

.github/workflows/run-e2e-smoke-tests-ios.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ jobs:
4444
changed_files: ${{ inputs.changed_files }}
4545
secrets: inherit
4646

47+
perps-ios-smoke:
48+
strategy:
49+
matrix:
50+
split: [1]
51+
fail-fast: false
52+
uses: ./.github/workflows/run-e2e-workflow.yml
53+
with:
54+
test-suite-name: perps-ios-smoke-${{ matrix.split }}
55+
platform: ios
56+
test_suite_tag: 'SmokePerps'
57+
split_number: ${{ matrix.split }}
58+
total_splits: 1
59+
changed_files: ${{ inputs.changed_files }}
60+
secrets: inherit
61+
4762
wallet-platform-ios-smoke:
4863
strategy:
4964
matrix:
@@ -156,6 +171,7 @@ jobs:
156171
needs:
157172
- confirmations-redesigned-ios-smoke
158173
- trade-ios-smoke
174+
- perps-ios-smoke
159175
- wallet-platform-ios-smoke
160176
- identity-ios-smoke
161177
- accounts-ios-smoke

0 commit comments

Comments
 (0)