Skip to content

Commit a7980e3

Browse files
test: sets the carousel mocks to false on the netwrok-manager spec (#28335)
<!-- 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 sets the Carousel mocks to false on the network manager spec in order to improve token visibility. Some urls were also removed from the allow list since they have been mocked previously <!-- 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: https://consensys.slack.com/archives/C02U025CVU4/p1775117808791299 ## **Manual testing steps** N/A ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** N/A <!-- [screenshots/recordings] --> ### **After** N/A <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] 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 - [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-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] > **Low Risk** > Low risk: changes are limited to E2E/smoke test setup and allowlist cleanup, with no production runtime logic touched. > > **Overview** > Stabilizes smoke tests by forcing remote feature flags to disable `carouselBanners` in `network-manager2.spec.ts`, ensuring banner UI doesn’t obscure token visibility during network filtering checks. > > Cleans up E2E request allowlisting by removing now-mocked endpoints from `mock-e2e-allowlist.ts`, and adds a small workaround in the gasless swap 7702 smoke test to dismiss a sticky keyboard via a tap on `QuoteView.networkFeeLabel`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f1d0068. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 1d58bc0 commit a7980e3

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

tests/api-mocking/mock-e2e-allowlist.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const ALLOWLISTED_HOSTS = [
1414
'nft.dev-api.cx.metamask.io',
1515
'nft.uat-api.cx.metamask.io',
1616
'nft.api.cx.metamask.io',
17-
'digest.dev-api.cx.metamask.io', // Market digest API for tokens
1817
'gamma-api.polymarket.com',
1918
'clob.polymarket.com',
2019
'*.polymarket.com',
@@ -41,7 +40,6 @@ export const ALLOWLISTED_URLS = [
4140
'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
4241
'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',
4342
'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',
44-
'https://cdn.contentful.com:443/spaces/jdkgyfmyd9sw/environments/dev/entries?content_type=promotionalBanner&fields.showInMobile=true',
4543
'https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=POL',
4644
'https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=FTM',
4745
'https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=AVAX',

tests/smoke/networks/network-manager2.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@ import TestDApp from '../../page-objects/Browser/TestDApp';
1313
import ConnectedAccountsModal from '../../page-objects/Browser/ConnectedAccountsModal';
1414
import ConnectBottomSheet from '../../page-objects/Browser/ConnectBottomSheet';
1515
import { CustomNetworks } from '../../resources/networks.e2e';
16+
import { Mockttp } from 'mockttp';
17+
import { setupRemoteFeatureFlagsMock } from '../../api-mocking/helpers/remoteFeatureFlagsHelper';
1618

1719
const POLYGON = CustomNetworks.Tenderly.Polygon.providerConfig.nickname;
1820

1921
const isMultichainAccountsState2Enabled =
2022
process.env.MM_ENABLE_MULTICHAIN_ACCOUNTS_STATE_2 === 'true';
2123

24+
const testSpecificMock = async (mockServer: Mockttp) => {
25+
await setupRemoteFeatureFlagsMock(mockServer, {
26+
carouselBanners: false,
27+
});
28+
};
29+
2230
describe(SmokeNetworkAbstractions('Network Manager'), () => {
2331
beforeAll(async () => {
2432
jest.setTimeout(170000);
@@ -63,6 +71,7 @@ describe(SmokeNetworkAbstractions('Network Manager'), () => {
6371
)
6472
.build(),
6573
restartDevice: true,
74+
testSpecificMock,
6675
},
6776
async () => {
6877
await loginToApp();
@@ -129,6 +138,7 @@ describe(SmokeNetworkAbstractions('Network Manager'), () => {
129138
])
130139
.build(),
131140
restartDevice: true,
141+
testSpecificMock,
132142
},
133143
async () => {
134144
await loginToApp();
@@ -186,6 +196,7 @@ describe(SmokeNetworkAbstractions('Network Manager'), () => {
186196
])
187197
.build(),
188198
restartDevice: true,
199+
testSpecificMock,
189200
},
190201
async () => {
191202
await loginToApp();
@@ -238,6 +249,7 @@ describe(SmokeNetworkAbstractions('Network Manager'), () => {
238249
.withPopularNetworks()
239250
.build(),
240251
restartDevice: true,
252+
testSpecificMock,
241253
},
242254
async () => {
243255
await loginToApp();

tests/smoke/swap/gasless-swap.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { testSpecificMock as swapTestSpecificMock } from '../../helpers/swap/swa
1919
import { setupSmartTransactionsMocks } from '../../helpers/swap/smart-transactions-mocks';
2020
import { prepareSwapsTestEnvironment } from '../../helpers/swap/prepareSwapsTestEnvironment';
2121
import { checkSwapActivity } from '../../helpers/swap/swap-unified-ui';
22+
import { Gestures } from '../../framework';
2223

2324
describe(SmokeTrade('Gasless Swap - '), (): void => {
2425
const chainId = '0x1';
@@ -243,6 +244,12 @@ describe(SmokeTrade('Gasless Swap - '), (): void => {
243244
await QuoteView.tapDestinationToken();
244245
await QuoteView.tapToken(chainId, 'MUSD');
245246

247+
// Sometimes the keyboard is not dismissed after selecting the
248+
// destination token so we tap the network fee label to dismiss it
249+
await Gestures.waitAndTap(QuoteView.networkFeeLabel, {
250+
elemDescription: 'Network fee label',
251+
});
252+
246253
await Assertions.expectElementToBeVisible(QuoteView.networkFeeLabel, {
247254
timeout: 60000,
248255
description: 'Network fee label visible',

0 commit comments

Comments
 (0)