Reusable steps that can be shared across multiple tests
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 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.
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.
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.
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.