Editing a module will update all tests that use it. This allows you to maintain a single source of truth for your test logic, making it easier to manage and update.
Modules are reusable steps that can be shared across multiple tests. This is particularly useful for complex workflows or when you need to perform the same actions in different tests.

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

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
One module can handle dozens of different scenarios.

Advanced Module Patterns

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

Test your modules independently to ensure they work correctly in isolation.