Field Types

Field types control how processDataTable in stepHelpers.js interacts with form fields.

Interaction types

ConstantString valueWhen to use
FIELD_TYPES.FILL"FILL"Plain text <input> or <textarea>
FIELD_TYPES.FILL_AND_ENTER"FILL_AND_ENTER"Fill then press Enter (chips, tag inputs)
FIELD_TYPES.DROPDOWN"DROPDOWN"Native <select> or ARIA combobox
FIELD_TYPES.CLICK"CLICK"Button or toggle activated by click
FIELD_TYPES.CHECKBOX_TOGGLE"CHECKBOX_TOGGLE"Checkbox located by label text
FIELD_TYPES.TOGGLE"TOGGLE"Boolean toggle switch
FIELD_TYPES.CUSTOM"CUSTOM"Unique interaction — requires fieldHandlers

Validation types

ConstantWhen to use
FIELD_TYPES.INPUT_VALUEAssert text input .value via toHaveValue
FIELD_TYPES.DROPDOWN_VALUEAssert selected dropdown option text
FIELD_TYPES.TEXT_VISIBLEAssert element text visible by testID

Example

When I fill in the form
  | Field      | Value           | Type            |
  | First Name | <gen_test_data> | FILL            |
  | Country    | United States   | DROPDOWN        |
  | Subscribe  |                 | CHECKBOX_TOGGLE |
  | Submit     |                 | CLICK           |

Faker patterns for <gen_test_data>

Field name containsGenerated value
emailfaker.internet.email()
phonefaker.phone.number()
name + companyfaker.company.name()
namefaker.person.fullName()
catchphrasefaker.company.catchPhrase()
address / streetfaker.location.streetAddress()
cityfaker.location.city()
zip / postalfaker.location.zipCode()
countryfaker.location.country()
statefaker.location.state()
website / urlfaker.internet.url()
description / commentfaker.lorem.sentence()
id / number / codefaker.string.alphanumeric(8).toUpperCase()
tagfaker.string.alphanumeric(6).toUpperCase()
dateISO date string (future)
amount / priceRandom integer 1–1000
(default){word}_{6-digit-timestamp}