Class: DataGridProDriver
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:37
Driver for Material UI v5 DataGridPro component. V5 DataGridPro component does not support data-testid, to use data-testid to locate the component, you need to put the data-testid on the parent element of the grid
See
https://v5.mui.com/x/react-data-grid/
Extends
ComponentDriver
<typeofparts
>
Constructors
Constructor
new DataGridProDriver(
locator
,interactor
,option
?):DataGridProDriver
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:38
Parameters
locator
PartLocator
interactor
Interactor
option?
Partial
<IComponentDriverOption
<{ }>>
Returns
DataGridProDriver
Overrides
ComponentDriver<typeof parts>.constructor
Properties
commutableOption
readonly
commutableOption:IComponentDriverOption
<{headerRow
: {driver
: typeofDataGridHeaderRowDriver
;locator
:PartLocator
; };loading
: {driver
: typeofHTMLElementDriver
;locator
:CssLocator
; }; }>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:20
Option passed to the constructor includes both universal options which can be shared across all component driver tree, and component specific options which are only applicable to the component.
Commutable option is the option that can be shared across all component driver tree.
Inherited from
ComponentDriver.commutableOption
interactor
readonly
interactor:Interactor
Defined in: core/build/src/drivers/ComponentDriver.d.ts:11
Inherited from
ComponentDriver.interactor
Accessors
driverName
Get Signature
get driverName():
string
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:164
Returns
string
Overrides
ComponentDriver.driverName
locator
Get Signature
get locator():
PartLocator
Defined in: core/build/src/drivers/ComponentDriver.d.ts:51
Return the locator of the component
Returns
PartLocator
Inherited from
ComponentDriver.locator
parts
Get Signature
get parts():
ScenePartDriver
<T
>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:47
Return driver instance of all the named parts
Returns
ScenePartDriver
<T
>
Inherited from
ComponentDriver.parts
Methods
click()
click(
option
?):Promise
<void
>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:75
Parameters
option?
Partial
<ClickOption
>
Returns
Promise
<void
>
Inherited from
ComponentDriver.click
enforcePartExistence()
protected
enforcePartExistence(partName
):Promise
<void
>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:57
Check the specified parts' existences, and throw MissPartError if any of the part is found not existence. Existence is defined by the part's existence in the DOM regardless of its visibility on the screen
Parameters
partName
Single or array of the names of the parts to be enforced
"headerRow"
| "loading"
| readonly ("headerRow"
| "loading"
)[]
Returns
Promise
<void
>
Inherited from
ComponentDriver.enforcePartExistence
exists()
exists():
Promise
<boolean
>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:74
Whether the component exists/attached to the DOM
Returns
Promise
<boolean
>
true if the component is attached to the DOM, false otherwise
Inherited from
ComponentDriver.exists
focus()
focus(
option
?):Promise
<void
>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:84
Parameters
option?
Partial
<FocusOption
>
Returns
Promise
<void
>
Inherited from
ComponentDriver.focus
getAttribute()
getAttribute(
attributeName
):Promise
<Optional
<string
>>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:69
Parameters
attributeName
string
Returns
Promise
<Optional
<string
>>
Inherited from
ComponentDriver.getAttribute
getCell()
getCell<
DriverT
>(query
,driverClass
):Promise
<null
|DriverT
>
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:129
Get the cell driver for the cell, if the cell does not exist, return null The cell driver is default to HTMLElementDriver, you can specify a different driver class
Type Parameters
DriverT
DriverT
extends ComponentDriver
<{ }>
Parameters
query
The query to locate the cell
driverClass
typeof ComponentDriver
= HTMLElementDriver
Optional, the driver class to use for the cell, default to HTMLElementDriver
Returns
Promise
<null
| DriverT
>
getCellText()
getCellText(
query
):Promise
<string
>
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:153
Get the text content of the cell, if the cell does not exist, throw an error
Parameters
query
The query to locate the cell
Returns
Promise
<string
>
getColumnCount()
getColumnCount():
Promise
<number
>
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:68
The number of columns currently displayed in the data grid, note that data grid pro uses virtualize rendering, therefore the column count heavily depends on the viewport size
Returns
Promise
<number
>
The number of columns currently displayed in the data grid
getHeaderText()
getHeaderText():
Promise
<string
[]>
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:76
The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering
Returns
Promise
<string
[]>
The array of text of the header row
getMissingPartNames()
protected
getMissingPartNames(partName
):Promise
<readonly ("headerRow"
|"loading"
)[]>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:63
Get the names of parts not in the DOM
Parameters
partName
Single or array of the names of the parts to be examined
"headerRow"
| "loading"
| readonly ("headerRow"
| "loading"
)[]
Returns
Promise
<readonly ("headerRow"
| "loading"
)[]>
Inherited from
ComponentDriver.getMissingPartNames
getRow()
getRow(
rowIndex
):Promise
<null
|DataGridHeaderRowDriver
>
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:99
Return the row driver for the row at the specified index, if the row does not exist, return null
Parameters
rowIndex
number
Returns
Promise
<null
| DataGridHeaderRowDriver
>
getRowCount()
getRowCount():
Promise
<number
>
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:85
The number of rows currently displayed in the data grid, note that data grid pro uses virtualize rendering, therefore the row count heavily depends on the viewport size
Returns
Promise
<number
>
The number of columns currently displayed in the data grid
getRowText()
getRowText(
rowIndex
):Promise
<string
[]>
Defined in: component-driver-mui-x-v5/src/components/datagrid/DataGridProDriver.ts:114
The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering
Parameters
rowIndex
number
The index of the row
Returns
Promise
<string
[]>
The array of text of the specified row
getText()
getText():
Promise
<Optional
<string
>>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:68
Get the combined text content of the component
Returns
Promise
<Optional
<string
>>
If the component exists and has content, it should return the text or otherwise undefined
Inherited from
ComponentDriver.getText
hover()
hover(
option
?):Promise
<void
>
Defined in: core/build/src/drivers/ComponentDriver.d.ts:76
Parameters
option?
Partial
<HoverOption
>
Returns
Promise
<void
>