@wix/design-system
Version:
@wix/design-system
166 lines (131 loc) • 4.99 kB
Markdown
## SelectorList Testkit
### Import
- unidriver: `import { SelectorListUniDriver } from '@wix/design-system/dist/testkit/unidriver';`
- vanilla: `import { SelectorListTestkit } from '@wix/design-system/dist/testkit';`
- puppeteer: `import { SelectorListTestkit } from '@wix/design-system/dist/testkit/puppeteer';`
- playwright: `import { SelectorListTestkit } 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
### mainLoaderExists
- signature: mainLoaderExists()
- returns: Promise<boolean>
- description: Checks whether the main loader exists.
### nextPageLoaderExists
- signature: nextPageLoaderExists()
- returns: Promise<boolean>
- description: Checks whether the next page loader exists.
### searchInputExists
- signature: searchInputExists()
- returns: Promise<boolean>
- description: Checks whether the search input exists.
### focusSearchInput
- signature: focusSearchInput()
- returns: Promise<void>
- description: Focuses search input
### enterSearchValue
- signature: enterSearchValue(value)
- returns: Promise<void>
- description: Changes search input value
### getSearchValue
- signature: getSearchValue()
- returns: Promise<string>
- description: Returns search input value
### clickSearchInputClear
- signature: clickSearchInputClear()
- returns: Promise<void>
- description: Clicks on search input's clear button to clear value
### toggleAllCheckboxExists
- signature: toggleAllCheckboxExists()
- returns: Promise<boolean>
- description: Checks whether the toggle-all checkbox exists.
### isToggleAllCheckboxChecked
- signature: isToggleAllCheckboxChecked()
- returns: Promise<boolean>
- description: Checks whether the toggle-all checkbox is checked.
### getToggleAllCheckboxLabel
- signature: getToggleAllCheckboxLabel()
- returns: Promise<string>
- description: Returns toggle-all checkbox label text
### clickToggleAllCheckbox
- signature: clickToggleAllCheckbox()
- returns: Promise<void>
- description: Clicks on toggle-all checkbox to select/deselect all non-disabled items.
### showsEmptyState
- signature: showsEmptyState()
- returns: Promise<boolean>
- description: Checks whether empty state is shown.
### getEmptyState
- signature: getEmptyState()
- returns: Promise<HTMLElement>
- description: Gets empty state.
### showsNoResultsFoundState
- signature: showsNoResultsFoundState()
- returns: Promise<boolean>
- description: Checks whether no results found state is shown.
### getNoResultsFoundState
- signature: getNoResultsFoundState()
- returns: Promise<HTMLElement>
- description: Gets no results found state.
### listExists
- signature: listExists()
- returns: Promise<boolean>
- description: Checks whether the list exists.
### numberOfItemsInList
- signature: numberOfItemsInList()
- returns: Promise<number>
- description: Returns the number of items in the list.
### toggleSelectorAt
- signature: toggleSelectorAt(i)
- returns: Promise<void>
- description: Toggles selector of the item at the passed index.
### isSelectorCheckedAt
- signature: isSelectorCheckedAt(i)
- returns: Promise<boolean>
- description: Checks whether the selector of the item at the passed index is checked.
### isSelectorIsIndeterminateAt
- signature: isSelectorIsIndeterminateAt(i)
- returns: Promise<boolean>
- description: Checks whether the selector of the item at the passed index is in indeterminate mode.
### isSelectorDisabledAt
- signature: isSelectorDisabledAt(i)
- returns: Promise<boolean>
- description: Checks whether the selector of the item at the passed index is disabled.
### getSelectorTitleAt
- signature: getSelectorTitleAt(i)
- returns: Promise<string>
- description: Gets the selector title text of the item at the passed index.
### getSelectorSubtitleAt
- signature: getSelectorSubtitleAt(i)
- returns: Promise<string>
- description: Gets the selector subtitle text of the item at the passed index.
### getSelectorExtraNodeAt
- signature: getSelectorExtraNodeAt(i)
- returns: Promise<HTMLElement>
- description: Gets the selector extra node element of the item at the passed index.
### getSelectorImageAt
- signature: getSelectorImageAt(i)
- returns: Promise<HTMLElement>
- description: Gets the selector image element of the item at the passed index.
### scrollDown
- signature: scrollDown()
- returns: Promise<boolean>
- description: Triggers "scroll" event on the list.
### getSelectorTooltipTextAt
- signature: getSelectorTooltipTextAt(i)
- returns: Promise<string | >
- description: Gets the selector tooltip text of the item at the passed index.