Building reliable onchain applications requires comprehensive testing. OnchainTestKit is a type-safe framework designed specifically for testing blockchain applications built with OnchainKit, providing seamless integration with Playwright for browser automation and wallet interactions.

What is OnchainTestKit?

OnchainTestKit is an end-to-end testing framework that automates:
  • Wallet connections (MetaMask, Coinbase Wallet)
  • Transaction flows and approvals
  • Network switching
  • Smart contract interactions
  • Token swaps and minting
  • Gas sponsorship testing

Why Use OnchainTestKit?

Testing blockchain applications manually is time-consuming and error-prone. OnchainTestKit provides:
  • Type Safety: Full TypeScript support with compile-time error checking
  • Wallet Automation: Programmatic control over wallet interactions
  • Parallel Testing: Run multiple tests simultaneously with isolated environments
  • Network Management: Built-in support for local Anvil nodes and fork testing
  • OnchainKit Integration: Designed to work seamlessly with OnchainKit components

Want to learn more?

Check out the full documentation for detailed guides on installation, configuration, and writing tests!

Architecture

Key Features

Automate browser-based wallet and dApp interactions with the power of Playwright’s testing framework.
Built-in support for MetaMask and Coinbase Wallet, with an extensible architecture for adding more wallets.
Automate connect, transaction, signature, approval, and network switching flows with simple APIs.
Use local Anvil nodes or remote RPC endpoints, with dynamic port allocation for parallel test execution.
Full TypeScript support for all configuration and test APIs, catching errors at compile time.
Builder pattern for intuitive wallet and node setup, making configuration readable and maintainable.

Next Steps