End-to-end testing library for Polkadot wallet interactions using Playwright.
npm install @avalix/chroma @playwright/test
npx chroma download-extensionsimport { createWalletTest } from '@avalix/chroma'
const test = createWalletTest({
wallets: [{ type: 'polkadot-js' }]
})
test('connect wallet', async ({ page, wallets }) => {
const polkadotJs = wallets['polkadot-js']
await polkadotJs.importMnemonic({
seed: 'bottom drive obey lake curtain smoke basket hold race lonely fit walk'
})
await page.goto('http://localhost:3000')
await polkadotJs.authorize()
await polkadotJs.approveTx()
})For detailed tutorials and guides, visit the Documentation
| Chain | Status |
|---|---|
| Polkadot | ✅ Supported |
| Ethereum | ✅ Supported |
| Solana | ⏳ Planned |
| Wallet | Status | Version |
|---|---|---|
| Polkadot JS Extension | ✅ Supported | v0.62.6 |
| Talisman | ✅ Supported | v3.1.13 |
| SubWallet | ⏳ Planned | - |
| MetaMask | ✅ Supported | v13.17.0 (Flask) |
For detailed test coverage and mapping of features to tests, see TEST_MATRIX.md.
cd packages/chroma
bun run test:unit:coverage# Polkadot-JS dApp
cd packages/e2e-polkadot-js
bun run test
# EVM dApp
cd packages/e2e-evm
bun run test# Build the Docker image
docker build -t chroma-test .
# Run e2e-polkadot-js tests
docker run --rm --shm-size=2gb -e E2E_TARGET=polkadot-js chroma-test
# Run e2e-evm tests
docker run --rm --shm-size=2gb -e E2E_TARGET=evm chroma-test
# Interactive debugging
docker run -it --rm --shm-size=2gb chroma-test bashpackages/
├── chroma/ # Main library
│ ├── src/ # Source code
│ │ ├── context-playwright/ # Playwright fixtures
│ │ ├── wallets/ # Wallet implementations
│ │ └── utils/ # Utilities
│ └── tests/ # E2E tests playground for the library
├── e2e-polkadot-js/ # Polkadot dApp example
└── e2e-evm/ # EVM dApp example
MIT