Modules
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
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.
The return value of the module will be cached, allowing you to use it in subsequent steps. The return value of a module is the return value of the last step.
Make sure to configure the cache key and expiry.
Authentication
Make sure the authenticated session expiry time is longer than the cache expiry time. If the session expires, the module will need to be re-executed.
If your module is performing authentication logic, you can enable the Treat as auth module option. This will automatically save and restore the authentication state between test runs, allowing you to reuse the same authentication session without having to log in again.
Values stored: