Skip to main content
This guide covers everything you need to know about writing tests with OnchainTestKit, from basic wallet connections to complex transaction scenarios. NOTE that some of these examples may be different from what you implement depending on your frontend code.

Available Fixtures

OnchainTestKit provides several fixtures for your tests:
Fixtures are automatically injected into your test functions and handle setup/teardown.

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

Next Steps