Class: DataGridProDriver
@atomic-testing/component-driver-mui-v6.DataGridProDriver
Driver for Material UI v6 DataGridPro component.
See
https://mui.com/x/react-data-grid/
Hierarchy
-
ComponentDriver
<typeofparts
>↳
DataGridProDriver
Constructors
constructor
• new DataGridProDriver(locator
, interactor
, option?
): DataGridProDriver
Parameters
Name | Type |
---|---|
locator | PartLocator |
interactor | Interactor |
option? | Partial <IComponentDriverOption <>> |
Returns
Overrides
ComponentDriver<typeof parts>.constructor
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:36
Properties
commutableOption
• Readonly
commutableOption: IComponentDriverOption
<{ headerRow
: { driver
: typeof DataGridHeaderRowDriver
= DataGridHeaderRowDriver; locator
: PartLocator
} ; loading
: { driver
: typeof HTMLElementDriver
= HTMLElementDriver; locator
: CssLocator
} }>
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
Defined in
core/build/src/drivers/ComponentDriver.d.ts:19
interactor
• Readonly
interactor: Interactor
Inherited from
ComponentDriver.interactor
Defined in
core/build/src/drivers/ComponentDriver.d.ts:10
Accessors
driverName
• get
driverName(): string
Returns
string
Overrides
ComponentDriver.driverName
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:155
locator
• get
locator(): PartLocator
Return the locator of the component
Returns
PartLocator
Inherited from
ComponentDriver.locator
Defined in
core/build/src/drivers/ComponentDriver.d.ts:50
parts
• get
parts(): ScenePartDriver
<T
>
Return driver instance of all the named parts
Returns
ScenePartDriver
<T
>
Inherited from
ComponentDriver.parts
Defined in
core/build/src/drivers/ComponentDriver.d.ts:46
Methods
click
▸ click(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <ClickOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.click
Defined in
core/build/src/drivers/ComponentDriver.d.ts:74
enforcePartExistence
▸ enforcePartExistence(partName
): Promise
<void
>
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
Name | Type | Description |
---|---|---|
partName | "headerRow" | "loading" | readonly ("headerRow" | "loading" )[] | Single or array of the names of the parts to be enforced |
Returns
Promise
<void
>
Inherited from
ComponentDriver.enforcePartExistence
Defined in
core/build/src/drivers/ComponentDriver.d.ts:56
exists
▸ exists(): Promise
<boolean
>
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
Defined in
core/build/src/drivers/ComponentDriver.d.ts:73
focus
▸ focus(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <FocusOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.focus
Defined in
core/build/src/drivers/ComponentDriver.d.ts:83
getAttribute
▸ getAttribute(attributeName
): Promise
<Optional
<string
>>
Parameters
Name | Type |
---|---|
attributeName | string |
Returns
Promise
<Optional
<string
>>
Inherited from
ComponentDriver.getAttribute
Defined in
core/build/src/drivers/ComponentDriver.d.ts:68
getCell
▸ getCell<DriverT
>(query
, driverClass?
): Promise
<null
| DriverT
>
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
Name | Type |
---|---|
DriverT | extends ComponentDriver <> |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
query | DataGridCellQuery | undefined | 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
>
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:120
getCellText
▸ getCellText(query
): Promise
<string
>
Get the text content of the cell, if the cell does not exist, throw an error
Parameters
Name | Type | Description |
---|---|---|
query | DataGridCellQuery | The query to locate the cell |
Returns
Promise
<string
>
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:144
getColumnCount
▸ getColumnCount(): Promise
<number
>
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
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:55
getHeaderText
▸ getHeaderText(): Promise
<string
[]>
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
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:64
getMissingPartNames
▸ getMissingPartNames(partName
): Promise
<readonly ("headerRow"
| "loading"
)[]>
Get the names of parts not in the DOM
Parameters
Name | Type | Description |
---|---|---|
partName | "headerRow" | "loading" | readonly ("headerRow" | "loading" )[] | Single or array of the names of the parts to be examined |
Returns
Promise
<readonly ("headerRow"
| "loading"
)[]>
Inherited from
ComponentDriver.getMissingPartNames
Defined in
core/build/src/drivers/ComponentDriver.d.ts:62
getRow
▸ getRow(rowIndex
): Promise
<null
| DataGridHeaderRowDriver
>
Return the row driver for the row at the specified index, if the row does not exist, return null
Parameters
Name | Type |
---|---|
rowIndex | number |
Returns
Promise
<null
| DataGridHeaderRowDriver
>
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:89
getRowCount
▸ getRowCount(): Promise
<number
>
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
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:74
getRowText
▸ getRowText(rowIndex
): Promise
<string
[]>
The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering
Parameters
Name | Type | Description |
---|---|---|
rowIndex | number | The index of the row |
Returns
Promise
<string
[]>
The array of text of the specified row
Defined in
component-driver-mui-v6/src/components/datagrid/DataGridProDriver.ts:104
getText
▸ getText(): Promise
<Optional
<string
>>
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
Defined in
core/build/src/drivers/ComponentDriver.d.ts:67
hover
▸ hover(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <HoverOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.hover
Defined in
core/build/src/drivers/ComponentDriver.d.ts:75
isVisible
▸ isVisible(): Promise
<boolean
>
Whether the component is visible. Visibility is defined
that the component does not have the CSS property display: none
,
visibility: hidden
, or opacity: 0
. However this does not
check wether the component is within the viewport.
Returns
Promise
<boolean
>
true if the component is visible, false otherwise
Inherited from
ComponentDriver.isVisible
Defined in
core/build/src/drivers/ComponentDriver.d.ts:92
mouseDown
▸ mouseDown(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <MouseDownOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.mouseDown
Defined in
core/build/src/drivers/ComponentDriver.d.ts:77
mouseEnter
▸ mouseEnter(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <MouseEnterOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.mouseEnter
Defined in
core/build/src/drivers/ComponentDriver.d.ts:81
mouseLeave
▸ mouseLeave(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <MouseLeaveOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.mouseLeave
Defined in
core/build/src/drivers/ComponentDriver.d.ts:82
mouseMove
▸ mouseMove(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <MouseMoveOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.mouseMove
Defined in
core/build/src/drivers/ComponentDriver.d.ts:76
mouseOut
▸ mouseOut(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <MouseOutOption > |
Returns
Promise
<void
>
Inherited from
ComponentDriver.mouseOut
Defined in
core/build/src/drivers/ComponentDriver.d.ts:80