*.setup.{ts,js,mjs}
.
Here are some examples of valid file names:
basic.setup.ts
connected.setup.ts
optimism.setup.ts
multi-user.setup.ts
defineWalletSetup
function from @synthetixio/synpress
:
dotenv
with any other alternative to load the environmental variables.defineWalletSetup
function. It takes two arguments, the password, and the setup function.
The setup function is where the magic happens. Contents of this function will be executed in the browser context, which means you can use all browser-related Playwright APIs.
Here’s how you can import a wallet with MetaMask or Phantom:
synpress
. Here’s how to do it:
[PROJECT_ROOT]/test/wallet-setup
directory. If you want to use a different one, you can pass it as an argument to the CLI:
synpress --help
to see all available options.--headless
flag to the CLI or set the HEADLESS
environmental variable to true
.[PROJECT_ROOT]/.cache-synpress
directory.
Each cache is saved in a separate directory named after the hash of the wallet setup file.
.cache-synpress
directory to your .gitignore
file.defineWalletSetup
function. This means you can import other files, define constants, etc., without affecting the hash.
Based on the wallet setup above, only the following lines will be used to generate the hash:
SEED_PHRASE
constant and inline it like this:
console.log
and debugger
statements are stripped out before the hash is generated, which means they do NOT affect the hash.To learn more about this, see the Debugging Wallet Setup Files section.