Skip to content

test: Adding e2e tests for bridge #15067

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 11 commits into from
May 23, 2025
Merged

test: Adding e2e tests for bridge #15067

merged 11 commits into from
May 23, 2025

Conversation

davibroc
Copy link
Contributor

@davibroc davibroc commented May 1, 2025

Description

This PR adds two Bridge tests to Mobile:

  • Bridge ETH (Mainnet)->SOL(Solana)
  • Bridge ETH (Mainnet)->ETH (Base) with STX enabled
  • Bridge ETH (Mainnet)->ETH(Optimism) with STX disabled
Solana-e2e.1.mov

Related issues

Fixes:

Manual testing steps

  1. yarn && yarn build:test
  2. yarn test:e2e:android:debug:run e2e/specs/bridge/bridge-action-smoke.spec.js

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

github-actions bot commented May 1, 2025

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 May 1, 2025
@davibroc davibroc added the No E2E Smoke Needed If the PR does not need E2E smoke test run label May 1, 2025
@davibroc davibroc force-pushed the test/add-bridge-tests branch 3 times, most recently from 49546a7 to e997697 Compare May 21, 2025 08:30
@davibroc davibroc changed the title test: e2e tests for unified swap/bridge UI test: Adding e2e tests for bridge May 21, 2025
@davibroc davibroc added Run Smoke E2E Requires smoke E2E testing No QA Needed Apply this label when your PR does not need any QA effort. and removed No E2E Smoke Needed If the PR does not need E2E smoke test run labels May 21, 2025
@davibroc davibroc force-pushed the test/add-bridge-tests branch from 4c9245b to 5b30199 Compare May 22, 2025 16:28
@MetaMask MetaMask deleted a comment from github-actions bot May 22, 2025
@davibroc davibroc added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 22, 2025
@MetaMask MetaMask deleted a comment from github-actions bot May 22, 2025
@davibroc davibroc added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 22, 2025
@MetaMask MetaMask deleted a comment from github-actions bot May 22, 2025
@davibroc davibroc added the Run Smoke E2E Requires smoke E2E testing label May 22, 2025
@davibroc davibroc requested a review from cortisiko May 22, 2025 20:36
@chrisleewilcox chrisleewilcox requested a review from Copilot May 22, 2025 21:01
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds two new end-to-end tests for bridging tokens in Mobile, covering both ETH (Mainnet) to ETH (Base) and ETH (Mainnet) to SOL (Solana) scenarios. It also introduces supporting constants, selectors, page objects, mocks, and fixture updates to enable these tests.

  • Updated fixture configuration for Ganache network (see fixture-builder.js).
  • Added constants, selectors, and page objects to support bridge tests.
  • Integrated new mocks and tests for validating the bridge flow.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
e2e/specs/confirmations/send-to-contract-address.spec.js Removed the buildPermissions parameter from the Ganache network fixture.
e2e/specs/bridge/costants.js Added bridge test constants (note potential filename typo).
e2e/specs/bridge/bridge-mocks.js Added and updated mock handling for bridge API endpoints.
e2e/specs/bridge/bridge-action-smoke.spec.js Introduced end-to-end tests for ETH-to-Base and ETH-to-SOL bridging.
e2e/selectors/Transactions/ActivitiesView.selectors.js Updated selectors to include bridge transaction details.
e2e/selectors/Bridge/QuoteView.selectors.js Added selectors specific to the Bridge Quote view.
e2e/pages/wallet/WalletActionsBottomSheet.js Added a bridge button getter and tap method.
e2e/pages/wallet/TokenOverview.js Added a bridge button getter and tap action.
e2e/pages/wallet/AddAccountBottomSheet.js Included methods for adding a Solana account.
e2e/pages/Transactions/ActivitiesView.js Added helper methods for generating bridge activity labels.
e2e/pages/Bridge/QuoteView.js Created a page object for the Bridge Quote view with corresponding actions.
e2e/fixtures/fixture-builder.js Updated the Ganache network function to accept a parameterized chainId.
Comments suppressed due to low confidence (1)

e2e/specs/bridge/costants.js:1

  • The filename 'costants.js' appears to be misspelled; consider renaming it to 'constants.js' for improved clarity.
export const localNodeOptions = {

Copy link
Contributor

@chrisleewilcox chrisleewilcox left a comment

Choose a reason for hiding this comment

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

Not sure if it would be too much at this point but is it possible to convert some of the new files into typescript?

hjetpoluru
hjetpoluru previously approved these changes May 22, 2025
Copy link
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

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

Nice job! Lgtm

@davibroc
Copy link
Contributor Author

Not sure if it would be too much at this point but is it possible to convert some of the new files into typescript?

Done

@MetaMask MetaMask deleted a comment from github-actions bot May 23, 2025
@davibroc davibroc added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 23, 2025
Copy link
Contributor

github-actions bot commented May 23, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 5d50f74
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/05cc4128-e715-45eb-b82c-dd64e106fdd2

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

Copy link

@hjetpoluru
Copy link
Contributor

@davibroc Congratulations! Yeah, this is the first TypeScript file in the mobile repo!

I noticed something during the review in Copilot (not urgent):
e2e/specs/bridge/costants.js:1

The filename costants.js appears to be misspelled. Consider renaming it to constants.js for improved clarity.

@hjetpoluru hjetpoluru self-requested a review May 23, 2025 12:52
@davibroc davibroc added this pull request to the merge queue May 23, 2025
Merged via the queue into main with commit e05dbe7 May 23, 2025
50 of 52 checks passed
@davibroc davibroc deleted the test/add-bridge-tests branch May 23, 2025 13:14
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2025
@metamaskbot metamaskbot added the release-7.48.0 Issue or pull request that will be included in release 7.48.0 label May 23, 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.48.0 Issue or pull request that will be included in release 7.48.0 Run Smoke E2E Requires smoke E2E testing team-qa QA team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants