Skip to main content

Installation

Get started with Chroma by installing the package and downloading wallet extensions.

Install the package

Install Chroma along with its peer dependency @playwright/test:
npm install @avalix/chroma @playwright/test
@playwright/test is a peer dependency and must be installed separately to avoid version conflicts with your existing Playwright setup.

Download wallet extensions

Before running your tests, download the wallet extensions you want to test with:
npx chroma download-extensions
This command downloads wallet extensions (MetaMask, Polkadot JS, Talisman) to the .chroma directory in your project root.
You must run this command before running Playwright tests. If the extension is not found, tests will fail with a helpful error message.

Add to package.json

For convenience, add the download command to your package.json scripts:
package.json
{
  "scripts": {
    "test:prepare": "chroma download-extensions",
    "test": "playwright test"
  }
}
Then run:
npm run test:prepare
npm test

Verify installation

Create a simple test file to verify your installation:
test.spec.ts
import { test, expect } from '@avalix/chroma'

test('basic test', async ({ page }) => {
  await page.goto('https://example.com')
  await expect(page).toHaveTitle(/Example/)
})
Run the test:
npx playwright test
The default test export from Chroma is pre-configured with the Polkadot JS wallet. For custom wallet configurations, use createWalletTest().

What’s in .chroma?

The .chroma directory contains:
  • metamask-extension-13.17.0/ - MetaMask extension files
  • polkadot-extension-0.62.6/ - Polkadot JS extension files
  • talisman-extension-3.2.0/ - Talisman extension files
Add .chroma/ to your .gitignore file. The extensions should be downloaded as part of your test setup, not committed to version control.

Next steps

Quickstart

Build your first wallet test

API reference

Explore the complete API

Build docs developers (and LLMs) love