Skip to content

Commit 0c623c3

Browse files
test: Mmqa fix perf flakiness (#22192)
<!-- 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** <!-- 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] > Reduces flakiness in send flow perf tests by adding Android-specific selectors, extending timeouts, and cleaning up unused options. > > - **Tests (performance)**: > - Increase test timeout to 30 min in `appwright/tests/performance/login/send-flows.spec.js`. > - **Screen Objects**: > - `wdio/screen-objects/SendScreen.js`: > - Platform-specific `searchTokenField` selector (iOS: catch-all; Android: `textfieldsearch`). > - Platform-specific first token badge selection (iOS: XPath; Android: `badge-wrapper-badge` ID). > - **Utils**: > - `appwright/utils/Flows.js`: > - Remove unused `skipIntro` option from `login`. > - Increase `dismissMultichainAccountsIntroModal` timeout to 10s. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8082395. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 2ae45e5 commit 0c623c3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

appwright/tests/performance/login/send-flows.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ test('Send flow - Ethereum, SRP 1 + SRP 2 + SRP 3', async ({
2323
device,
2424
performanceTracker,
2525
}, testInfo) => {
26+
test.setTimeout(1800000); // TODO: Investigate why this is taking so long on Android
2627
WalletAccountModal.device = device;
2728
WalletMainScreen.device = device;
2829
AccountListComponent.device = device;
@@ -53,14 +54,12 @@ test('Send flow - Ethereum, SRP 1 + SRP 2 + SRP 3', async ({
5354
await SendScreen.assetsListIsDisplayed();
5455
timer1.stop();
5556
await SendScreen.typeTokenName('Link\n');
56-
console.log('Ethereum typed, so waiting 5 seconds');
5757
await SendScreen.clickOnFirstTokenBadge();
5858
timer2.start();
5959

6060
await AmountScreen.isVisible();
6161
timer2.stop();
6262
await AmountScreen.enterAmount(TEST_AMOUNTS.ETHEREUM);
63-
6463
await AmountScreen.tapOnNextButton();
6564
timer3.start();
6665
await SendScreen.isSelectAddressScreenDisplayed();

appwright/utils/Flows.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export async function importSRPFlow(device, srp) {
115115

116116
export async function login(device, options = {}) {
117117
LoginScreen.device = device;
118-
const { skipIntro = false, scenarioType = 'login' } = options;
118+
const { scenarioType = 'login' } = options;
119119

120120
const password = getPasswordForScenario(scenarioType);
121121

@@ -149,7 +149,7 @@ export async function dismissRewardsBottomSheetModal(device) {
149149

150150
export async function dismissMultichainAccountsIntroModal(
151151
device,
152-
timeout = 5000,
152+
timeout = 10000,
153153
) {
154154
MultichainAccountEducationModal.device = device;
155155
const closeButton = await MultichainAccountEducationModal.closeButton;

wdio/screen-objects/SendScreen.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ class SendScreen {
8181
}
8282

8383
get searchTokenField() {
84-
return AppwrightSelectors.getElementByCatchAll(this._device, 'Search tokens and NFTs');
84+
if (AppwrightSelectors.isIOS(this._device)) {
85+
return AppwrightSelectors.getElementByCatchAll(this._device, 'Search tokens and NFTs');
86+
} else {
87+
return AppwrightSelectors.getElementByID(this._device, 'textfieldsearch');
88+
}
8589
}
8690

8791

@@ -203,7 +207,7 @@ class SendScreen {
203207
}
204208

205209
async clickOnFirstTokenBadge() {
206-
const firstTokenBadge = await AppwrightSelectors.getElementByXpath(this._device, `//XCUIElementTypeOther[@name="badge-wrapper-badge"]`);
210+
const firstTokenBadge = AppwrightSelectors.isIOS(this._device) ? await AppwrightSelectors.getElementByXpath(this._device, `//XCUIElementTypeOther[@name="badge-wrapper-badge"]`) : await AppwrightSelectors.getElementByID(this._device, 'badge-wrapper-badge');
207211
appwrightExpect(firstTokenBadge).toBeVisible();
208212
await AppwrightGestures.tap(firstTokenBadge);
209213
}

0 commit comments

Comments
 (0)