Skip to content

metamask.open() ​

Navigates to or focuses the MetaMask extension settings tab (chrome-extension://.../home.html).

This command is provided by the built-in metamask plugin. When tests navigate across multiple browser tabs, metamask.open() allows the test to switch back to the MetaMask extension window to inspect account balances, adjust settings, or unlock the wallet.

Paid Add-On: MetaMask Test Runner

This command requires running tests on the MetaMask browser runner, which is available as a paid add-on for your UI-licious workspace. Businesses can contact our team at [email protected] or visit uilicious.com/contact-sales to request a trial.

Load the Plugin

The metamask plugin must be loaded in your test script before calling metamask.open():

js
let metamask = TEST.loadPlugin("metamask")

Usage ​

js
// Load the plugin
let metamask = TEST.loadPlugin("metamask")

// Open or switch to MetaMask extension tab
metamask.open()

Parameters ​

This command takes no parameters.

Handling Device Locks ​

During long-running tests, MetaMask may automatically lock due to inactivity. When this happens, MetaMask displays an Unlock screen asking for the device password.

You can retrieve the temporary device password that was generated for the current test run via metamask.getDevicePassword():

js
// Reopen MetaMask extension tab
metamask.open()

// Unlock if prompted
if (I.see$("Unlock")) {
    I.fill("Password", metamask.getDevicePassword())
    I.click("Unlock")
}

Examples ​

Return to MetaMask Settings ​

js
let metamask = TEST.loadPlugin("metamask")
metamask.setup()

// Navigate to dApp
I.goTo("https://app.example.com")
I.click("Connect Wallet")

// Switch back to MetaMask to inspect wallet state
metamask.open()
I.see("Account 1")

See Also ​