FormFieldvariable
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
const PasswordField = FormField.extend<HTMLInputElement>('password field')
.selector('input[type=password'])
.filters({
value: (element) => element.value,
placeholder: (element) => element.placeholder,
})
Filters
title: string – Filter by titleid: string – Filter by idvisible: boolean – Filter by visibility. Defaults totrue. SeeisVisible.focused: boolean – Filter by whether the form field is focused. Seefocused.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