Parameters
Flexible Module Configuration
Parameters allow you to pass different values to the module when you use it in a test. This way, you can use the same module with different inputs without duplicating steps.
Parameter keys are strings and parameter values are any valid JavaScript value, including strings, numbers, booleans, and objects.
Caching
- Overview
- Configuration
By default, modules are not cached, meaning they will always execute. However, you can enable caching to speed up test execution by skipping steps that have already been completed.
Authentication
1
Validate Authentication State
Make sure the last step of the module is validating the authentication state (e.g. by checking if the user is logged in or if a specific element is present).
2
Enable Auth Module Option
If your module is performing authentication logic, enable the Treat as auth module option.
3
Automatic State Management
This will automatically save and restore the authentication state between test runs.
Values Stored
- Cookies
- localStorage
- IndexedDB
How Modules Work
Simple Reusable Flows
Instead of duplicating the same login steps in every test, create a login module that accepts a username and password, then handles all the navigation, typing, and verification automatically.
Smart Parameterization
Modules become powerful when they adapt to different scenarios. Your checkout module might handle:
- Credit cards
- PayPal
- Bank transfers
Advanced Module Patterns
Conditional Logic Within Modules
Conditional Logic Within Modules
Modules can include intelligent decision-making:
- Check if a user already exists
- Either create a new account or log in with existing credentials
- Handle different payment methods based on input
Module Composition
Module Composition
Build complex workflows by combining simpler modules:
- Login module
- Search module
- Checkout module
Environment-aware Modules
Environment-aware Modules
Modules can adapt to different environments automatically:
- Use test credit cards in staging
- Real payment flows in production testing
- Different API endpoints per environment
Best Practices
Single Responsibility
Each module should focus on one specific user flow or functionality.
Clear Interfaces
Define clear parameters for your modules:
- What inputs do they need?
- What outputs do they provide?
Error Handling
Modules should handle common error scenarios gracefully:
- Provide clear feedback when failures occur
- Handle edge cases appropriately
Documentation
Clear descriptions help both humans and AI understand the module’s purpose and proper usage.
Module Testing and Validation
- Module-level Testing
- Integration Testing
- Performance Considerations
Test your modules independently to ensure they work correctly in isolation.

