/** * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE file or https://utam.dev/salesforce/license */ import { Driver as _Driver, Element as _Element, Locator as _Locator, ContainerCtor as _ContainerCtor, UtamBasePageObject as _UtamBasePageObject, BaseUtamElement as _BaseUtamElement, ActionableUtamElement as _ActionableUtamElement, ClickableUtamElement as _ClickableUtamElement, EditableUtamElement as _EditableUtamElement, UtamBaseRootPageObject as _UtamBaseRootPageObject, DraggableUtamElement as _DraggableUtamElement } from '@utam/core'; import _PrimitiveDatatableTooltip from 'salesforce-pageobjects/lightning/pageObjects/primitiveDatatableTooltip'; import _Input from 'salesforce-pageobjects/lightning/pageObjects/input'; import _ButtonMenu from 'salesforce-pageobjects/lightning/pageObjects/buttonMenu'; import _Icon from 'salesforce-pageobjects/lightning/pageObjects/icon'; import _FormattedUrl from 'salesforce-pageobjects/lightning/pageObjects/formattedUrl'; import _FormattedText from 'salesforce-pageobjects/lightning/pageObjects/formattedText'; import _FormattedNumber from 'salesforce-pageobjects/lightning/pageObjects/formattedNumber'; /** * Selector: lightning-datatable * Represents the lightning-datatable Lightning web component. * Get cell value by index with row and column indexes, get cell value by label with in a row. * Get number of rows, number of columns, check if the row with index is selectable, check if table having rows, get count of selected rows * Scroll to last row, check if row is selected, check if table is loading, check if the sortable column present in the table, click sort header button. * Click select all checkbox, get width of the column by retrieving style attribute, get row header text. * Check if header actions present, and row actions present. * Toggle row selection. * Get first and last rendered rows. * Methods requiring a rowIndex will return null if that row isn't currently being rendered due to viewport rendering or virtualization * generated from JSON dist/lightning/datatable.utam.json * @version 2026-03-09T13:56:36.022Z * @author Salesforce */ declare class Datatable extends _UtamBaseRootPageObject { constructor(driver: _Driver, element?: _Element, locator?: _Locator); /** * Checks if row has tooltips present or not * @return boolean */ hasRowTooltip(rowIndex: number): Promise; /** * Get cell value by it's row and column index value * @return string */ getCellValueByIndex(rowIndex: number, columnIndex: number): Promise; /** * Get cell value by it's row index and field label value * @return string */ getCellValueByLabel(rowIndex: number, fieldLabel: string): Promise; /** * Get a row tooltip by it's row index * @return utam-lightning/pageObjects/primitiveDatatableTooltip */ getRowTooltipByIndex(rowIndex: number): Promise; /** * Get number of data rows in table * @return number */ getNumRows(): Promise; /** * Checks if datatable has rows present or not * @return boolean */ hasRows(): Promise; /** * Checks if the table header is present or not * @return boolean */ hasHeader(): Promise; /** * Get number of selected datatable rows * @return number */ getNumSelectedRows(): Promise; /** * Scroll to the last row in datatable */ scrollToLastRow(): Promise; /** * Checks if a row is selected if the table row element contains 'slds-is-selected' class * @return boolean */ isRowSelected(rowIndex: number): Promise; /** * Checks if a row is focused * @return boolean */ rowHasFocus(rowIndex: number): Promise; /** * Checks the presence of table loader * @return boolean */ isLoading(): Promise; /** * Get number of columns */ getNumColumns(): Promise; /** * Checks if the column is sortable or not based on the presence of class 'slds-is-sortable' in table head cell * @return boolean */ isSortableColumn(columnLabel: string): Promise; /** * Clicks on datatable select all checkbox */ clickSelectAllCheckbox(): Promise; /** * Clicks on header of a sortable table header link */ clickSortHeaderButton(columnLabel: string): Promise; /** * Get column width style by matching it's label * @return string */ getWidth(columnLabel: string): Promise; /** * Get column width style by index value * @return string */ getColumnWidthByIndex(columnIndex: number): Promise; /** * Get table width style * @return string */ getTableWidth(): Promise; /** * Checks if table header has primitive actions * @return boolean */ hasHeaderActions(columnLabel: string): Promise; /** * Checks if row is selectable based on the presence of input checkbox * @return boolean */ isSelectableRow(rowIndex: number): Promise; /** * Checks if row is selectable based on the presence of input checkbox * @return boolean */ isInlinedSelectableRow(rowIndex: number): Promise; /** * Clicks row selection checkbox to toggle current row selection */ toggleRowSelection(rowIndex: number): Promise; /** * Clicks row selection checkbox to toggle current row selection */ toggleInlinedRowSelection(rowIndex: number): Promise; /** * opens the actionsmenu to then open the multi-column-sorting modal */ clickActionsMenu(): Promise; /** * Get header text of a row if it is present * @return string|null */ getRowHeaderText(rowIndex: number): Promise; /** * Get cell text * @return string|null */ getCellText(rowIndex: number, columnLabel: string): Promise; /** * Get cell text by index * @return string|null */ getCellTextByIndex(rowIndex: number, columnIndex: number): Promise; /** * If row has any row level actions present * @return boolean */ hasRowActionInRow(rowIndex: number): Promise; /** * If the status bar is present * @return boolean */ hasStatusBar(): Promise; /** * Click 'Apply' action of multi inline edit popup */ applyMassInlineEdit(): Promise; /** * Click 'Cancel' action of multi inline edit popup */ cancelMassInlineEdit(): Promise; /** * Checks if table element is focused at the moment * @return boolean */ isTableFocused(): Promise; /** * Checks if the header of the matching column label is focused at the moment. If it contains class 'slds-has-focus' or not * @return boolean */ isHeaderCellFocused(columnLabel: string): Promise; /** * Checks if the cell with matching row and column index is in focus at the moment. If it contains the class 'slds-has-focus' or not * @return boolean */ isCellByIndexFocused(rowIndex: number, columnIndex: number): Promise; /** * Checks if the cell with matching row index and column label is in focus at the moment. If it contains the class 'slds-has-focus' or not * @return boolean */ isCellByLabelFocused(rowIndex: number, columnLabel: string): Promise; /** * Checks if the cell is wrapped or not. If the parent element contains class name 'slds-hyphenate' * @return boolean */ isCellWrapped(rowIndex: number, columnIndex: number): Promise; /** * Checks if the cell is clipped or not. If the parent element contains class name 'slds-truncate' * @return boolean */ isCellClipped(rowIndex: number, columnIndex: number): Promise; /** * Checks if the header cell is wrapped or not. If the parent element contains class name 'slds-hyphenate' * @return boolean */ isHeaderCellWrapped(columnIndex: number): Promise; /** * Checks if the cell is header clipped or not. If the parent element contains class name 'slds-truncate' * @return boolean */ isHeaderCellClipped(columnIndex: number): Promise; /** * Checks if the cell edit popup is open or not * @return boolean */ isEditPopOpened(): Promise; /** * Checks if the column is resizable If column header wrapper element contains class name 'slds-is-resizable' * @return boolean */ isColumnResizable(columnLabel: string): Promise; /** * Get table container scroll top position * @return string */ getTableScrollPosition(): Promise; /** * Get table container scroll left position * @return string */ getTableScrollLeftPosition(): Promise; /** * Checks if cell is inlined * @return boolean */ isInlinedCellByLabel(rowIndex: number, columnLabel: string): Promise; /** * Checks if cell is inlined * @return boolean */ isInlinedCellByIndex(rowIndex: number, columnIndex: number): Promise; /** * Get cell text * @return string|null */ getInlinedCellText(rowIndex: number, columnLabel: string): Promise; /** * Get cell text by index * @return string|null */ getInlinedCellTextByIndex(rowIndex: number, columnIndex: number): Promise; /** * Checks if the cell is wrapped or not. If the parent element contains class name 'slds-hyphenate' * @return boolean */ isInlinedCellWrapped(rowIndex: number, columnIndex: number): Promise; /** * Checks if the cell is clipped or not. If the parent element contains class name 'slds-truncate' * @return boolean */ isInlinedCellClipped(rowIndex: number, columnIndex: number): Promise; getInlineEditInput(): Promise<_Input>; getCustomInlineEditInputContent(ContainerCtor: _ContainerCtor): Promise; getMassInlineEditCheckbox(): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getNavMode(): Promise<(_BaseUtamElement)>; getActionMode(): Promise<(_BaseUtamElement)>; getColumns(): Promise<(_BaseUtamElement)[]>; getActionsMenuColumn(): Promise<(_BaseUtamElement) | null>; getActionsMenu(): Promise<_ButtonMenu | null>; getColumnByIndex(columnIndex: number): Promise<(_BaseUtamElement) | null>; getHeaderColumnByIndex(columnIndex: number): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getHeaderLabel(columnIndex: number): Promise<(_BaseUtamElement) | null>; getColumnByLabel(columnLabel: string): Promise<(_BaseUtamElement) | null>; getHeaderActions(columnLabel: string): Promise<_ButtonMenu | null>; getResizeInput(columnLabel: string): Promise<(_BaseUtamElement & _ClickableUtamElement) | null>; getResizeHandle(columnLabel: string): Promise<(_BaseUtamElement & _ClickableUtamElement & _DraggableUtamElement) | null>; getHeaderColumn(columnLabel: string): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getHeaderActionLink(columnLabel: string): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getHeaderSortingIcon(columnLabel: string): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getAscendingHeaderSort(columnLabel: string): Promise<(_BaseUtamElement) | null>; getDescendingHeaderSort(columnLabel: string): Promise<(_BaseUtamElement) | null>; getLastRenderedRow(): Promise<(_BaseUtamElement & _ActionableUtamElement) | null>; getRows(): Promise<(_BaseUtamElement & _ActionableUtamElement)[] | null>; getRow(rowIndex: number): Promise<(_BaseUtamElement & _ActionableUtamElement) | null>; getRowTooltip(rowIndex: number): Promise<_PrimitiveDatatableTooltip | null>; getCheckbox(rowIndex: number): Promise<(_BaseUtamElement & _ClickableUtamElement & _EditableUtamElement) | null>; getInlinedCheckbox(rowIndex: number): Promise<(_BaseUtamElement & _ClickableUtamElement & _EditableUtamElement) | null>; getCellByIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getCellFactoryByColumnIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getCellTooltip(rowIndex: number, columnIndex: number): Promise<_PrimitiveDatatableTooltip | null>; getCellAlignmentByIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getCellToggleByIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getCellWrapperByIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getCellIconsByIndex(rowIndex: number, columnIndex: number): Promise<_Icon[] | null>; getFormattedUrlByColumnIndex(rowIndex: number, columnIndex: number): Promise<_FormattedUrl | null>; getFormattedTextByColumnIndex(rowIndex: number, columnIndex: number): Promise<_FormattedText | null>; getFormattedNumberByColumnIndex(rowIndex: number, columnIndex: number): Promise<_FormattedNumber | null>; getCustomCellBySelector(rowIndex: number, columnIndex: number, selector: string): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getCustomCellBySelectorTypeless(rowIndex: number, columnIndex: number, selector: string, ContainerCtor: _ContainerCtor): Promise; getCustomCellContentByIndex(rowIndex: number, columnIndex: number, ContainerCtor: _ContainerCtor): Promise; getCellEditButton(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getInlinedCellAlignmentByIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getInlinedCellWrapperByIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getInlinedCellIconsByIndex(rowIndex: number, columnIndex: number): Promise<_Icon[] | null>; getInlinedFormattedUrlByColumnIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getInlinedFormattedTextByColumnIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getInlinedFormattedNumberByColumnIndex(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement) | null>; getInlinedCustomCellBySelector(rowIndex: number, columnIndex: number, selector: string): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getInlinedCustomCellBySelectorTypeless(rowIndex: number, columnIndex: number, selector: string, ContainerCtor: _ContainerCtor): Promise; getInlinedCustomCellContentByIndex(rowIndex: number, columnIndex: number, ContainerCtor: _ContainerCtor): Promise; getInlinedCellEditButton(rowIndex: number, columnIndex: number): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getCellByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getCellAlignmentByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getCellWrapperByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getCellIconsByLabel(rowIndex: number, columnLabel: string): Promise<_Icon[] | null>; getFormattedUrlByLabel(rowIndex: number, columnLabel: string): Promise<_FormattedUrl | null>; getFormattedTextByLabel(rowIndex: number, columnLabel: string): Promise<_FormattedText | null>; getFormattedNumberByLabel(rowIndex: number, columnLabel: string): Promise<_FormattedNumber | null>; getCustomCellContentByLabel(rowIndex: number, columnLabel: string, ContainerCtor: _ContainerCtor): Promise; getInlinedCellAlignmentByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getInlinedCellWrapperByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getInlinedCellIconsByLabel(rowIndex: number, columnLabel: string): Promise<_Icon[] | null>; getInlinedFormattedUrlByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getInlinedFormattedTextByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getInlinedFormattedNumberByLabel(rowIndex: number, columnLabel: string): Promise<(_BaseUtamElement) | null>; getInlinedCustomCellContentByLabel(rowIndex: number, columnLabel: string, ContainerCtor: _ContainerCtor): Promise; getRowAction(rowIndex: number): Promise<_ButtonMenu | null>; getCancelButton(): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getSaveButton(): Promise<(_BaseUtamElement & _ActionableUtamElement & _ClickableUtamElement) | null>; getTooltip(): Promise<_PrimitiveDatatableTooltip | null>; } export = Datatable;