Skip to content

avalix-labs/chroma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chroma

End-to-end testing library for Polkadot wallet interactions using Playwright.

Quick Start

npm install @avalix/chroma @playwright/test
npx chroma download-extensions
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()
})

For detailed tutorials and guides, visit the Documentation

Supported Wallets & Chains

Supported Chains

Chain Status
Polkadot ✅ Supported
Ethereum ✅ Supported
Solana ⏳ Planned

Supported Wallets

Wallet Status Version
Polkadot JS Extension ✅ Supported v0.62.6
Talisman ✅ Supported v3.1.13
SubWallet ⏳ Planned -
MetaMask ✅ Supported v13.17.0 (Flask)

Test Matrix

For detailed test coverage and mapping of features to tests, see TEST_MATRIX.md.

Running Tests

Unit Tests

cd packages/chroma
bun run test:unit:coverage

E2E Tests (Local)

# Polkadot-JS dApp
cd packages/e2e-polkadot-js
bun run test

# EVM dApp
cd packages/e2e-evm
bun run test

E2E Tests (Docker)

# 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 bash

Project Structure

packages/
├── 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

License

MIT

About

Chroma is an end-to-end (E2E) testing library specifically designed for Polkadot wallet interactions. It enables developers to write automated tests that interact with real wallet extensions, providing a comprehensive testing solution for decentralized applications (dApps) in the Polkadot ecosystem.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors