Skip to main content

Introduction

Chroma is an end-to-end testing library that simplifies testing blockchain wallet interactions using Playwright. It provides a unified API for testing wallet extensions like Polkadot JS, Talisman, and MetaMask.

Why Chroma?

Testing dApps with wallet extensions is traditionally difficult:
  • Complex setup - Manually loading browser extensions and handling multiple contexts
  • Brittle selectors - Wallet UIs change frequently, breaking tests
  • No type safety - Writing raw Playwright scripts without autocomplete or validation
  • Multi-wallet testing - Testing with multiple wallets requires duplicated code
Chroma solves these problems with:
  • Easy extension setup - Download wallet extensions with a single command
  • Multi-wallet support - Test with multiple wallet extensions simultaneously
  • TypeScript support - Full type safety and autocomplete
  • Stable API - High-level methods that abstract wallet implementation details

Supported wallets

Chroma supports the following wallet extensions:

Polkadot JS Extension

Version 0.62.6

Talisman

Version 3.2.0

MetaMask

Version 13.17.0 (Flask)

Supported chains

  • Polkadot - Fully supported
  • Ethereum - Fully supported
  • Solana - Planned

Quick example

import { 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()
})

Get started

Installation

Install Chroma and download wallet extensions

Quickstart

Build your first wallet test in minutes

API reference

Explore the complete API documentation

Supported wallets

See all supported wallet extensions

Requirements

  • Node.js 24+
  • @playwright/test ^1.57.0

Build docs developers (and LLMs) love