@wix/design-system
Version:
@wix/design-system
80 lines (59 loc) • 2.24 kB
Markdown
## DropdownBase Testkit
### Import
- unidriver: `import { DropdownBaseUniDriver } from '@wix/design-system/dist/testkit/unidriver';`
- vanilla: `import { DropdownBaseTestkit } from '@wix/design-system/dist/testkit';`
- puppeteer: `import { DropdownBaseTestkit } from '@wix/design-system/dist/testkit/puppeteer';`
- playwright: `import { DropdownBaseTestkit } 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
### getListType
- signature: getListType(dataHook)
- description: Returns the list type prop value
### clickTargetElement
- signature: clickTargetElement(dataHook)
- description: Returns the target element
### hoverTargetElement
- signature: hoverTargetElement(dataHook)
- description: Hover the target element
### isDropdownShown
- signature: isDropdownShown()
- description: Returns `true` if the dropdown is being shown
### selectOption
- signature: selectOption(index)
- description: Select a specific option (requires the DropdownBase to be opened)
### selectOptionByDataHook
- signature: selectOptionByDataHook(dataHook)
- description: Select a specific option by its data hook (requires the DropdownBase to be opened)
### clickOutside
- signature: clickOutside()
- description: Click outside of the component
### optionsCount
- signature: optionsCount()
- description: Options count (requires the DropdownBase to be opened)
### optionContentAt
- signature: optionContentAt(position)
### getSelectedOptionId
- signature: getSelectedOptionId()
- description: Returns the selected option (requires the DropdownBase to be opened)
### getMarkedOption
- signature: getMarkedOption()
- description: Returns the marked option (requires the DropdownBase to be opened)
### mouseEnter
- signature: mouseEnter()
### mouseLeave
- signature: mouseLeave()