Skip to content

chore: Make Asset sort e2e test more robust cp-7.53.0#18046

Merged
owencraston merged 4 commits into
mainfrom
chore/make-asset-sort-e2e-more-robust
Aug 6, 2025
Merged

chore: Make Asset sort e2e test more robust cp-7.53.0#18046
owencraston merged 4 commits into
mainfrom
chore/make-asset-sort-e2e-more-robust

Conversation

@owencraston

@owencraston owencraston commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Description

  • This PR unblocks this pr
  • With FlashList v2, the list tree is not re rendered and instead recycled so we cannot rely on the label to check the order of the list.
  • to address this, we reload the app so that we can see the new tree label and test the ordering.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

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

Before

After

Pre-merge author checklist

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.

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-accounts-framework Accounts team label Aug 6, 2025
@owencraston owencraston added No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E and removed team-accounts-framework Accounts team labels Aug 6, 2025
@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 33cb074
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/63240407-69a3-445c-a828-3ded39e8a751

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@owencraston owencraston marked this pull request as ready for review August 6, 2025 17:34

@christopherferreira9 christopherferreira9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm will investigate separately how we can properly assert without relaunching the app.

cursor[bot]

This comment was marked as outdated.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.54%. Comparing base (4bb4d0f) to head (33cb074).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18046      +/-   ##
==========================================
+ Coverage   74.38%   74.54%   +0.15%     
==========================================
  Files        2985     3019      +34     
  Lines       67286    67943     +657     
  Branches    11289    11449     +160     
==========================================
+ Hits        50051    50645     +594     
- Misses      14006    14013       +7     
- Partials     3229     3285      +56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e7e2ceb
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5ae550bb-cd28-4567-b327-93c9cb8a31fd

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

cursor[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: eacb2ee
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/af5a8ee5-9036-4ba1-a7e9-e19898ba9572

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@owencraston owencraston changed the title chore: Make Asset sort e2e test more robust chore: Make Asset sort e2e test more robust cp-7.53.0 Aug 6, 2025
@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1f93798
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3e823995-f287-45d9-b929-b61cef764524

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

cursor[bot]

This comment was marked as outdated.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2025

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Token Sorting Tests Missing Restart Logic

The should sort tokens by fiat amount test is missing the app restart logic and .withMetaMetricsOptIn() fixture configuration that were applied to the should sort tokens alphabetically test. This restart is a workaround for FlashList v2's UI not re-rendering after sort changes. Both tests are affected by this FlashList v2 issue, leading to potential failures or unreliable results for the unfixed test.

e2e/specs/assets/multichain/asset-sort.spec.ts#L93-L125

https://github.com/MetaMask/metamask-mobile/blob/1f93798b068ae5506b6b98e2c26bc245782ed193/e2e/specs/assets/multichain/asset-sort.spec.ts#L93-L125

e2e/specs/assets/multichain/asset-sort.spec.ts#L57-L87

it('should sort tokens alphabetically', async () => {
await withFixtures(
{
fixture: new FixtureBuilder()
.withNetworkController(CustomNetworks.Tenderly.Mainnet)
.withTokens([AAVE_TENDERLY_MAINNET_DETAILS])
.withMetaMetricsOptIn()
.build(),
restartDevice: true,
},
async () => {
await loginToApp();
await WalletView.tapSortBy();
await SortModal.tapSortAlphabetically();
// Relaunching the app since the tree is not re-rendered with FlashList v2.
await device.terminateApp();
await TestHelpers.launchApp({
launchArgs: { fixtureServerPort: `${getFixturesServerPort()}` },
});
await loginToApp();
const tokens =
(await WalletView.getTokensInWallet()) as IndexableNativeElement;
const tokensAttributes = await tokens.getAttributes();
const label = (tokensAttributes as { label: string }).label;
// Ensure `label` contains "Aave" followed (somewhere) by "Ethereum".
const textOrderRegex = new RegExp('Aave([\\s\\S]*?)Ethereum', 'i');
const isMatch = label.match(textOrderRegex);
if (!isMatch) {

Fix in Cursor Fix in Web

@cortisiko cortisiko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌮 🌮 🌮

@owencraston owencraston added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit c6c099f Aug 6, 2025
54 of 60 checks passed
@owencraston owencraston deleted the chore/make-asset-sort-e2e-more-robust branch August 6, 2025 22:11
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 6, 2025
@metamaskbot metamaskbot added the release-7.54.0 Issue or pull request that will be included in release 7.54.0 label Aug 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.54.0 Issue or pull request that will be included in release 7.54.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants