Overview
Chroma extends Playwright’s test fixtures to provide wallet-specific functionality. Fixtures are automatically set up and torn down for each test.Test-scoped fixtures
These fixtures are recreated for each test.page
An extended Playwright page with wallet extension context. Type:ExtendedPage
The browser context that contains loaded wallet extensions
Map of wallet type to Chrome extension ID
wallets
Wallet instances for interacting with wallet extensions. Type:ConfiguredWallets<T> (based on your configuration)
The wallets object contains instances for each wallet you configured:
- Single wallet
- Multiple wallets
Worker-scoped fixtures
These fixtures are created once per worker process and persist across all tests in that worker.walletContext
The Playwright browser context with wallet extensions loaded. Type:BrowserContext
Scope: Worker (persists across tests)
This context is created with:
- All configured wallet extensions loaded
- Persistent storage enabled
- Custom Chrome arguments for extension support
page fixture provides access to it via page.__extensionContext.
walletExtensionIds
A map of wallet types to their Chrome extension IDs. Type:Map<string, string>
Scope: Worker (persists across tests)
Usage:
Fixture lifecycle
Worker startup
When a worker process starts:
walletContextis created with all extensions loadedwalletExtensionIdsmap is populated by detecting service workers
Test execution
For each test:
pagefixture is created from the worker’s contextwalletsfixture creates wallet instances using the extension IDs- Test runs with access to all fixtures
Test cleanup
After each test:
pageandwalletsfixtures are cleaned upwalletContextandwalletExtensionIdspersist for the next test
Example
Complete example using all fixtures:Related
- createWalletTest - Configure wallet fixtures
- Wallet instances - Wallet method reference