Skip to content

test: Enable Segment/MetaMetrics for E2E tests#14641

Merged
cmd-ob merged 42 commits into
mainfrom
e2e/metametrics
Apr 15, 2025
Merged

test: Enable Segment/MetaMetrics for E2E tests#14641
cmd-ob merged 42 commits into
mainfrom
e2e/metametrics

Conversation

@cmd-ob

@cmd-ob cmd-ob commented Apr 13, 2025

Copy link
Copy Markdown
Contributor

Description

Fix MetaMetrics event visibility in E2E test suite by implementing a test MetaMetrics client that routes events to a mock server. This resolves an issue that previously caused the application to hang in E2E testing mode when MetaMetrics tracking was enabled.

The solution routes MetaMetrics events to a non-existent server where they are captured by the mock server, allowing proper testing of analytics events without performance degradation.

Added example implementations demonstrating how to use metrics mocks alongside other mocks, both when using withFixtures and when starting a server within a test.

Related issues

Fixes:

Manual testing steps

  1. Run E2E tests with MetaMetrics enabled
  2. Verify that tests capture and validate MetaMetrics events
  3. Confirm that the application no longer hangs during testing

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.

cmd-ob added 24 commits April 9, 2025 23:07
…r references in import wallet analytics tests
@github-actions

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.

@github-actions

github-actions Bot commented Apr 13, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 2cd7cba
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4562453a-8005-4f9f-b5ab-275f9b640686

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

Tip

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

@cmd-ob cmd-ob changed the title Enhance E2E analytics tracking and event management test: Enable Segment/MetaMetrics for E2E tests Apr 13, 2025
Comment thread e2e/specs/analytics/import-wallet-analytics.spec.js Outdated
Comment thread e2e/specs/analytics/import-wallet-analytics.spec.js Outdated

@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, great work!

@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.

Left a few comments. We should have some tests for new wallet creation as well.

Comment thread e2e/utils/Assertions.js
Comment thread bitrise.yml Outdated
Comment thread e2e/specs/analytics/import-wallet-analytics.spec.js Outdated
@github-actions

github-actions Bot commented Apr 15, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 5b69bb5
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e8db3ca0-e6b4-4ceb-bd87-d43fc4b089f1

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

@sonarqubecloud

Copy link
Copy Markdown

@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.

✅ ✅

@cmd-ob cmd-ob enabled auto-merge April 15, 2025 14:59
@cmd-ob cmd-ob added this pull request to the merge queue Apr 15, 2025
Merged via the queue into main with commit 99327ee Apr 15, 2025
@cmd-ob cmd-ob deleted the e2e/metametrics branch April 15, 2025 15:22
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2025
@metamaskbot metamaskbot added the release-7.46.0 Issue or pull request that will be included in release 7.46.0 label Apr 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.46.0 Issue or pull request that will be included in release 7.46.0 team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants