Skip to content

feat: adds a new fixture to disable STX #17461

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

Merged
merged 18 commits into from
Jul 23, 2025

Conversation

christopherferreira9
Copy link
Contributor

@christopherferreira9 christopherferreira9 commented Jul 22, 2025

Description

  • Adds a new fixture to disable STX to avoid extra steps in some E2E
  • Removes try catch that were preventing tests from failing fast
  • Migrates part of the swap related files to the new framework

Extra

Improvements on withFixtures under framework:

  • extended to allow providing a mock server instance instead of letting the helper create one
  • extended to allow providing an endTestfn to be executed after the test finishes and before the cleanup happens. Specially useful when we need to grab MetaMetrics events.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

Copy link
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-qa QA team label Jul 22, 2025
@christopherferreira9 christopherferreira9 marked this pull request as ready for review July 22, 2025 21:51
@christopherferreira9 christopherferreira9 added No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E Requires smoke E2E testing labels Jul 22, 2025
Copy link
Contributor

github-actions bot commented Jul 22, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 791b1a3
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/29ec5326-b38d-473b-b2f5-726f8520a862

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.

cursor[bot]

This comment was marked as outdated.

@christopherferreira9 christopherferreira9 added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jul 23, 2025
Copy link
Contributor

github-actions bot commented Jul 23, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 41c2237
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/57820dae-aa6d-48a4-acfb-5fb81e00e778

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.

@christopherferreira9 christopherferreira9 added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jul 23, 2025
Copy link
Contributor

github-actions bot commented Jul 23, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 273b7b8
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a87121a2-a932-4fc3-8a3f-0cf391f7936c

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.

@christopherferreira9 christopherferreira9 added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jul 23, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: c34ae67
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/bc7204ad-f12b-4a7c-903a-feecb19e51de

Note

  • This comment will auto-update when build completes
  • 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.

@christopherferreira9 christopherferreira9 removed the Run Smoke E2E Requires smoke E2E testing label Jul 23, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: API Contract Violation: Return Type Change

The generateApprovedTokenActivityLabel method's return type changed from a RegExp object to a string. This breaks the API contract, as callers may expect a RegExp for pattern matching, leading to runtime errors.

e2e/pages/Transactions/ActivitiesView.ts#L63-L68

generateApprovedTokenActivityLabel(sourceToken: string): string {
let title = ActivitiesViewSelectorsText.APPROVE;
title = title.replace('{{sourceToken}}', sourceToken);
title = title.replace('{{upTo}}', '.*');
return `^${title}`;

Fix in CursorFix in Web


Bug: Mock Server Cleanup Affects External Instances

The withFixtures function prematurely stops externally provided mock server instances (mockServerInstance). This occurs because the cleanup logic's condition changed from if (testSpecificMock) to if (mockServer), causing stopMockServer to be called on all mock server instances, regardless of whether they were created internally or passed in externally. This interferes with externally managed mock servers, potentially breaking tests that intend to reuse them.

e2e/framework/fixtures/FixtureHelper.ts#L460-L463

if (mockServer) {
await stopMockServer(mockServer);
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Copy link

@christopherferreira9
Copy link
Contributor Author

Added No E2E Needed as the tests had passed before and all commits after that were just cleaning logs and fixing prettier + linting.

Copy link
Contributor

@davibroc davibroc left a comment

Choose a reason for hiding this comment

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

LGTM

@christopherferreira9 christopherferreira9 added No E2E Smoke Needed If the PR does not need E2E smoke test run and removed Run Smoke E2E Requires smoke E2E testing labels Jul 23, 2025
@christopherferreira9 christopherferreira9 added this pull request to the merge queue Jul 23, 2025
Merged via the queue into main with commit 340d194 Jul 23, 2025
56 of 58 checks passed
@christopherferreira9 christopherferreira9 deleted the christopher/add-fixture-disable-stx branch July 23, 2025 12:06
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2025
@metamaskbot metamaskbot added the release-7.53.0 Issue or pull request that will be included in release 7.53.0 label Jul 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No E2E Smoke Needed If the PR does not need E2E smoke test run No QA Needed Apply this label when your PR does not need any QA effort. release-7.53.0 Issue or pull request that will be included in release 7.53.0 team-qa QA team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants