Skip to content

[🐛 Bug]: Renaming a metamask account with Metamask#renameAccount() gets stuck in account details modal #1292

@mgiagante

Description

@mgiagante

🔎 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.0

Node.js version

22.13.0

Operating system

macOS Sequoia 15.5

Run mode

Playwright + Synpress (as plugin)

CI platform (if applicable)

GitHub Actions

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

  • This issue could be related to docker.

What happened?

In my wallet config file metamask-connected.setup.ts I use metamask.renameAccount() to rename the first account in the wallet from "Account 1" to "Default Account".

The issue arises when building the wallet cache with the synpress command.
When the line for renaming the account runs, the browser will interact with Metamask to rename it, but will not click the Edit button and will get stuck there with the account details modal open.

import { defineWalletSetup } from "@synthetixio/synpress";
import { MetaMask, getExtensionId } from "@synthetixio/synpress/playwright";
import type { BrowserContext, Page } from "@playwright/test";
import { env } from "../../utils/typed-env";

const SEED_PHRASE = env.METAMASK_SEED_PHRASE;
const PASSWORD = env.METAMASK_PASSWORD;

export default defineWalletSetup(PASSWORD, async (context: BrowserContext, walletPage: Page) => {
  const extensionId = await getExtensionId(context, "MetaMask");
  const metamask = new MetaMask(context, walletPage, PASSWORD, extensionId);

  await metamask.importWallet(SEED_PHRASE);

  await metamask.renameAccount("Account 1", "Default Account");

  const page = await context.newPage();
  await metamask.switchNetwork("Sepolia", true);
});

What is your expected behavior?

The Metamask object should command the browser to click the Edit button and successfully edit the account.

How to reproduce the bug.

Use a wallet setup file like the one listed (which includes the method call await metamask.renameAccount("Account 1", "Default Account");) and run the synpress command to generate a new wallet cache. Use --force if needed.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions