Const
Use this InteractorConstructor as a base for creating interactors which work with form fields. This allows you to use field labels as locators, and also provides some basic filters which are convenient for most form fields.
Locates the form field by its label.
const PasswordField = FormField.extend<HTMLInputElement>('password field') .selector('input[type=password']) .filters({ value: (element) => element.value, placeholder: (element) => element.placeholder, }) Copy
const PasswordField = FormField.extend<HTMLInputElement>('password field') .selector('input[type=password']) .filters({ value: (element) => element.value, placeholder: (element) => element.placeholder, })
title
id
visible
true
focused
valid
disabled
false
click()
focus()
blur()
Use this InteractorConstructor as a base for creating interactors which work with form fields. This allows you to use field labels as locators, and also provides some basic filters which are convenient for most form fields.
Locates the form field by its label.
Example
Filters
title
: string – Filter by titleid
: string – Filter by idvisible
: boolean – Filter by visibility. Defaults totrue
. See isVisible.focused
: boolean – Filter by whether the form field is focused. See focused.valid
: boolean – Filter by whether the form field is valid.disabled
: boolean – Filter by whether the form field is disabled. Defaults tofalse
.Actions
click()
: Interaction – Click on the form fieldfocus()
: Interaction – Move focus to the form fieldblur()
: Interaction – Move focus away from the form field