Modules
A module is a reusable block of steps. Extract common flows (log in, create a project, seed a cart) into a module and reference them from tests so the flow is defined in one place.
Define
modules/login.yamlyaml
name: login
inputs:
email: string
password: string
steps:
- navigate: /login
- type:
element: email input
text: "{{ input.email }}"
- type:
element: password input
text: "{{ input.password }}"
- click: sign in
- wait-for-url:
ends-with: /dashboardUse
yaml
steps:
- module:
name: login
with:
email: "{{ env.TEST_EMAIL }}"
password: "{{ secret.TEST_PASSWORD }}"
- click: new project