-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: E2E Mocking Setup For Detox Tests #11144
Conversation
Merged all mocking research into this branch
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is network access?This module accesses the network. Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Bitrise❌❌❌ Commit hash: 322c948 Note
|
Bitrise❌❌❌ Commit hash: 8c64453 Note
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Great work!
Bitrise❌❌❌ Commit hash: 4545a94 Note
Tip
|
…e2e/specs/confirmations/signatures tests
Bitrise✅✅✅ Commit hash: d1f42bc Note
|
Quality Gate passedIssues Measures |
Consolidated Mocking Research into Current Branch <!-- 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 introduces the initial E2E API mocking test. When IsTest is true, the iOS/Android app redirects traffic to a proxy within the e2e folder for tests that require mocking. The mock server proxy forwards all traffic to its destination unless it matches specific mock requirements. The first test verifies that the suggestedGasApi falls back to the legacy endpoint when the EIP1559 API is down, displaying a legacy modal. The test then reinstates the service and asserts the modal change immediately. <!-- 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? --> ## **Related issues** Fixes:https://github.com/orgs/MetaMask/projects/60/views/16?pane=issue&itemId=70977379 ## **Manual testing steps** 1. Run e2e Detox setup 2. Have IOS and Android sim ready 3. For IOS run command `yarn detox test -c ios.sim.debug e2e/specs/wallet/suggestedGasApi.mock.spec.js;` for Android run `yarn detox test -c android.emu.debug e2e/specs/wallet/suggestedGasApi.mock.spec.js` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **After** <!-- [screenshots/recordings] --> https://www.loom.com/share/64d322a3f50d4888b1b7a96107008918 https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ef9aaa7c-6247-4bf9-81fd-09bbaa76d7c8 ## **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). - [x] I've completed the PR template to the best of my ability - [x] 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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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: SamuelSalas <samuel.salas.reyes@gmail.com>
Consolidated Mocking Research into Current Branch
Description
This PR introduces the initial E2E API mocking test. When IsTest is true, the iOS/Android app redirects traffic to a proxy within the e2e folder for tests that require mocking. The mock server proxy forwards all traffic to its destination unless it matches specific mock requirements. The first test verifies that the suggestedGasApi falls back to the legacy endpoint when the EIP1559 API is down, displaying a legacy modal. The test then reinstates the service and asserts the modal change immediately.
Related issues
Fixes:https://github.com/orgs/MetaMask/projects/60/views/16?pane=issue&itemId=70977379
Manual testing steps
yarn detox test -c ios.sim.debug e2e/specs/wallet/suggestedGasApi.mock.spec.js;
for Androidrun
yarn detox test -c android.emu.debug e2e/specs/wallet/suggestedGasApi.mock.spec.js
Screenshots/Recordings
After
https://www.loom.com/share/64d322a3f50d4888b1b7a96107008918
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ef9aaa7c-6247-4bf9-81fd-09bbaa76d7c8
Pre-merge author checklist
Pre-merge reviewer checklist