Skip to main content

Steps

Type of steps

Each Lila step in a test needs to be one of the following instructions specified above.

important

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
...

input

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
...

pick

Selects an option from a dropdown.

Examples:

steps:
...
- pick: UTC from the timezone dropdown
...

submit

Submits a form.

Examples:

steps:
...
- submit: the login form
...
note

input and submit instructions are used together to fill out and submit forms. input by itseld won't submit any form.

Verifications

Each step can be followed by a one or more verifications. Verifications are used to assert the state of the application after the step is executed.

tip

Include a verify instruction after each step to ensure the application is in the expected state.

Examples:

steps:
...
- click: on the 'cart' button
verify:
- there are 3 items in the cart
- total purchase is $100
...