Skip to content

AireForm Commands

A library of test commands to use when testing AireForms

Form Setup

gherkin
Given we are completing the form-name eform version

Loads the specified form into the browser ready for testing

gherkin
#Example:
Given we are completing the iapt-leeds eform v7

Standard Actions

These are the commands you will use most often When we set 'field-name' to 'new-value'

Will set the specified field to the new value. The way that we use this can vary between fields:

  • Textboxes/Freeform Inputs: The new value is typed into the field, replacing any existing text;
  • Radiobutton lists, select boxes: The option matching the new value is selected. An error is thrown if no option matches the new value;
  • Checkbox lists: The option(s) matching the new value(s) are selected. You can seperate multiple values with commas like json WHEN we set 'mylist' to 'option1, option2' An error is thrown if no option matches a new value; To un-select all options set the value to ''.
gherkin
When we set field values
| field-name | new-value |
| field-name | new-value |

Sets fields to values. Behaves just like 'WHEN we set 'x' to 'y'' but easier to read when you have lots of fields.

gherkin
When we set 'field-name' to anything

Sets the specified field to a random value. This is useful when a field requires a value but the value will not affect the outcome of the test, this makes clear which values you care about and which you just need completing.

gherkin
When we set fields to anything
| field-name |
| field-name |

Sets fields to random values. Behaves just like 'WHEN we set 'x' to anything' but easier to read when you have lots of fields.

gherkin
 When we do not provide a value to 'field-name'

Clears the specified field.

gherkin
When we move to the next page of the form

Moves to the next page of the form.

gherkin
When we submit the form

Submits the final page of a form.

Assertions

Once you have interacted with a form, you will want to verify it has reacted as expected.

gherkin
Then the form submits successfully

Checks that no issues were found when the form submits.

gherkin
Then page page-name is shown

Checks that the specified page is on-screen.

gherkin
Then 'field-name' shows 'expected-value'

Checks that the specified value is shown in a field. The way that we use this can vary between fields:

  • Textboxes/Freeform Inputs: The value is checked against the contents of the input;
  • Radiobutton lists, select boxes: the value is checked against the label of the selected item;
  • Checkbox lists: the value is checked against all the selected checkboxes, in order. Seperate items with a comma: ``THEN 'MyField' shows 'Option1, Option3'.
gherkin
Then 'field-name' is greater than 'expected-value'

Checks that the value in the field is greater than the expected value

gherkin
Then 'field-name' is empty

Checks that the specified field does not have a value

gherkin
Then 'field-name' is not empty

Checks that the specified field does have a value

gherkin
Then 'field-name' does not have a validation message

Checks that the specified field does not have a validation error visible.

gherkin
Then 'field-name' has a validation message
Then 'field-name' has a validation message 'expected message'

Checks that the specified field has a validation error visible. If specified, the message will be checked against the expected mesage.

gherkin
'Then a validation error shows'
'Then a validation error shows 'expected error message''

Checks that the page validation error is visible. If specified, the message will be checked against the expected mesage.

gherkin
Then 'field-name' is visible
Then 'field-name' is not visible

Checks that the specified field is or is not shown on the page.

gherkin
Then the 'section-name' form section is visible
Then the 'section-name' form section is not visible

Checks that the specified form section is or is not visible

gherkin
Then 'field-name' is enabled
Then 'field-name' is disabled

Checks that the specified field is enabled or not

gherkin
Then 'field-name' has an 'Other' input visible
Then 'field-name' does not have an 'Other' input visible

Certain fields, such as drop-down selects or similar may have the option for an 'Other' textbox, this asserts that this is or is not shown aireform-commands

gherkin
Then a validation error shows
Then a validation error shows 'expected message'

Checks that a validation message is shown in the popup at the bottom of the screen. If specified the expected message is checked, if not only the appearance of the popup is validated.

Controls With 'Other' Options

Sometimes a dropdown list or a radio button list can have an 'Other' option which then allows freeform input into a textbox. You can interact with this with the following:

gherkin
When we set the 'Other' input of 'field-name' to 'new-value'

If the other textbox is visible it will be filled in, if not an error will be thrown.

gherkin
Then 'field-name' has an 'Other' input visible

Checks that the specified field has its Other textbox visible.

gherkin
Then the 'Other' input of 'field-name' shows 'expected-value'

Checks that the contents of the field's Other textbox matches the expected value. If the Other textbox is not visible the value is considered to be an empty string.

Working With Repeaters

Things can be slightly more complex when working with repeaters, where you will have to specify the row that you want to look within when using assertions.

gherkin
When we set 'field-name' in row row-no of 'repeater-name' to 'new-value'

This will set the new value into the specified field of the repeater. The row number is 1-based

gherkin
When we add a new row to 'repeater-name'

Clicks the add new row button of the specified repeater. You must do this before interacting with the new row!

gherkin
Then 'field-name' in row row-no of 'repeater-name' shows 'expected-value'

Checks that the field in the specified row of the repeater matches the expected value

gherkin
Then 'field-name' is visible in row row-no of 'repeater-name'

Checks that the field in the specified row of the repeater is visible

gherkin
Then 'repeater-name' has (\d+) repetitions

Checks that the repeater has the correct number of repetitions (rows).

Working With Dates

We provide a number of commands that allow you to set date controls dynamically:

gherkin
When we set 'date' to today
When we set 'date' to tomorrow
When we set 'date' to yesterday
When we set 'date' to 2 months from today
When we set 'date' to 1 month ago
When we set 'date' to 5 days from today
When we set 'date' to 5 days ago

You can also assert dates dynamically:

gherkin
Then 'date' is equal to today
Then 'date' is equal to tomorrow
Then 'date' is equal to yesterday
Then 'date' is equal to 2 months from today
Then 'date' is equal to 1 month ago
Then 'date' is equal to 5 days from today
Then 'date' is equal to 5 days ago

Accepted Date Formats

When entering a fixed date value, the following explicit formats are supported:

  • D-MMMM-YYYY1-September-2025
  • DD-MMMM-YYYY01-September-2025
  • D-MMM-YYYY1-Sep-2025
  • DD-MMM-YYYY01-Sep-2025
  • D-M-YYYY1-9-2025
  • D-MM-YYYY1-09-2025
  • DD-M-YYYY01-9-2025
  • DD-MM-YYYY01-09-2025
  • YYYY-MM-D2025-09-1
  • YYYY-MM-DD2025-09-01

Examples:

gherkin
When we set 'date' to 01-09-2025
When we set 'date' to 1/9/2025
When we set 'date' to 01.09.2025
When we set 'date' to 1-Sep-2025
When we set 'date' to 1-September-2025
When we set 'date' to 2025-09-01

Separator Flexibility

By default, Aire Assert does not use strict parsing. This means that, in addition to hyphens (-), any of the following separators are also accepted:

-  _  :  .  ,  (  )
/

For example, all of the following are valid:

  • 01/09/2025
  • 01.09.2025
  • 01_09_2025
  • 01-09-2025