What is OnchainTestKit?
@coinbase/onchaintestkit
is a comprehensive, type-safe framework for end-to-end testing of blockchain applications. Built to complement OnchainKit, it provides seamless integration with Playwright for robust automation of browser-based wallet interactions, local blockchain node management, and common blockchain testing scenarios.
Quickstart
Get up and running with OnchainTestKit in minutes
Configuration
Learn how to configure wallets and networks
Writing Tests
Write your first blockchain tests
CI/CD
Integrate these in CI/CD
Important: To effectively use OnchainTestKit, we strongly recommend studying:
- The main repository - Explore the source code, understand the architecture, and see how components work together
- The example tests - Real-world examples showing wallet connections, transactions, token swaps, and more
Why OnchainTestKit?
Modern blockchain applications require rigorous testing of wallet interactions, transaction flows, and network behavior. Manual testing is error-prone and slow, especially when dealing with complex wallet UIs and multiple networks. OnchainTestKit automates these processes, ensuring:- Reliability: Consistent test execution across environments
- Reproducibility: Deterministic test results
- Scalability: Parallel test execution support
- Type Safety: Full TypeScript support
Architecture
Key Features
Playwright Integration
Playwright Integration
Automate browser-based wallet and dApp interactions with the power of Playwright’s testing framework.
Multi-Wallet Support
Multi-Wallet Support
Built-in support for MetaMask and Coinbase Wallet, with an extensible architecture for adding more wallets.
Smart Action Handling
Smart Action Handling
Automate connect, transaction, signature, approval, and network switching flows with simple APIs.
Network Management
Network Management
Use local Anvil nodes or remote RPC endpoints, with dynamic port allocation for parallel test execution.
Type Safety
Type Safety
Full TypeScript support for all configuration and test APIs, catching errors at compile time.
Fluent Configuration
Fluent Configuration
Builder pattern for intuitive wallet and node setup, making configuration readable and maintainable.
Next Steps
1
Install OnchainTestKit
Follow our quickstart guide to set up your testing environment
2
Configure Your Wallets
Learn how to configure wallets for your test scenarios
3
Write Your First Test
Start writing tests with our comprehensive guide