Skip to content

[πŸ› Bug]: connectToDapp() fails β€” confirmActionButton selector does not match MetaMask v13.13.1's Connect buttonΒ #1310

@Moku3956

Description

@Moku3956

πŸ”Ž Have you searched existing issues to avoid duplicates?

  • I have made sure that my issue is not a duplicate.

πŸ§ͺ Have you tested your code using latest version of Synpress?

πŸ’‘ Are you able to provide enough information to be able to reproduce your issue locally?

  • I can provide enough details to reproduce my issue on local environment.

Synpress version

4.1.2

Node.js version

20.20.1

Operating system

Ubuntu (WSL2 on Windows 11)

Run mode

Playwright + Synpress (as plugin)

CI platform (if applicable)

N/A

Are you running your tests inside docker? (if applicable)

  • This issue could be related to docker.

What happened?

This is first time to contribute OSS, so any feedback is welcome !!

connectToDapp() does not click the Connect button in MetaMask v13.13.1.

In the file (prepareExtension.ts), Synpress sets v13.13.1 as DEFAULT_METAMASK_VERSION.

However, in the file (actionFooter.ts), the confirmActionButton selector is defined as:

.page-container__footer [data-testid="page-container-footer-next"]

In MetaMask v13.13.1, the actual Connect button uses [data-testid="confirm-btn"].
This selector does not exist on the notification page, so connectToDapp() times out without clicking anything.

What is your expected behavior?

connectToDapp() should click the Connect button on the MetaMask notification page and successfully connect the wallet to the dapp.

How to reproduce the bug.

  1. Set up a wallet using defineWalletSetup and metamask.importWallet()
  2. Navigate to a dapp page
  3. Trigger the MetaMask connection popup (e.g. click a "Connect Wallet" button)
  4. Call await metamask.connectToDapp()
  5. The test times out β€” the Connect button is never clicked

I think if you implement Playwright with Synpress according to the official example, you will face this problem as well.

Relevant log output

Error: locator.click: Target page, context or browser has been closed
Call log:
  - waiting for locator('.page-container__footer [data-testid="page-container-footer-next"]')

    at confirmConnection (.../synpress-metamask/src/playwright/pages/NotificationPage/actions/connectToDapp.ts:22:68)
    at connectToDapp (.../synpress-metamask/src/playwright/pages/NotificationPage/actions/connectToDapp.ts:33:1)
    at NotificationPage.connectToDapp (.../synpress-metamask/src/playwright/pages/NotificationPage/page.ts:19:19)
    at MetaMask.connectToDapp (.../synpress-metamask/src/playwright/MetaMask.ts:165:3)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions