Skip to content

test: add appwright test configurations for mm-connect with Browserstack local#25990

Merged
chrisleewilcox merged 6 commits intomainfrom
MMQA-1419-add-browserstack-localhost-support
Feb 12, 2026
Merged

test: add appwright test configurations for mm-connect with Browserstack local#25990
chrisleewilcox merged 6 commits intomainfrom
MMQA-1419-add-browserstack-localhost-support

Conversation

@chrisleewilcox
Copy link
Copy Markdown
Contributor

@chrisleewilcox chrisleewilcox commented Feb 12, 2026

Description

  • Added new scripts in package.json for running MM Connect tests on BrowserStack, including local tunnel support.
  • Updated appwright.config.ts to define specific test matches for MM Connect scenarios.
  • Enhanced the BrowserStackDeviceProvider to support local testing capabilities.
  • Updated README with instructions for running MM Connect tests locally and on BrowserStack.

This improves the testing framework for MM Connect, allowing for better integration with BrowserStack's local testing features.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-1419

Manual testing steps

Feature: MM Connect – Multichain API connection to local Browser

  Scenario: Connect wallet to local test dapp and verify multichain connection
    Given the user is logged into MetaMask on a mobile device
    And a local Browser Playground dapp server is running on port 8090
    When the user launches the mobile browser (Chrome)
    And the browser opens with a single tab and any first-run modals are dismissed
    And the user navigates to the dapp URL (local emulator or BrowserStack Local tunnel)
    And the user taps "Connect" in the dapp
    And the user approves the connection in MetaMask
    And the test switches back to the browser without reloading the page
    Then the dapp shows the wallet as connected with multichain scope cards
    And at least the default scope "eip155:1" is visible
    And the user can disconnect from the dapp

  Scenario: Connect to local dapp from BrowserStack cloud device via Local tunnel
    Given the BrowserStack Local binary is running with the same access key as in .e2e.env
    And the local Browser Playground dapp server is running on port 8090 on the host machine
    When the tester runs the test with BROWSERSTACK_LOCAL=true (e.g. yarn run-appwright:mm-connect-android-bs-local)
    Then the BrowserStack session is created with Local testing "On" (local: true in capabilities)
    And the cloud device loads the dapp at "http://bs-local.com:8090" through the tunnel
    And the test completes the connect flow and verifies multichain connection on the same dapp tab

Screenshots/Recordings

Before

After

Test run passes on browserstack

No impact on existing appwright performance tests workflows.

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.

Note

Medium Risk
Touches test infrastructure and the patched appwright runtime (BrowserStack/Appium capabilities, locator selection), which can change how CI sessions are created and how elements are resolved across many tests, but does not affect production app code.

Overview
Enables running MM Connect performance tests on BrowserStack with optional BrowserStack Local tunneling, including new package.json scripts and doc updates, and updates the multichain connect spec to use bs-local.com when BROWSERSTACK_LOCAL=true and to switch back to the existing browser tab after approvals.

Hardens Android browser automation by clearing/launching Chrome with FRE disabled, dismissing common first-run modals with bounded timeouts, and making navigation more resilient when the search box is missing.

Updates the patched appwright@0.1.45 provider behavior for CI stability/perf: single-worker/single-retry defaults, improved element lookup when textToMatch is unset, added Appium chromedriver auto-download support, expanded BrowserStack capabilities (local flag, build name override, logging/profiling/self-heal, and Appium settings), and allows skipping BrowserStack video downloads via DISABLE_VIDEO_DOWNLOAD (set in the performance runner workflow).

Written by Cursor Bugbot for commit ce3dada. This will update automatically on new commits. Configure here.

…Stack

- Added new scripts in `package.json` for running MM Connect tests on BrowserStack, including local tunnel support.
- Updated `appwright.config.ts` to define specific test matches for MM Connect scenarios.
- Enhanced the `BrowserStackDeviceProvider` to support local testing capabilities.
- Updated README with instructions for running MM Connect tests locally and on BrowserStack.

This improves the testing framework for MM Connect, allowing for better integration with BrowserStack's local testing features.
@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.

@metamaskbot metamaskbot added the team-qa QA team label Feb 12, 2026
@chrisleewilcox chrisleewilcox added No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Feb 12, 2026
@chrisleewilcox chrisleewilcox requested review from a team February 12, 2026 01:41
@chrisleewilcox chrisleewilcox changed the title test: add new Appwright test configurations for MM Connect on Browserstack test: add appwright test configurations for mm-connect for Browserstack local Feb 12, 2026
@chrisleewilcox chrisleewilcox marked this pull request as ready for review February 12, 2026 01:43
@chrisleewilcox chrisleewilcox requested a review from a team as a code owner February 12, 2026 01:43
- Updated the resolution hash for the appwright patch in `yarn.lock` to ensure correct versioning.
- Modified the checksum for the appwright dependency to reflect recent changes in the patch file.
- Adjusted the `appwright-npm-0.1.45-f282bc1c1b.patch` to maintain consistency with the updated resolution.
@chrisleewilcox chrisleewilcox changed the title test: add appwright test configurations for mm-connect for Browserstack local test: add appwright test configurations for mm-connect with Browserstack local Feb 12, 2026
- Updated the resolution hash for the appwright patch in `yarn.lock` to ensure correct versioning.
- Modified the checksum for the appwright dependency to reflect recent changes in the patch file.
- Adjusted the `appwright-npm-0.1.45-f282bc1c1b.patch` to maintain consistency with the updated resolution.
Resolve conflicts by adopting main's tests/ layout:
- package.json: use tests/appwright.config.ts, add mm-connect-android-bs and mm-connect-android-bs-local scripts
- tests/appwright.config.ts: use **/performance/mm-connect/** for mm-connect projects
- tests/framework/utils/MobileBrowser.js: main import paths, keep Chrome clear/FRE/modal/switchToMobileBrowser logic
- tests/performance/README.md: main structure, keep mm-connect project table and docs
- tests/performance/mm-connect/connection-multichain.spec.js: import from ../../framework/utils/MobileBrowser.js, keep switchToMobileBrowser

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

- Updated the `BROWSERSTACK_LOCAL` environment variable handling in the Appwright patch to ensure it correctly checks for string values.
- Removed the `BROWSERSTACK_LOCAL` variable from the performance test runner workflow to streamline the configuration.
- Revised the performance test documentation to clarify the usage of `BROWSERSTACK_LOCAL` and its impact on BrowserStack capabilities.
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR contains changes exclusively to the performance test infrastructure (appwright/BrowserStack tests), not the main Detox E2E test framework or any app code. The changes include:

  1. Performance test workflow updates (.github/workflows/performance-test-runner.yml) - removed BROWSERSTACK_LOCAL env var
  2. New npm scripts for MM Connect BrowserStack tests (package.json)
  3. Comment cleanup in appwright config (tests/appwright.config.ts)
  4. Mobile browser utility improvements for performance tests (tests/framework/utils/MobileBrowser.js)
  5. Documentation updates for MM Connect BrowserStack Local testing (tests/performance/README.md)
  6. MM Connect test updates for BrowserStack Local support (tests/performance/mm-connect/connection-multichain.spec.js)
  7. Appwright patch updates for BrowserStack capabilities (.yarn/patches/appwright-npm-0.1.45-f282bc1c1b.patch)
  8. yarn.lock hash update

Per the guidance: "Changes to wdio/ or tests/performance directories (separate test frameworks) do not require Detox tags - select none unless app code is also changed." No app code is modified in this PR - all changes are isolated to the performance test infrastructure which uses a completely separate test framework (appwright) from the Detox E2E tests.

Performance Test Selection:
While this PR modifies performance test infrastructure (appwright config, BrowserStack integration, MM Connect tests), these changes are to the test framework itself, not to app code that would affect performance. The changes improve how performance tests run on BrowserStack with local tunnel support, but don't require running performance tests to validate since: 1) No app code is changed that could impact performance, 2) The changes are to test infrastructure/tooling, 3) The PR is specifically about enabling/improving BrowserStack Local testing for MM Connect tests. Running performance tests would validate the infrastructure changes work, but that's typically done manually or in a separate validation step, not as part of the standard PR validation pipeline.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@chrisleewilcox chrisleewilcox added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit 8516a07 Feb 12, 2026
78 of 86 checks passed
@chrisleewilcox chrisleewilcox deleted the MMQA-1419-add-browserstack-localhost-support branch February 12, 2026 23:52
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2026
@metamaskbot metamaskbot added the release-7.67.0 Issue or pull request that will be included in release 7.67.0 label Feb 12, 2026
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. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.67.0 Issue or pull request that will be included in release 7.67.0 size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants