Instructions
Each Lila step in a test needs to be one of the following instructions specified above.
Keep instructions high level to build robust and self-healing tests. Lila infers the context and interacts with the appropriate components automatically.
steps:
...
- click: on the checkout button represented by a cart located at the top right navbar right next to the user icon # this is BAD
- click: on the cart button # this is GOOD
...
goto
Navigates to a URL. It only accepts a URL as parameter.
All lila tests must start with a goto
instruction. But also a goto
can happen anywhere in the tests additionally.
Example:
steps:
...
- goto: https://my-app.com/
...
click
Performs a click over an element of the UI.
Examples:
steps:
...
- click: on the 'cart' button
...
steps:
...
- click: on the user settings menu
...
steps:
...
- click: on the directions icon
...
type
Types text on an input field. This instruction knows how to focus on the input field to enable text entry.
Lila will infer the input field by context if not explicitly specified.
Examples:
steps:
...
- type: 'ipad' on the search bar.
...
steps:
...
- type: a random address
...
search
Performs a search. This includes typing on a search input and submitting. Lila will infer the search bar from the context if not specified.
search
also submits the search.
Examples:
steps:
...
- search: for 'ipad'
...
steps:
...
- search: for '5 minutes ago' in the time window dropdown
...
hover
Moves the pointer to a location to hover. This instruction does not click, just moves the pointer.
Example:
steps:
...
- hover: over 'by cateogry' dropdown
...
verify
This is a visual assertion. Lila will fail if the condition is not met. verify
is not supposed to do any action, but just observe and assert.
Examples:
steps:
...
- verify: login was successful
...
steps:
...
- verify: there are at least 4 products
...
steps:
...
- verify: cart has 5 items
...
login
Submits a login form with the provided data. If browser is not in the login form, Lila will try to navigate to it as part of this instruction.
login
does not verify the login was successful. This is to support testing wrong creds. To test the login was successfull (or not), use a verify
step right after.
Example:
steps:
...
- login: using email ${QA_EMAIL} and password ${QA_PWD}
...