@wix/design-system
Version:
@wix/design-system
82 lines (61 loc) • 2 kB
Markdown
## FormField Testkit
### Import
- unidriver: `import { FormFieldUniDriver } from '@wix/design-system/dist/testkit/unidriver';`
- vanilla: `import { FormFieldTestkit } from '@wix/design-system/dist/testkit';`
- puppeteer: `import { FormFieldTestkit } from '@wix/design-system/dist/testkit/puppeteer';`
- playwright: `import { FormFieldTestkit } from '@wix/design-system/dist/testkit/playwright';`
### API
### exists
- signature: exists()
- returns: Promise<boolean>
- description: Checks whether the component found with the given data hook
### element
- signature: element()
- returns: Promise<any>
- description: Gets the component root element
### click
- signature: click()
- returns: Promise<void>
- description: Clicks on the component root element
### base
- signature: base()
- returns: UniDriver
- description: Returns UniDriver for the base element
### element
- signature: element()
### getChildren
- signature: getChildren()
- description: get children
### getLabel
- signature: getLabel()
- description: get label
### getLabelSize
- signature: getLabelSize()
- description: returns label size
### isRequired
- signature: isRequired()
- description: returns true whether form field is required
### getLengthLeft
- signature: getLengthLeft()
- description: returns the length left
### isLengthExceeded
- signature: isLengthExceeded()
- description: returns whether the form field length is exceeded
### hasTooltip
- signature: hasTooltip()
- description: returns true whether form field has tooltip
### getInfoContent
- signature: getInfoContent()
- description: returns tooltip text of the info content
### getSuffix
- signature: getSuffix()
- description: get form field suffix
### hoverInfoIcon
- signature: hoverInfoIcon()
- description: hovers over the formfield infoicon
### getStatusMessage
- signature: getStatusMessage()
- description: returns status message text
### hasStatus
- signature: hasStatus(status)
- description: return true if it has a given status