@wix/design-system
Version:
@wix/design-system
262 lines (187 loc) • 6.17 kB
Markdown
## Table Testkit
### Import
- unidriver: `import { TableUniDriver } from '@wix/design-system/dist/testkit/unidriver';`
- vanilla: `import { TableTestkit } from '@wix/design-system/dist/testkit';`
- puppeteer: `import { TableTestkit } from '@wix/design-system/dist/testkit/puppeteer';`
- playwright: `import { TableTestkit } 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
### 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
### getRow
- signature: getRow(rowIndex)
### getRowsCount
- signature: getRowsCount()
### getRowsWithClassCount
- signature: getRowsWithClassCount(className)
- deprecated: true
### getRowsWithDataHook
- signature: getRowsWithDataHook(dataHookName)
- deprecated: true
### getRowWithDataHook
- signature: getRowWithDataHook(dataHookName)
- deprecated: true
### getRowText
- signature: getRowText(index)
- description: Returns an array representing the text content of the cells in a given row `index`.
### getRowClasses
- signature: getRowClasses(index)
- deprecated: true
### getHeaderRowClasses
- signature: getHeaderRowClasses()
### getHeaderClasses
- signature: getHeaderClasses()
### getHeaderCell
- signature: getHeaderCell(index)
- description: Get header cell element: (columnIndex) => Element
- deprecated: true
### getHeaderCellByDataHook
- signature: getHeaderCellByDataHook(dataHook)
### getHeaderCellStyle
- signature: getHeaderCellStyle(index)
### getHeaderCellWidth
- signature: getHeaderCellWidth(index)
### getCell
- signature: getCell(rowIndex, cellIndex)
- description: Get cell element: (rowIndex, columnIndex) => Element
- deprecated: true
### getCellStyle
- signature: getCellStyle(rowIndex, colIndex)
### getCellWidth
- signature: getCellWidth(rowIndex, colIndex)
### isRowClickable
- signature: isRowClickable(index)
### isRowAnimated
- signature: isRowAnimated(index)
### isRowHighlighted
- signature: isRowHighlighted(index)
### getTitles
- signature: getTitles()
### isDisplayingNothing
- signature: isDisplayingNothing()
### isDisplayingHeaderOnly
- signature: isDisplayingHeaderOnly()
### isDisplayingHeader
- signature: isDisplayingHeader()
### isHeaderVisible
- signature: isHeaderVisible()
### hasChildWithId
- signature: hasChildWithId(id)
### clickRow
- signature: clickRow(index, eventData)
### clickColumn
- signature: clickColumn(rowIndex, colIndex, eventData)
### mouseEnterRow
- signature: mouseEnterRow(index, eventData)
### mouseLeaveRow
- signature: mouseLeaveRow(index, eventData)
### hasRowDetails
- signature: hasRowDetails(index)
### getRowDetailsText
- signature: getRowDetailsText(index)
### hasSortableTitle
- signature: hasSortableTitle(index)
### hasInfoIcon
- signature: hasInfoIcon(index)
### hasTitleSuffix
- signature: hasTitleSuffix(index)
### clickTitleSuffix
- signature: clickTitleSuffix(index)
### pressKeyOnTitleSuffix
- signature: pressKeyOnTitleSuffix(index, key)
### hasSortDescending
- signature: hasSortDescending(index)
### clickSort
- signature: clickSort(index, eventData)
### getRowDetails
- signature: getRowDetails(index)
- description: @deprecated Should be private
### exists
- signature: exists()
### isCellMasked
- signature: isCellMasked(rowIndex, colIndex)
### getStickyColumnsCount
- signature: getStickyColumnsCount()
### getRowTabIndex
- signature: getRowTabIndex(rowIndex)
### pressKeyOnRow
- signature: pressKeyOnRow(rowIndex, key)
### getHeaderCell
- signature: getHeaderCell(index)
### getCell
- signature: getCell(rowIndex, cellIndex)
### getRowCheckboxDriver
- signature: getRowCheckboxDriver(index)
- description: Get driver of row selection checkbox by row index
### getBulkSelectionCheckboxDriver
- signature: getBulkSelectionCheckboxDriver()
- description: Get driver of row bulk-selection checkbox
### isBulkSelectionDisabled
- signature: isBulkSelectionDisabled()
- description: Whether bulk selection checkbox is disabled
### isRowSelectionDisabled
- signature: isRowSelectionDisabled(index)
- description: Whether specific row selection checkbox is disabled
### clickRowCheckbox
- signature: clickRowCheckbox(index)
- description: Click the row selection checkbox
### clickBulkSelectionCheckbox
- signature: clickBulkSelectionCheckbox()
- description: Click the bulk-selection checkbox
### isRowSelected
- signature: isRowSelected(index)
- description: Is row selected by index
### getBulkSelectionState
- signature: getBulkSelectionState()
### getTitlebar
- signature: getTitlebar()
- description: Get title-bar (column titles)
### getCellTextValue
- signature: getCellTextValue(row, column)
### isSelectionTooltipEnabled
- signature: isSelectionTooltipEnabled(index)
### getSelectionTooltipContent
- signature: getSelectionTooltipContent(index)
### getRowNumberCell
- signature: getRowNumberCell(index)
- description: Get the row number cell wrapper element by row index
### getRowNumberText
- signature: getRowNumberText(index)
- description: Get the row number text value by row index
### hasRowNumberText
- signature: hasRowNumberText(index)
- description: Whether row number text is visible for a row
### hasRowNumberCell
- signature: hasRowNumberCell(index)
- description: Whether row number cell exists for a row
### getFloatingScrollBarDriver
- signature: getFloatingScrollBarDriver(viewportElement)