Quickstart
This guide walks you through creating your first wallet test with Chroma. You’ll learn how to set up a test, import a wallet, and interact with a dApp.Prerequisites
Before you begin, make sure you’ve:- Installed Chroma
- Downloaded wallet extensions with
npx chroma download-extensions - Have a local dApp running (or use a test URL)
Create your first test
Create a test file
Create a new file The
wallet.spec.ts in your project:wallet.spec.ts
createWalletTest function configures Playwright with wallet support. The wallets array specifies which wallet extensions to load.Import a wallet mnemonic
Add a test that imports a mnemonic into the Polkadot JS wallet:
wallet.spec.ts
The
wallets fixture provides access to all configured wallet instances. Each wallet is keyed by its type (e.g., 'polkadot-js', 'metamask').Authorize the connection
When your dApp requests wallet access, approve it with
authorize():wallet.spec.ts
Approve transactions
When your dApp creates a transaction, approve it with
approveTx():wallet.spec.ts
Complete example
Here’s the complete test file:wallet.spec.ts
Testing with MetaMask
To test with MetaMask instead, change the wallet type:Testing with multiple wallets
You can test with multiple wallets simultaneously:Next steps
API reference
Explore all available wallet methods
Wallets
Learn about supported wallets
CI/CD integration
Run tests in continuous integration
Multi-wallet testing
Test with multiple wallets