Skip to content

Conversation

@osis
Copy link
Collaborator

@osis osis commented Dec 14, 2025

Short description of work done

Support for Metamask 13

PR Checklist

  • I have run linter locally
  • I have run unit and integration tests locally

@osis osis requested a review from a team as a code owner December 14, 2025 07:53
@changeset-bot
Copy link

changeset-bot bot commented Dec 14, 2025

🦋 Changeset detected

Latest commit: 9442b54

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tenkeylabs/dappwright Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link

Summary of Changes

Hello @osis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request brings Dappwright up to date with MetaMask version 13 beta. It involves a comprehensive overhaul of the interaction logic for various MetaMask functionalities, from network and account management to token operations and initial setup. The changes are crucial for maintaining seamless automated testing and interaction capabilities with the latest MetaMask release.

Highlights

  • MetaMask 13 Beta Support: The primary goal of this pull request is to update the Dappwright library to support the new MetaMask version 13 beta, ensuring compatibility with its latest UI and internal changes.
  • Refactored MetaMask Interactions: Numerous actions for MetaMask, including adding/deleting networks, creating/deleting/switching accounts, importing private keys, and adding tokens, have been refactored to align with the updated MetaMask 13 interface.
  • New Utility Functions: A new utility file (src/wallets/metamask/actions/util.ts) has been introduced, providing helper functions like accountList, networkListItem, and clickBackButton to abstract common locator patterns and improve code reusability and maintainability.
  • Onboarding and Setup Flow Updates: The MetaMask onboarding and account import processes have been significantly revised in src/wallets/metamask/setup/setupActions.ts to match the new user experience of MetaMask 13.
  • Test Suite Adjustments: The wallet interaction tests (test/2-wallet.spec.ts) have been updated to reflect the new interaction patterns and locators introduced by MetaMask 13, ensuring the automated tests continue to function correctly.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the project to support MetaMask v13 beta. The changes are extensive, touching many files to adapt to the new UI flows and selectors. A number of helper functions have been introduced in util.ts to improve code reuse and maintainability, which is a great improvement. I've identified a few areas for improvement, including a potential bug in balance parsing and some opportunities to enhance code maintainability. Overall, this is a solid and necessary update.

@osis osis changed the title feat: metamask 13 beta feat: metamask 13 support Dec 26, 2025
Copy link
Collaborator Author

@osis osis left a comment

Choose a reason for hiding this comment

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

Specifically waited for 13.12.x where there is more flexibility when setting up the wallet to turn off backup & sync. Without this option disabled, there would have to be 3-5min waits for the list of accounts to sync since the test wallet has > 200 accounts.

Waiting for this flexibility also meant that we got introduced to the new side panel UI that MetaMask has incorporated. Playwright doesn't really consider the side panel to be part of it's official supported mechanisms but you can dig the page out of the browser context.

Doing requires an environment flag (PW_CHROMIUM_ATTACH_TO_OTHER = '1') to be set before the context is created. Since dAppwright creates its own context, this is easy for us to do at runtime without introducing a breaking change for burdening users with this context.

Beyond this, MetaMask is looking better than ever. Always like seeing all the easier ways folks can onboard into the ecosystem.

@osis osis merged commit 0ff83e0 into main Dec 26, 2025
7 of 8 checks passed
@osis osis deleted the df/metamask13 branch December 26, 2025 05:09
@github-actions github-actions bot mentioned this pull request Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants