Available Fixtures
OnchainTestKit provides several fixtures for your tests:Fixtures are automatically injected into your test functions and handle setup/teardown.
Fixture | Type | Description |
---|---|---|
page | Page | Playwright page object for browser automation |
metamask | MetaMask | MetaMask wallet automation interface |
coinbase | CoinbaseWallet | Coinbase wallet automation interface |
node | LocalNodeManager | Local blockchain node manager |
smartContractManager | SmartContractManager | Smart contract deployment and interaction |
Basic Wallet Operations
Connecting a Wallet
Network Switching
Transaction Testing
Basic Transaction
Rejecting Transactions
Advanced Testing Patterns
Parallel Test Execution
Best Practices
1
Wait for state changes
Always wait for UI updates after wallet actions:
2
Handle errors gracefully
Always include error scenarios in your tests:
Debugging Tests
Visual Debugging
Console Logs
CI/CD Integration
GitHub Actions Example
Next Steps
Start testing your onchain application today:- Install OnchainTestKit in your project
- Write your first test following the examples above
- Integrate tests into your CI/CD pipeline
- Expand test coverage as you build new features
- See example tests
- Access the full docs here