synpress icon indicating copy to clipboard operation
synpress copied to clipboard

export metamask, playwright objects

Open asa93 opened this issue 2 years ago • 1 comments

Sometimes I want to do low level operations for example disabling experimental settings and I wish to use directly the metamask object but it is not currently in module.exports

asa93 avatar Mar 08 '23 19:03 asa93

Hey @asa93,

You can import metamask and playwright objects like this:

import * as metamask from "@synthetixio/synpress/commands/metamask";
import * as playwright from "@synthetixio/synpress/commands/playwright";
const metamask = require("@synthetixio/synpress/commands/metamask");
const playwright = require("@synthetixio/synpress/commands/playwright");

Example: https://github.com/drptbl/synpress-examples/blob/master/playwright/isolated-state/tests/connect-wallet.spec.ts

Let me know if that suits your needs. If not, please be more specific on what you want to achieve or what do you want to have exported specifically. Thanks!

drptbl avatar Mar 08 '23 20:03 drptbl