Variable FormFieldConst

FormField: any = FormFieldInteractor

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,
})
  • title: string – Filter by title
  • id: string – Filter by id
  • visible: boolean – Filter by visibility. Defaults to true. 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 to false.
  • click(): Interaction – Click on the form field
  • focus(): Interaction – Move focus to the form field
  • blur(): Interaction – Move focus away from the form field