@atomic-testing/component-driver-mui-x-v8 0.81.0 → 0.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -10
- package/dist/index.d.mts +8 -10
- package/dist/index.mjs +1 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/datagrid/DataGridRowDriverBase.ts +8 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
let _atomic_testing_core = require("@atomic-testing/core");
|
|
2
3
|
let _atomic_testing_component_driver_html = require("@atomic-testing/component-driver-html");
|
|
3
|
-
|
|
4
4
|
//#region src/components/datagrid/DataGridRowDriverBase.ts
|
|
5
5
|
const columnStartingIndex = 1;
|
|
6
6
|
/**
|
|
@@ -41,7 +41,6 @@ var DataGridRowDriverBase = class extends _atomic_testing_core.ComponentDriver {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
|
|
45
44
|
//#endregion
|
|
46
45
|
//#region src/components/datagrid/DataGridDataRowDriver.ts
|
|
47
46
|
var DataGridDataRowDriver = class extends DataGridRowDriverBase {
|
|
@@ -59,7 +58,6 @@ var DataGridDataRowDriver = class extends DataGridRowDriverBase {
|
|
|
59
58
|
return "MuiV8DataGridDataRowDriver";
|
|
60
59
|
}
|
|
61
60
|
};
|
|
62
|
-
|
|
63
61
|
//#endregion
|
|
64
62
|
//#region src/components/datagrid/DataGridHeaderRowDriver.ts
|
|
65
63
|
var DataGridHeaderRowDriver = class extends DataGridRowDriverBase {
|
|
@@ -80,7 +78,6 @@ var DataGridHeaderRowDriver = class extends DataGridRowDriverBase {
|
|
|
80
78
|
return "MuiV8DataGridHeaderRowDriver";
|
|
81
79
|
}
|
|
82
80
|
};
|
|
83
|
-
|
|
84
81
|
//#endregion
|
|
85
82
|
//#region src/components/datagrid/DataGridPaginationActionDriver.ts
|
|
86
83
|
const parts$2 = {
|
|
@@ -124,7 +121,6 @@ var DataGridPaginationActionDriver = class extends _atomic_testing_core.Componen
|
|
|
124
121
|
return "MuiV8DataGridPaginationActionDriver";
|
|
125
122
|
}
|
|
126
123
|
};
|
|
127
|
-
|
|
128
124
|
//#endregion
|
|
129
125
|
//#region src/components/datagrid/DataGridFooterDriver.ts
|
|
130
126
|
const parts$1 = {
|
|
@@ -172,7 +168,6 @@ var DataGridFooterDriver = class extends _atomic_testing_core.ComponentDriver {
|
|
|
172
168
|
return "MuiV8DataGridFooterDriver";
|
|
173
169
|
}
|
|
174
170
|
};
|
|
175
|
-
|
|
176
171
|
//#endregion
|
|
177
172
|
//#region src/components/datagrid/DataGridProDriver.ts
|
|
178
173
|
const parts = {
|
|
@@ -341,9 +336,9 @@ var DataGridProDriver = class extends _atomic_testing_core.ComponentDriver {
|
|
|
341
336
|
return "MuiV8DataGridProDriver";
|
|
342
337
|
}
|
|
343
338
|
};
|
|
344
|
-
|
|
345
339
|
//#endregion
|
|
346
340
|
exports.DataGridDataRowDriver = DataGridDataRowDriver;
|
|
347
341
|
exports.DataGridHeaderRowDriver = DataGridHeaderRowDriver;
|
|
348
342
|
exports.DataGridProDriver = DataGridProDriver;
|
|
343
|
+
|
|
349
344
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["ComponentDriver","listHelper","HTMLElementDriver","textList: string[]","cellLocator: PartLocator","locatorUtil","locatorUtil","locatorUtil","parts","HTMLButtonDriver","ComponentDriver","parts","HTMLElementDriver","ComponentDriver","HTMLElementDriver","ComponentDriver","locatorUtil","listHelper"],"sources":["../src/components/datagrid/DataGridRowDriverBase.ts","../src/components/datagrid/DataGridDataRowDriver.ts","../src/components/datagrid/DataGridHeaderRowDriver.ts","../src/components/datagrid/DataGridPaginationActionDriver.ts","../src/components/datagrid/DataGridFooterDriver.ts","../src/components/datagrid/DataGridProDriver.ts"],"sourcesContent":["import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport { byAttribute, ComponentDriver, ComponentDriverCtor, listHelper, locatorUtil, PartLocator } from '@atomic-testing/core';\n\n// In MUI7, there is an extra div preceding the actual data cells. We need to skip it.\nconst columnStartingIndex = 1;\n\n/**\n * Base class for data grid row\n */\nexport abstract class DataGridRowDriverBase extends ComponentDriver {\n protected async getCellCount(): Promise<number> {\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n count++;\n }\n return count;\n }\n\n /**\n * Get the text of each visible cell in the row.\n * Caveat: Because of virtualization, the text of the cell may not be available until the cell is visible.\n * @returns A promise array of text of each visible cell in the row\n */\n async getRowText(): Promise<string[]> {\n const textList: string[] = [];\n for await (const cell of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n const text = await cell.getText();\n textList.push(text!.trim());\n }\n return textList;\n }\n\n /**\n * Get the cell driver at the specified index or data field.\n * Caveat: Because of virtualization, the cell may not be available until the cell is visible.\n * @param cellIndexOrField number: column index, string: column field\n * @param driverClass The driver class of the cell. Default is HTMLElementDriver\n * @returns A promise of the cell driver, or null if the cell is not found\n */\n async getCell<DriverT extends ComponentDriver>(\n cellIndexOrField: number | string, // number: column index, string: column field\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n let cellLocator: PartLocator;\n if (typeof cellIndexOrField === 'number') {\n cellLocator = byAttribute('data-colindex', cellIndexOrField.toString());\n } else {\n cellLocator = byAttribute('data-field', cellIndexOrField);\n }\n const locator = locatorUtil.append(this.locator, cellLocator);\n const cellExists = await this.interactor.exists(locator);\n if (cellExists) {\n return new driverClass(locator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n protected abstract getCellLocator(): PartLocator;\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridDataRowDriver extends DataGridRowDriverBase {\n private readonly _dataCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._dataCellLocator = locatorUtil.append(locator, byRole('cell'));\n }\n\n protected override getCellLocator(): PartLocator {\n return this._dataCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridDataRowDriver';\n }\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridHeaderRowDriver extends DataGridRowDriverBase {\n private readonly _headerCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._headerCellLocator = locatorUtil.append(locator, byRole('columnheader'));\n }\n\n async getColumnCount(): Promise<number> {\n return this.getCellCount();\n }\n\n protected override getCellLocator(): PartLocator {\n return this._headerCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridHeaderRowDriver';\n }\n}\n","import { HTMLButtonDriver } from '@atomic-testing/component-driver-html';\nimport {\n byAttribute,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nconst parts = {\n previousButton: {\n locator: byAttribute('aria-label', 'Go to previous page'),\n driver: HTMLButtonDriver,\n },\n nextButton: {\n locator: byAttribute('aria-label', 'Go to next page'),\n driver: HTMLButtonDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridPaginationActionDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('previousButton');\n const isDisabled = await this.parts.previousButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('previousButton');\n await this.parts.previousButton.click();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('nextButton');\n const isDisabled = await this.parts.nextButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('nextButton');\n await this.parts.nextButton.click();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridPaginationActionDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridPaginationActionDriver } from './DataGridPaginationActionDriver';\n\nconst parts = {\n paginationAction: {\n locator: byCssClass('MuiTablePagination-actions'),\n driver: DataGridPaginationActionDriver,\n },\n paginationDescription: {\n locator: byCssClass('MuiTablePagination-displayedRows'),\n driver: HTMLElementDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridFooterDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isPreviousPageEnabled();\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoPreviousPage();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isNextPageEnabled();\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoNextPage();\n }\n\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('paginationDescription');\n return this.parts.paginationDescription.getText();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridFooterDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n byCssSelector,\n byRole,\n ComponentDriver,\n ComponentDriverCtor,\n IComponentDriverOption,\n Interactor,\n listHelper,\n locatorUtil,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridCellQuery } from './DataGridCellQuery';\nimport { DataGridFooterDriver } from './DataGridFooterDriver';\nimport { DataGridHeaderRowDriver } from './DataGridHeaderRowDriver';\n\nconst parts = {\n headerRow: {\n locator: byCssClass('MuiDataGrid-columnHeaders').chain(byCssSelector('[role=row]:first-of-type')),\n driver: DataGridHeaderRowDriver,\n },\n loading: {\n locator: byRole('progressbar'),\n driver: HTMLElementDriver,\n },\n skeletonOverlay: {\n locator: byCssClass('MuiDataGrid-main--hasSkeletonLoadingOverlay'),\n driver: HTMLElementDriver,\n },\n footer: {\n locator: byCssClass('MuiDataGrid-footerContainer'),\n driver: DataGridFooterDriver,\n },\n} satisfies ScenePart;\n\nconst dataRowLocator = byCssSelector('[role=row][data-rowindex]');\n\n/**\n * Driver for Material UI v8 DataGridPro component.\n * V8 DataGridPro component does not support data-testid, to use data-testid\n * to locate the component, you need to put the data-testid on the parent element of the grid\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridProDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n /**\n * Checks if the data grid is currently loading.\n * @returns A promise that resolves to a boolean indicating if the data grid is loading.\n */\n async isLoading(): Promise<boolean> {\n const result = await Promise.all([this.parts.skeletonOverlay.isVisible(), this.parts.loading.isVisible()]);\n return result.some(v => v);\n }\n\n /**\n * Waits for the data grid to exit the loading state.\n * @param timeoutMs The maximum time to wait for the load to complete, in milliseconds.\n */\n async waitForLoad(timeoutMs: number = 10000): Promise<void> {\n await this.parts.headerRow.waitUntilComponentState();\n await this.waitUntil({ probeFn: () => this.isLoading(), terminateCondition: false, timeoutMs });\n }\n\n /**\n * The number of columns currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the column count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getColumnCount(): Promise<number> {\n return this.parts.headerRow.getColumnCount();\n }\n\n /**\n * The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @returns The array of text of the header row\n */\n async getHeaderText(): Promise<string[]> {\n return this.parts.headerRow.getRowText();\n }\n\n /**\n * The number of rows currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the row count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getRowCount(): Promise<number> {\n const gridRowLocator = locatorUtil.append(this.locator, dataRowLocator);\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(this, gridRowLocator, HTMLElementDriver)) {\n count++;\n }\n return count;\n }\n\n /**\n * Return the row driver for the row at the specified index, if the row does not exist, return null\n * @param rowIndex\n * @returns\n */\n async getRow(rowIndex: number): Promise<DataGridHeaderRowDriver | null> {\n const rowLocator = locatorUtil.append(this.locator, byCssSelector(`[role=row][data-rowindex=\"${rowIndex}\"]`));\n const rowExists = await this.interactor.exists(rowLocator);\n if (rowExists) {\n return new DataGridHeaderRowDriver(rowLocator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n /**\n * The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @param rowIndex The index of the row\n * @returns The array of text of the specified row\n */\n async getRowText(rowIndex: number): Promise<string[]> {\n const row = await this.getRow(rowIndex);\n if (row != null) {\n return row.getRowText();\n }\n throw new Error(`Row ${rowIndex} does not exist`);\n }\n\n /**\n * Get the cell driver for the cell, if the cell does not exist, return null\n * The cell driver is default to HTMLElementDriver, you can specify a different driver class\n * @param query The query to locate the cell\n * @param driverClass Optional, the driver class to use for the cell, default to HTMLElementDriver\n * @returns\n */\n async getCell<DriverT extends ComponentDriver>(\n query: DataGridCellQuery,\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n const rowDriver = await this.getRow(query.rowIndex);\n\n if (rowDriver === null) {\n return null;\n }\n\n if ('columnIndex' in query) {\n return rowDriver.getCell(query.columnIndex, driverClass);\n }\n\n return rowDriver.getCell(query.columnField, driverClass);\n }\n\n /**\n * Get the text content of the cell, if the cell does not exist, throw an error\n * @param query The query to locate the cell\n * @returns\n */\n async getCellText(query: DataGridCellQuery): Promise<string> {\n const cell = await this.getCell(query);\n if (cell != null) {\n const text = await cell.getText();\n return text!;\n }\n\n const columnIdentifier = 'columnIndex' in query ? query.columnIndex : query.columnField;\n throw new Error(`Cell at row:${query.rowIndex} column:${columnIdentifier} does not exist`);\n }\n\n //#region Footer\n /**\n * Determine if the pagination footer is currently visible.\n */\n isFooterVisible(): Promise<boolean> {\n return this.parts.footer.isVisible();\n }\n\n /**\n * Check whether the \"previous page\" control is enabled.\n */\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isPreviousPageEnabled();\n }\n\n /**\n * Navigate to the previous page using the grid footer control.\n */\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoPreviousPage();\n }\n\n /**\n * Check whether the \"next page\" control is enabled.\n */\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isNextPageEnabled();\n }\n\n /**\n * Navigate to the next page using the grid footer control.\n */\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoNextPage();\n }\n\n /**\n * Read the textual description of the current pagination state.\n */\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.getText();\n }\n //#endregion Footer\n\n override get driverName(): string {\n return 'MuiV8DataGridProDriver';\n }\n}\n"],"mappings":";;;;AAIA,MAAM,sBAAsB;;;;AAK5B,IAAsB,wBAAtB,cAAoDA,qCAAgB;CAClE,MAAgB,eAAgC;EAC9C,IAAI,QAAQ;AACZ,aAAW,MAAM,KAAKC,gCAAW,oBAC/B,MACA,KAAK,gBAAgB,EACrBC,yDACA,oBACD,CACC;AAEF,SAAO;;;;;;;CAQT,MAAM,aAAgC;EACpC,MAAMC,WAAqB,EAAE;AAC7B,aAAW,MAAM,QAAQF,gCAAW,oBAClC,MACA,KAAK,gBAAgB,EACrBC,yDACA,oBACD,EAAE;GACD,MAAM,OAAO,MAAM,KAAK,SAAS;AACjC,YAAS,KAAK,KAAM,MAAM,CAAC;;AAE7B,SAAO;;;;;;;;;CAUT,MAAM,QACJ,kBACA,cAA4CA,yDACnB;EACzB,IAAIE;AACJ,MAAI,OAAO,qBAAqB,SAC9B,qDAA0B,iBAAiB,iBAAiB,UAAU,CAAC;MAEvE,qDAA0B,cAAc,iBAAiB;EAE3D,MAAM,UAAUC,iCAAY,OAAO,KAAK,SAAS,YAAY;AAE7D,MADmB,MAAM,KAAK,WAAW,OAAO,QAAQ,CAEtD,QAAO,IAAI,YAAY,SAAS,KAAK,YAAY,KAAK,iBAAiB;AAGzE,SAAO;;;;;;AC7DX,IAAa,wBAAb,cAA2C,sBAAsB;CAE/D,YAAY,SAAsB,YAAwB,QAA0C;AAClG,QAAM,SAAS,YAAY;GACzB,GAAG;GACH,OAAO,EAAE;GACV,CAAC;AAEF,OAAK,mBAAmBC,iCAAY,OAAO,0CAAgB,OAAO,CAAC;;CAGrE,AAAmB,iBAA8B;AAC/C,SAAO,KAAK;;CAGd,IAAa,aAAqB;AAChC,SAA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MAAM,eAAe,MAAM,SAAS,UAAU,iBAAiB,iBAAiB;;;;;CAO5F,kBAAoC;AAClC,SAAO,KAAK,MAAM,OAAO,WAAW;;;;;CAMtC,MAAM,wBAA0C;AAC9C,QAAM,KAAK,qBAAqB,SAAS;AACzC,SAAO,KAAK,MAAM,OAAO,uBAAuB;;;;;CAMlD,MAAM,mBAAkC;AACtC,QAAM,KAAK,qBAAqB,SAAS;AACzC,QAAM,KAAK,MAAM,OAAO,kBAAkB;;;;;CAM5C,MAAM,oBAAsC;AAC1C,QAAM,KAAK,qBAAqB,SAAS;AACzC,SAAO,KAAK,MAAM,OAAO,mBAAmB;;;;;CAM9C,MAAM,eAA8B;AAClC,QAAM,KAAK,qBAAqB,SAAS;AACzC,QAAM,KAAK,MAAM,OAAO,cAAc;;;;;CAMxC,MAAM,2BAAsD;AAC1D,QAAM,KAAK,qBAAqB,SAAS;AACzC,SAAO,KAAK,MAAM,OAAO,SAAS;;CAIpC,IAAa,aAAqB;AAChC,SAAO"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["ComponentDriver","listHelper","HTMLElementDriver","locatorUtil","locatorUtil","locatorUtil","parts","HTMLButtonDriver","ComponentDriver","parts","HTMLElementDriver","ComponentDriver","HTMLElementDriver","ComponentDriver","locatorUtil","listHelper"],"sources":["../src/components/datagrid/DataGridRowDriverBase.ts","../src/components/datagrid/DataGridDataRowDriver.ts","../src/components/datagrid/DataGridHeaderRowDriver.ts","../src/components/datagrid/DataGridPaginationActionDriver.ts","../src/components/datagrid/DataGridFooterDriver.ts","../src/components/datagrid/DataGridProDriver.ts"],"sourcesContent":["import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byAttribute,\n ComponentDriver,\n ComponentDriverCtor,\n listHelper,\n locatorUtil,\n PartLocator,\n} from '@atomic-testing/core';\n\n// In MUI7, there is an extra div preceding the actual data cells. We need to skip it.\nconst columnStartingIndex = 1;\n\n/**\n * Base class for data grid row\n */\nexport abstract class DataGridRowDriverBase extends ComponentDriver {\n protected async getCellCount(): Promise<number> {\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n count++;\n }\n return count;\n }\n\n /**\n * Get the text of each visible cell in the row.\n * Caveat: Because of virtualization, the text of the cell may not be available until the cell is visible.\n * @returns A promise array of text of each visible cell in the row\n */\n async getRowText(): Promise<string[]> {\n const textList: string[] = [];\n for await (const cell of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n const text = await cell.getText();\n textList.push(text!.trim());\n }\n return textList;\n }\n\n /**\n * Get the cell driver at the specified index or data field.\n * Caveat: Because of virtualization, the cell may not be available until the cell is visible.\n * @param cellIndexOrField number: column index, string: column field\n * @param driverClass The driver class of the cell. Default is HTMLElementDriver\n * @returns A promise of the cell driver, or null if the cell is not found\n */\n async getCell<DriverT extends ComponentDriver>(\n cellIndexOrField: number | string, // number: column index, string: column field\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n let cellLocator: PartLocator;\n if (typeof cellIndexOrField === 'number') {\n cellLocator = byAttribute('data-colindex', cellIndexOrField.toString());\n } else {\n cellLocator = byAttribute('data-field', cellIndexOrField);\n }\n const locator = locatorUtil.append(this.locator, cellLocator);\n const cellExists = await this.interactor.exists(locator);\n if (cellExists) {\n return new driverClass(locator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n protected abstract getCellLocator(): PartLocator;\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridDataRowDriver extends DataGridRowDriverBase {\n private readonly _dataCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._dataCellLocator = locatorUtil.append(locator, byRole('cell'));\n }\n\n protected override getCellLocator(): PartLocator {\n return this._dataCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridDataRowDriver';\n }\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridHeaderRowDriver extends DataGridRowDriverBase {\n private readonly _headerCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._headerCellLocator = locatorUtil.append(locator, byRole('columnheader'));\n }\n\n async getColumnCount(): Promise<number> {\n return this.getCellCount();\n }\n\n protected override getCellLocator(): PartLocator {\n return this._headerCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridHeaderRowDriver';\n }\n}\n","import { HTMLButtonDriver } from '@atomic-testing/component-driver-html';\nimport {\n byAttribute,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nconst parts = {\n previousButton: {\n locator: byAttribute('aria-label', 'Go to previous page'),\n driver: HTMLButtonDriver,\n },\n nextButton: {\n locator: byAttribute('aria-label', 'Go to next page'),\n driver: HTMLButtonDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridPaginationActionDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('previousButton');\n const isDisabled = await this.parts.previousButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('previousButton');\n await this.parts.previousButton.click();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('nextButton');\n const isDisabled = await this.parts.nextButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('nextButton');\n await this.parts.nextButton.click();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridPaginationActionDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridPaginationActionDriver } from './DataGridPaginationActionDriver';\n\nconst parts = {\n paginationAction: {\n locator: byCssClass('MuiTablePagination-actions'),\n driver: DataGridPaginationActionDriver,\n },\n paginationDescription: {\n locator: byCssClass('MuiTablePagination-displayedRows'),\n driver: HTMLElementDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridFooterDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isPreviousPageEnabled();\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoPreviousPage();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isNextPageEnabled();\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoNextPage();\n }\n\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('paginationDescription');\n return this.parts.paginationDescription.getText();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridFooterDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n byCssSelector,\n byRole,\n ComponentDriver,\n ComponentDriverCtor,\n IComponentDriverOption,\n Interactor,\n listHelper,\n locatorUtil,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridCellQuery } from './DataGridCellQuery';\nimport { DataGridFooterDriver } from './DataGridFooterDriver';\nimport { DataGridHeaderRowDriver } from './DataGridHeaderRowDriver';\n\nconst parts = {\n headerRow: {\n locator: byCssClass('MuiDataGrid-columnHeaders').chain(byCssSelector('[role=row]:first-of-type')),\n driver: DataGridHeaderRowDriver,\n },\n loading: {\n locator: byRole('progressbar'),\n driver: HTMLElementDriver,\n },\n skeletonOverlay: {\n locator: byCssClass('MuiDataGrid-main--hasSkeletonLoadingOverlay'),\n driver: HTMLElementDriver,\n },\n footer: {\n locator: byCssClass('MuiDataGrid-footerContainer'),\n driver: DataGridFooterDriver,\n },\n} satisfies ScenePart;\n\nconst dataRowLocator = byCssSelector('[role=row][data-rowindex]');\n\n/**\n * Driver for Material UI v8 DataGridPro component.\n * V8 DataGridPro component does not support data-testid, to use data-testid\n * to locate the component, you need to put the data-testid on the parent element of the grid\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridProDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n /**\n * Checks if the data grid is currently loading.\n * @returns A promise that resolves to a boolean indicating if the data grid is loading.\n */\n async isLoading(): Promise<boolean> {\n const result = await Promise.all([this.parts.skeletonOverlay.isVisible(), this.parts.loading.isVisible()]);\n return result.some(v => v);\n }\n\n /**\n * Waits for the data grid to exit the loading state.\n * @param timeoutMs The maximum time to wait for the load to complete, in milliseconds.\n */\n async waitForLoad(timeoutMs: number = 10000): Promise<void> {\n await this.parts.headerRow.waitUntilComponentState();\n await this.waitUntil({ probeFn: () => this.isLoading(), terminateCondition: false, timeoutMs });\n }\n\n /**\n * The number of columns currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the column count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getColumnCount(): Promise<number> {\n return this.parts.headerRow.getColumnCount();\n }\n\n /**\n * The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @returns The array of text of the header row\n */\n async getHeaderText(): Promise<string[]> {\n return this.parts.headerRow.getRowText();\n }\n\n /**\n * The number of rows currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the row count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getRowCount(): Promise<number> {\n const gridRowLocator = locatorUtil.append(this.locator, dataRowLocator);\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(this, gridRowLocator, HTMLElementDriver)) {\n count++;\n }\n return count;\n }\n\n /**\n * Return the row driver for the row at the specified index, if the row does not exist, return null\n * @param rowIndex\n * @returns\n */\n async getRow(rowIndex: number): Promise<DataGridHeaderRowDriver | null> {\n const rowLocator = locatorUtil.append(this.locator, byCssSelector(`[role=row][data-rowindex=\"${rowIndex}\"]`));\n const rowExists = await this.interactor.exists(rowLocator);\n if (rowExists) {\n return new DataGridHeaderRowDriver(rowLocator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n /**\n * The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @param rowIndex The index of the row\n * @returns The array of text of the specified row\n */\n async getRowText(rowIndex: number): Promise<string[]> {\n const row = await this.getRow(rowIndex);\n if (row != null) {\n return row.getRowText();\n }\n throw new Error(`Row ${rowIndex} does not exist`);\n }\n\n /**\n * Get the cell driver for the cell, if the cell does not exist, return null\n * The cell driver is default to HTMLElementDriver, you can specify a different driver class\n * @param query The query to locate the cell\n * @param driverClass Optional, the driver class to use for the cell, default to HTMLElementDriver\n * @returns\n */\n async getCell<DriverT extends ComponentDriver>(\n query: DataGridCellQuery,\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n const rowDriver = await this.getRow(query.rowIndex);\n\n if (rowDriver === null) {\n return null;\n }\n\n if ('columnIndex' in query) {\n return rowDriver.getCell(query.columnIndex, driverClass);\n }\n\n return rowDriver.getCell(query.columnField, driverClass);\n }\n\n /**\n * Get the text content of the cell, if the cell does not exist, throw an error\n * @param query The query to locate the cell\n * @returns\n */\n async getCellText(query: DataGridCellQuery): Promise<string> {\n const cell = await this.getCell(query);\n if (cell != null) {\n const text = await cell.getText();\n return text!;\n }\n\n const columnIdentifier = 'columnIndex' in query ? query.columnIndex : query.columnField;\n throw new Error(`Cell at row:${query.rowIndex} column:${columnIdentifier} does not exist`);\n }\n\n //#region Footer\n /**\n * Determine if the pagination footer is currently visible.\n */\n isFooterVisible(): Promise<boolean> {\n return this.parts.footer.isVisible();\n }\n\n /**\n * Check whether the \"previous page\" control is enabled.\n */\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isPreviousPageEnabled();\n }\n\n /**\n * Navigate to the previous page using the grid footer control.\n */\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoPreviousPage();\n }\n\n /**\n * Check whether the \"next page\" control is enabled.\n */\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isNextPageEnabled();\n }\n\n /**\n * Navigate to the next page using the grid footer control.\n */\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoNextPage();\n }\n\n /**\n * Read the textual description of the current pagination state.\n */\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.getText();\n }\n //#endregion Footer\n\n override get driverName(): string {\n return 'MuiV8DataGridProDriver';\n }\n}\n"],"mappings":";;;;AAWA,MAAM,sBAAsB;;;;AAK5B,IAAsB,wBAAtB,cAAoDA,qBAAAA,gBAAgB;CAClE,MAAgB,eAAgC;EAC9C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KAAK,OAAO,MAAM,QAAQ;EAElD,IAAI,cAAc,MAChB,OAAO;EAGT,IAAI,iBAAiB,OACnB,OAAO,UAAU,QAAQ,MAAM,aAAa,WAAW;EAGzD,OAAO,UAAU,QAAQ,MAAM,aAAa,WAAW;CACzD;;;;;;CAOA,MAAM,YAAY,OAA2C;EAC3D,MAAM,OAAO,MAAM,KAAK,QAAQ,KAAK;EACrC,IAAI,QAAQ,MAEV,OAAO,MADY,KAAK,QAAQ;EAIlC,MAAM,mBAAmB,iBAAiB,QAAQ,MAAM,cAAc,MAAM;EAC5E,MAAM,IAAI,MAAM,eAAe,MAAM,SAAS,UAAU,iBAAiB,gBAAgB;CAC3F;;;;CAMA,kBAAoC;EAClC,OAAO,KAAK,MAAM,OAAO,UAAU;CACrC;;;;CAKA,MAAM,wBAA0C;EAC9C,MAAM,KAAK,qBAAqB,QAAQ;EACxC,OAAO,KAAK,MAAM,OAAO,sBAAsB;CACjD;;;;CAKA,MAAM,mBAAkC;EACtC,MAAM,KAAK,qBAAqB,QAAQ;EACxC,MAAM,KAAK,MAAM,OAAO,iBAAiB;CAC3C;;;;CAKA,MAAM,oBAAsC;EAC1C,MAAM,KAAK,qBAAqB,QAAQ;EACxC,OAAO,KAAK,MAAM,OAAO,kBAAkB;CAC7C;;;;CAKA,MAAM,eAA8B;EAClC,MAAM,KAAK,qBAAqB,QAAQ;EACxC,MAAM,KAAK,MAAM,OAAO,aAAa;CACvC;;;;CAKA,MAAM,2BAAsD;EAC1D,MAAM,KAAK,qBAAqB,QAAQ;EACxC,OAAO,KAAK,MAAM,OAAO,QAAQ;CACnC;CAGA,IAAa,aAAqB;EAChC,OAAO;CACT;AACF"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _atomic_testing_core4 from "@atomic-testing/core";
|
|
2
1
|
import { ComponentDriver, ComponentDriverCtor, IComponentDriverOption, Interactor, Optional, PartLocator } from "@atomic-testing/core";
|
|
3
2
|
import { HTMLButtonDriver, HTMLElementDriver } from "@atomic-testing/component-driver-html";
|
|
4
3
|
|
|
@@ -32,8 +31,7 @@ declare abstract class DataGridRowDriverBase extends ComponentDriver {
|
|
|
32
31
|
* @param driverClass The driver class of the cell. Default is HTMLElementDriver
|
|
33
32
|
* @returns A promise of the cell driver, or null if the cell is not found
|
|
34
33
|
*/
|
|
35
|
-
getCell<DriverT extends ComponentDriver>(cellIndexOrField: number | string,
|
|
36
|
-
// number: column index, string: column field
|
|
34
|
+
getCell<DriverT extends ComponentDriver>(cellIndexOrField: number | string, // number: column index, string: column field
|
|
37
35
|
driverClass?: ComponentDriverCtor<DriverT>): Promise<DriverT | null>;
|
|
38
36
|
protected abstract getCellLocator(): PartLocator;
|
|
39
37
|
}
|
|
@@ -58,11 +56,11 @@ declare class DataGridHeaderRowDriver extends DataGridRowDriverBase {
|
|
|
58
56
|
//#region src/components/datagrid/DataGridPaginationActionDriver.d.ts
|
|
59
57
|
declare const parts$2: {
|
|
60
58
|
previousButton: {
|
|
61
|
-
locator:
|
|
59
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
62
60
|
driver: typeof HTMLButtonDriver;
|
|
63
61
|
};
|
|
64
62
|
nextButton: {
|
|
65
|
-
locator:
|
|
63
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
66
64
|
driver: typeof HTMLButtonDriver;
|
|
67
65
|
};
|
|
68
66
|
};
|
|
@@ -82,11 +80,11 @@ declare class DataGridPaginationActionDriver extends ComponentDriver<typeof part
|
|
|
82
80
|
//#region src/components/datagrid/DataGridFooterDriver.d.ts
|
|
83
81
|
declare const parts$1: {
|
|
84
82
|
paginationAction: {
|
|
85
|
-
locator:
|
|
83
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
86
84
|
driver: typeof DataGridPaginationActionDriver;
|
|
87
85
|
};
|
|
88
86
|
paginationDescription: {
|
|
89
|
-
locator:
|
|
87
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
90
88
|
driver: typeof HTMLElementDriver;
|
|
91
89
|
};
|
|
92
90
|
};
|
|
@@ -111,15 +109,15 @@ declare const parts: {
|
|
|
111
109
|
driver: typeof DataGridHeaderRowDriver;
|
|
112
110
|
};
|
|
113
111
|
loading: {
|
|
114
|
-
locator:
|
|
112
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
115
113
|
driver: typeof HTMLElementDriver;
|
|
116
114
|
};
|
|
117
115
|
skeletonOverlay: {
|
|
118
|
-
locator:
|
|
116
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
119
117
|
driver: typeof HTMLElementDriver;
|
|
120
118
|
};
|
|
121
119
|
footer: {
|
|
122
|
-
locator:
|
|
120
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
123
121
|
driver: typeof DataGridFooterDriver;
|
|
124
122
|
};
|
|
125
123
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _atomic_testing_core4 from "@atomic-testing/core";
|
|
2
1
|
import { ComponentDriver, ComponentDriverCtor, IComponentDriverOption, Interactor, Optional, PartLocator } from "@atomic-testing/core";
|
|
3
2
|
import { HTMLButtonDriver, HTMLElementDriver } from "@atomic-testing/component-driver-html";
|
|
4
3
|
|
|
@@ -32,8 +31,7 @@ declare abstract class DataGridRowDriverBase extends ComponentDriver {
|
|
|
32
31
|
* @param driverClass The driver class of the cell. Default is HTMLElementDriver
|
|
33
32
|
* @returns A promise of the cell driver, or null if the cell is not found
|
|
34
33
|
*/
|
|
35
|
-
getCell<DriverT extends ComponentDriver>(cellIndexOrField: number | string,
|
|
36
|
-
// number: column index, string: column field
|
|
34
|
+
getCell<DriverT extends ComponentDriver>(cellIndexOrField: number | string, // number: column index, string: column field
|
|
37
35
|
driverClass?: ComponentDriverCtor<DriverT>): Promise<DriverT | null>;
|
|
38
36
|
protected abstract getCellLocator(): PartLocator;
|
|
39
37
|
}
|
|
@@ -58,11 +56,11 @@ declare class DataGridHeaderRowDriver extends DataGridRowDriverBase {
|
|
|
58
56
|
//#region src/components/datagrid/DataGridPaginationActionDriver.d.ts
|
|
59
57
|
declare const parts$2: {
|
|
60
58
|
previousButton: {
|
|
61
|
-
locator:
|
|
59
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
62
60
|
driver: typeof HTMLButtonDriver;
|
|
63
61
|
};
|
|
64
62
|
nextButton: {
|
|
65
|
-
locator:
|
|
63
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
66
64
|
driver: typeof HTMLButtonDriver;
|
|
67
65
|
};
|
|
68
66
|
};
|
|
@@ -82,11 +80,11 @@ declare class DataGridPaginationActionDriver extends ComponentDriver<typeof part
|
|
|
82
80
|
//#region src/components/datagrid/DataGridFooterDriver.d.ts
|
|
83
81
|
declare const parts$1: {
|
|
84
82
|
paginationAction: {
|
|
85
|
-
locator:
|
|
83
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
86
84
|
driver: typeof DataGridPaginationActionDriver;
|
|
87
85
|
};
|
|
88
86
|
paginationDescription: {
|
|
89
|
-
locator:
|
|
87
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
90
88
|
driver: typeof HTMLElementDriver;
|
|
91
89
|
};
|
|
92
90
|
};
|
|
@@ -111,15 +109,15 @@ declare const parts: {
|
|
|
111
109
|
driver: typeof DataGridHeaderRowDriver;
|
|
112
110
|
};
|
|
113
111
|
loading: {
|
|
114
|
-
locator:
|
|
112
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
115
113
|
driver: typeof HTMLElementDriver;
|
|
116
114
|
};
|
|
117
115
|
skeletonOverlay: {
|
|
118
|
-
locator:
|
|
116
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
119
117
|
driver: typeof HTMLElementDriver;
|
|
120
118
|
};
|
|
121
119
|
footer: {
|
|
122
|
-
locator:
|
|
120
|
+
locator: import("@atomic-testing/core").CssLocator;
|
|
123
121
|
driver: typeof DataGridFooterDriver;
|
|
124
122
|
};
|
|
125
123
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentDriver, byAttribute, byCssClass, byCssSelector, byRole, listHelper, locatorUtil } from "@atomic-testing/core";
|
|
2
2
|
import { HTMLButtonDriver, HTMLElementDriver } from "@atomic-testing/component-driver-html";
|
|
3
|
-
|
|
4
3
|
//#region src/components/datagrid/DataGridRowDriverBase.ts
|
|
5
4
|
const columnStartingIndex = 1;
|
|
6
5
|
/**
|
|
@@ -41,7 +40,6 @@ var DataGridRowDriverBase = class extends ComponentDriver {
|
|
|
41
40
|
return null;
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
|
-
|
|
45
43
|
//#endregion
|
|
46
44
|
//#region src/components/datagrid/DataGridDataRowDriver.ts
|
|
47
45
|
var DataGridDataRowDriver = class extends DataGridRowDriverBase {
|
|
@@ -59,7 +57,6 @@ var DataGridDataRowDriver = class extends DataGridRowDriverBase {
|
|
|
59
57
|
return "MuiV8DataGridDataRowDriver";
|
|
60
58
|
}
|
|
61
59
|
};
|
|
62
|
-
|
|
63
60
|
//#endregion
|
|
64
61
|
//#region src/components/datagrid/DataGridHeaderRowDriver.ts
|
|
65
62
|
var DataGridHeaderRowDriver = class extends DataGridRowDriverBase {
|
|
@@ -80,7 +77,6 @@ var DataGridHeaderRowDriver = class extends DataGridRowDriverBase {
|
|
|
80
77
|
return "MuiV8DataGridHeaderRowDriver";
|
|
81
78
|
}
|
|
82
79
|
};
|
|
83
|
-
|
|
84
80
|
//#endregion
|
|
85
81
|
//#region src/components/datagrid/DataGridPaginationActionDriver.ts
|
|
86
82
|
const parts$2 = {
|
|
@@ -124,7 +120,6 @@ var DataGridPaginationActionDriver = class extends ComponentDriver {
|
|
|
124
120
|
return "MuiV8DataGridPaginationActionDriver";
|
|
125
121
|
}
|
|
126
122
|
};
|
|
127
|
-
|
|
128
123
|
//#endregion
|
|
129
124
|
//#region src/components/datagrid/DataGridFooterDriver.ts
|
|
130
125
|
const parts$1 = {
|
|
@@ -172,7 +167,6 @@ var DataGridFooterDriver = class extends ComponentDriver {
|
|
|
172
167
|
return "MuiV8DataGridFooterDriver";
|
|
173
168
|
}
|
|
174
169
|
};
|
|
175
|
-
|
|
176
170
|
//#endregion
|
|
177
171
|
//#region src/components/datagrid/DataGridProDriver.ts
|
|
178
172
|
const parts = {
|
|
@@ -341,7 +335,7 @@ var DataGridProDriver = class extends ComponentDriver {
|
|
|
341
335
|
return "MuiV8DataGridProDriver";
|
|
342
336
|
}
|
|
343
337
|
};
|
|
344
|
-
|
|
345
338
|
//#endregion
|
|
346
339
|
export { DataGridDataRowDriver, DataGridHeaderRowDriver, DataGridProDriver };
|
|
340
|
+
|
|
347
341
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["textList: string[]","cellLocator: PartLocator","parts","parts"],"sources":["../src/components/datagrid/DataGridRowDriverBase.ts","../src/components/datagrid/DataGridDataRowDriver.ts","../src/components/datagrid/DataGridHeaderRowDriver.ts","../src/components/datagrid/DataGridPaginationActionDriver.ts","../src/components/datagrid/DataGridFooterDriver.ts","../src/components/datagrid/DataGridProDriver.ts"],"sourcesContent":["import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport { byAttribute, ComponentDriver, ComponentDriverCtor, listHelper, locatorUtil, PartLocator } from '@atomic-testing/core';\n\n// In MUI7, there is an extra div preceding the actual data cells. We need to skip it.\nconst columnStartingIndex = 1;\n\n/**\n * Base class for data grid row\n */\nexport abstract class DataGridRowDriverBase extends ComponentDriver {\n protected async getCellCount(): Promise<number> {\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n count++;\n }\n return count;\n }\n\n /**\n * Get the text of each visible cell in the row.\n * Caveat: Because of virtualization, the text of the cell may not be available until the cell is visible.\n * @returns A promise array of text of each visible cell in the row\n */\n async getRowText(): Promise<string[]> {\n const textList: string[] = [];\n for await (const cell of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n const text = await cell.getText();\n textList.push(text!.trim());\n }\n return textList;\n }\n\n /**\n * Get the cell driver at the specified index or data field.\n * Caveat: Because of virtualization, the cell may not be available until the cell is visible.\n * @param cellIndexOrField number: column index, string: column field\n * @param driverClass The driver class of the cell. Default is HTMLElementDriver\n * @returns A promise of the cell driver, or null if the cell is not found\n */\n async getCell<DriverT extends ComponentDriver>(\n cellIndexOrField: number | string, // number: column index, string: column field\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n let cellLocator: PartLocator;\n if (typeof cellIndexOrField === 'number') {\n cellLocator = byAttribute('data-colindex', cellIndexOrField.toString());\n } else {\n cellLocator = byAttribute('data-field', cellIndexOrField);\n }\n const locator = locatorUtil.append(this.locator, cellLocator);\n const cellExists = await this.interactor.exists(locator);\n if (cellExists) {\n return new driverClass(locator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n protected abstract getCellLocator(): PartLocator;\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridDataRowDriver extends DataGridRowDriverBase {\n private readonly _dataCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._dataCellLocator = locatorUtil.append(locator, byRole('cell'));\n }\n\n protected override getCellLocator(): PartLocator {\n return this._dataCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridDataRowDriver';\n }\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridHeaderRowDriver extends DataGridRowDriverBase {\n private readonly _headerCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._headerCellLocator = locatorUtil.append(locator, byRole('columnheader'));\n }\n\n async getColumnCount(): Promise<number> {\n return this.getCellCount();\n }\n\n protected override getCellLocator(): PartLocator {\n return this._headerCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridHeaderRowDriver';\n }\n}\n","import { HTMLButtonDriver } from '@atomic-testing/component-driver-html';\nimport {\n byAttribute,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nconst parts = {\n previousButton: {\n locator: byAttribute('aria-label', 'Go to previous page'),\n driver: HTMLButtonDriver,\n },\n nextButton: {\n locator: byAttribute('aria-label', 'Go to next page'),\n driver: HTMLButtonDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridPaginationActionDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('previousButton');\n const isDisabled = await this.parts.previousButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('previousButton');\n await this.parts.previousButton.click();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('nextButton');\n const isDisabled = await this.parts.nextButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('nextButton');\n await this.parts.nextButton.click();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridPaginationActionDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridPaginationActionDriver } from './DataGridPaginationActionDriver';\n\nconst parts = {\n paginationAction: {\n locator: byCssClass('MuiTablePagination-actions'),\n driver: DataGridPaginationActionDriver,\n },\n paginationDescription: {\n locator: byCssClass('MuiTablePagination-displayedRows'),\n driver: HTMLElementDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridFooterDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isPreviousPageEnabled();\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoPreviousPage();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isNextPageEnabled();\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoNextPage();\n }\n\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('paginationDescription');\n return this.parts.paginationDescription.getText();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridFooterDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n byCssSelector,\n byRole,\n ComponentDriver,\n ComponentDriverCtor,\n IComponentDriverOption,\n Interactor,\n listHelper,\n locatorUtil,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridCellQuery } from './DataGridCellQuery';\nimport { DataGridFooterDriver } from './DataGridFooterDriver';\nimport { DataGridHeaderRowDriver } from './DataGridHeaderRowDriver';\n\nconst parts = {\n headerRow: {\n locator: byCssClass('MuiDataGrid-columnHeaders').chain(byCssSelector('[role=row]:first-of-type')),\n driver: DataGridHeaderRowDriver,\n },\n loading: {\n locator: byRole('progressbar'),\n driver: HTMLElementDriver,\n },\n skeletonOverlay: {\n locator: byCssClass('MuiDataGrid-main--hasSkeletonLoadingOverlay'),\n driver: HTMLElementDriver,\n },\n footer: {\n locator: byCssClass('MuiDataGrid-footerContainer'),\n driver: DataGridFooterDriver,\n },\n} satisfies ScenePart;\n\nconst dataRowLocator = byCssSelector('[role=row][data-rowindex]');\n\n/**\n * Driver for Material UI v8 DataGridPro component.\n * V8 DataGridPro component does not support data-testid, to use data-testid\n * to locate the component, you need to put the data-testid on the parent element of the grid\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridProDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n /**\n * Checks if the data grid is currently loading.\n * @returns A promise that resolves to a boolean indicating if the data grid is loading.\n */\n async isLoading(): Promise<boolean> {\n const result = await Promise.all([this.parts.skeletonOverlay.isVisible(), this.parts.loading.isVisible()]);\n return result.some(v => v);\n }\n\n /**\n * Waits for the data grid to exit the loading state.\n * @param timeoutMs The maximum time to wait for the load to complete, in milliseconds.\n */\n async waitForLoad(timeoutMs: number = 10000): Promise<void> {\n await this.parts.headerRow.waitUntilComponentState();\n await this.waitUntil({ probeFn: () => this.isLoading(), terminateCondition: false, timeoutMs });\n }\n\n /**\n * The number of columns currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the column count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getColumnCount(): Promise<number> {\n return this.parts.headerRow.getColumnCount();\n }\n\n /**\n * The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @returns The array of text of the header row\n */\n async getHeaderText(): Promise<string[]> {\n return this.parts.headerRow.getRowText();\n }\n\n /**\n * The number of rows currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the row count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getRowCount(): Promise<number> {\n const gridRowLocator = locatorUtil.append(this.locator, dataRowLocator);\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(this, gridRowLocator, HTMLElementDriver)) {\n count++;\n }\n return count;\n }\n\n /**\n * Return the row driver for the row at the specified index, if the row does not exist, return null\n * @param rowIndex\n * @returns\n */\n async getRow(rowIndex: number): Promise<DataGridHeaderRowDriver | null> {\n const rowLocator = locatorUtil.append(this.locator, byCssSelector(`[role=row][data-rowindex=\"${rowIndex}\"]`));\n const rowExists = await this.interactor.exists(rowLocator);\n if (rowExists) {\n return new DataGridHeaderRowDriver(rowLocator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n /**\n * The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @param rowIndex The index of the row\n * @returns The array of text of the specified row\n */\n async getRowText(rowIndex: number): Promise<string[]> {\n const row = await this.getRow(rowIndex);\n if (row != null) {\n return row.getRowText();\n }\n throw new Error(`Row ${rowIndex} does not exist`);\n }\n\n /**\n * Get the cell driver for the cell, if the cell does not exist, return null\n * The cell driver is default to HTMLElementDriver, you can specify a different driver class\n * @param query The query to locate the cell\n * @param driverClass Optional, the driver class to use for the cell, default to HTMLElementDriver\n * @returns\n */\n async getCell<DriverT extends ComponentDriver>(\n query: DataGridCellQuery,\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n const rowDriver = await this.getRow(query.rowIndex);\n\n if (rowDriver === null) {\n return null;\n }\n\n if ('columnIndex' in query) {\n return rowDriver.getCell(query.columnIndex, driverClass);\n }\n\n return rowDriver.getCell(query.columnField, driverClass);\n }\n\n /**\n * Get the text content of the cell, if the cell does not exist, throw an error\n * @param query The query to locate the cell\n * @returns\n */\n async getCellText(query: DataGridCellQuery): Promise<string> {\n const cell = await this.getCell(query);\n if (cell != null) {\n const text = await cell.getText();\n return text!;\n }\n\n const columnIdentifier = 'columnIndex' in query ? query.columnIndex : query.columnField;\n throw new Error(`Cell at row:${query.rowIndex} column:${columnIdentifier} does not exist`);\n }\n\n //#region Footer\n /**\n * Determine if the pagination footer is currently visible.\n */\n isFooterVisible(): Promise<boolean> {\n return this.parts.footer.isVisible();\n }\n\n /**\n * Check whether the \"previous page\" control is enabled.\n */\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isPreviousPageEnabled();\n }\n\n /**\n * Navigate to the previous page using the grid footer control.\n */\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoPreviousPage();\n }\n\n /**\n * Check whether the \"next page\" control is enabled.\n */\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isNextPageEnabled();\n }\n\n /**\n * Navigate to the next page using the grid footer control.\n */\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoNextPage();\n }\n\n /**\n * Read the textual description of the current pagination state.\n */\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.getText();\n }\n //#endregion Footer\n\n override get driverName(): string {\n return 'MuiV8DataGridProDriver';\n }\n}\n"],"mappings":";;;;AAIA,MAAM,sBAAsB;;;;AAK5B,IAAsB,wBAAtB,cAAoD,gBAAgB;CAClE,MAAgB,eAAgC;EAC9C,IAAI,QAAQ;AACZ,aAAW,MAAM,KAAK,WAAW,oBAC/B,MACA,KAAK,gBAAgB,EACrB,mBACA,oBACD,CACC;AAEF,SAAO;;;;;;;CAQT,MAAM,aAAgC;EACpC,MAAMA,WAAqB,EAAE;AAC7B,aAAW,MAAM,QAAQ,WAAW,oBAClC,MACA,KAAK,gBAAgB,EACrB,mBACA,oBACD,EAAE;GACD,MAAM,OAAO,MAAM,KAAK,SAAS;AACjC,YAA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C,SAAO,KAAK,MAAM,OAAO,SAAS;;CAIpC,IAAa,aAAqB;AAChC,SAAO"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["parts","parts"],"sources":["../src/components/datagrid/DataGridRowDriverBase.ts","../src/components/datagrid/DataGridDataRowDriver.ts","../src/components/datagrid/DataGridHeaderRowDriver.ts","../src/components/datagrid/DataGridPaginationActionDriver.ts","../src/components/datagrid/DataGridFooterDriver.ts","../src/components/datagrid/DataGridProDriver.ts"],"sourcesContent":["import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byAttribute,\n ComponentDriver,\n ComponentDriverCtor,\n listHelper,\n locatorUtil,\n PartLocator,\n} from '@atomic-testing/core';\n\n// In MUI7, there is an extra div preceding the actual data cells. We need to skip it.\nconst columnStartingIndex = 1;\n\n/**\n * Base class for data grid row\n */\nexport abstract class DataGridRowDriverBase extends ComponentDriver {\n protected async getCellCount(): Promise<number> {\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n count++;\n }\n return count;\n }\n\n /**\n * Get the text of each visible cell in the row.\n * Caveat: Because of virtualization, the text of the cell may not be available until the cell is visible.\n * @returns A promise array of text of each visible cell in the row\n */\n async getRowText(): Promise<string[]> {\n const textList: string[] = [];\n for await (const cell of listHelper.getListItemIterator(\n this,\n this.getCellLocator(),\n HTMLElementDriver,\n columnStartingIndex\n )) {\n const text = await cell.getText();\n textList.push(text!.trim());\n }\n return textList;\n }\n\n /**\n * Get the cell driver at the specified index or data field.\n * Caveat: Because of virtualization, the cell may not be available until the cell is visible.\n * @param cellIndexOrField number: column index, string: column field\n * @param driverClass The driver class of the cell. Default is HTMLElementDriver\n * @returns A promise of the cell driver, or null if the cell is not found\n */\n async getCell<DriverT extends ComponentDriver>(\n cellIndexOrField: number | string, // number: column index, string: column field\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n let cellLocator: PartLocator;\n if (typeof cellIndexOrField === 'number') {\n cellLocator = byAttribute('data-colindex', cellIndexOrField.toString());\n } else {\n cellLocator = byAttribute('data-field', cellIndexOrField);\n }\n const locator = locatorUtil.append(this.locator, cellLocator);\n const cellExists = await this.interactor.exists(locator);\n if (cellExists) {\n return new driverClass(locator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n protected abstract getCellLocator(): PartLocator;\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridDataRowDriver extends DataGridRowDriverBase {\n private readonly _dataCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._dataCellLocator = locatorUtil.append(locator, byRole('cell'));\n }\n\n protected override getCellLocator(): PartLocator {\n return this._dataCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridDataRowDriver';\n }\n}\n","import { byRole, IComponentDriverOption, Interactor, locatorUtil, PartLocator } from '@atomic-testing/core';\n\nimport { DataGridRowDriverBase } from './DataGridRowDriverBase';\n\nexport class DataGridHeaderRowDriver extends DataGridRowDriverBase {\n private readonly _headerCellLocator: PartLocator;\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts: {},\n });\n\n this._headerCellLocator = locatorUtil.append(locator, byRole('columnheader'));\n }\n\n async getColumnCount(): Promise<number> {\n return this.getCellCount();\n }\n\n protected override getCellLocator(): PartLocator {\n return this._headerCellLocator;\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridHeaderRowDriver';\n }\n}\n","import { HTMLButtonDriver } from '@atomic-testing/component-driver-html';\nimport {\n byAttribute,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nconst parts = {\n previousButton: {\n locator: byAttribute('aria-label', 'Go to previous page'),\n driver: HTMLButtonDriver,\n },\n nextButton: {\n locator: byAttribute('aria-label', 'Go to next page'),\n driver: HTMLButtonDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridPaginationActionDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('previousButton');\n const isDisabled = await this.parts.previousButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('previousButton');\n await this.parts.previousButton.click();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('nextButton');\n const isDisabled = await this.parts.nextButton.isDisabled();\n return !isDisabled;\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('nextButton');\n await this.parts.nextButton.click();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridPaginationActionDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n ComponentDriver,\n IComponentDriverOption,\n Interactor,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridPaginationActionDriver } from './DataGridPaginationActionDriver';\n\nconst parts = {\n paginationAction: {\n locator: byCssClass('MuiTablePagination-actions'),\n driver: DataGridPaginationActionDriver,\n },\n paginationDescription: {\n locator: byCssClass('MuiTablePagination-displayedRows'),\n driver: HTMLElementDriver,\n },\n} satisfies ScenePart;\n\n/**\n * Driver for Material UI v6 DataGridPro component.\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridFooterDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isPreviousPageEnabled();\n }\n\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoPreviousPage();\n }\n\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('paginationAction');\n return this.parts.paginationAction.isNextPageEnabled();\n }\n\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('paginationAction');\n await this.parts.paginationAction.gotoNextPage();\n }\n\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('paginationDescription');\n return this.parts.paginationDescription.getText();\n }\n\n override get driverName(): string {\n return 'MuiV8DataGridFooterDriver';\n }\n}\n","import { HTMLElementDriver } from '@atomic-testing/component-driver-html';\nimport {\n byCssClass,\n byCssSelector,\n byRole,\n ComponentDriver,\n ComponentDriverCtor,\n IComponentDriverOption,\n Interactor,\n listHelper,\n locatorUtil,\n Optional,\n PartLocator,\n ScenePart,\n} from '@atomic-testing/core';\n\nimport { DataGridCellQuery } from './DataGridCellQuery';\nimport { DataGridFooterDriver } from './DataGridFooterDriver';\nimport { DataGridHeaderRowDriver } from './DataGridHeaderRowDriver';\n\nconst parts = {\n headerRow: {\n locator: byCssClass('MuiDataGrid-columnHeaders').chain(byCssSelector('[role=row]:first-of-type')),\n driver: DataGridHeaderRowDriver,\n },\n loading: {\n locator: byRole('progressbar'),\n driver: HTMLElementDriver,\n },\n skeletonOverlay: {\n locator: byCssClass('MuiDataGrid-main--hasSkeletonLoadingOverlay'),\n driver: HTMLElementDriver,\n },\n footer: {\n locator: byCssClass('MuiDataGrid-footerContainer'),\n driver: DataGridFooterDriver,\n },\n} satisfies ScenePart;\n\nconst dataRowLocator = byCssSelector('[role=row][data-rowindex]');\n\n/**\n * Driver for Material UI v8 DataGridPro component.\n * V8 DataGridPro component does not support data-testid, to use data-testid\n * to locate the component, you need to put the data-testid on the parent element of the grid\n * @see https://mui.com/x/react-data-grid/\n */\nexport class DataGridProDriver extends ComponentDriver<typeof parts> {\n constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) {\n super(locator, interactor, {\n ...option,\n parts,\n });\n }\n\n /**\n * Checks if the data grid is currently loading.\n * @returns A promise that resolves to a boolean indicating if the data grid is loading.\n */\n async isLoading(): Promise<boolean> {\n const result = await Promise.all([this.parts.skeletonOverlay.isVisible(), this.parts.loading.isVisible()]);\n return result.some(v => v);\n }\n\n /**\n * Waits for the data grid to exit the loading state.\n * @param timeoutMs The maximum time to wait for the load to complete, in milliseconds.\n */\n async waitForLoad(timeoutMs: number = 10000): Promise<void> {\n await this.parts.headerRow.waitUntilComponentState();\n await this.waitUntil({ probeFn: () => this.isLoading(), terminateCondition: false, timeoutMs });\n }\n\n /**\n * The number of columns currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the column count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getColumnCount(): Promise<number> {\n return this.parts.headerRow.getColumnCount();\n }\n\n /**\n * The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @returns The array of text of the header row\n */\n async getHeaderText(): Promise<string[]> {\n return this.parts.headerRow.getRowText();\n }\n\n /**\n * The number of rows currently displayed in the data grid, note that data grid pro\n * uses virtualize rendering, therefore the row count heavily depends on the viewport size\n * @returns The number of columns currently displayed in the data grid\n */\n async getRowCount(): Promise<number> {\n const gridRowLocator = locatorUtil.append(this.locator, dataRowLocator);\n let count = 0;\n for await (const _ of listHelper.getListItemIterator(this, gridRowLocator, HTMLElementDriver)) {\n count++;\n }\n return count;\n }\n\n /**\n * Return the row driver for the row at the specified index, if the row does not exist, return null\n * @param rowIndex\n * @returns\n */\n async getRow(rowIndex: number): Promise<DataGridHeaderRowDriver | null> {\n const rowLocator = locatorUtil.append(this.locator, byCssSelector(`[role=row][data-rowindex=\"${rowIndex}\"]`));\n const rowExists = await this.interactor.exists(rowLocator);\n if (rowExists) {\n return new DataGridHeaderRowDriver(rowLocator, this.interactor, this.commutableOption);\n }\n\n return null;\n }\n\n /**\n * The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering\n * @param rowIndex The index of the row\n * @returns The array of text of the specified row\n */\n async getRowText(rowIndex: number): Promise<string[]> {\n const row = await this.getRow(rowIndex);\n if (row != null) {\n return row.getRowText();\n }\n throw new Error(`Row ${rowIndex} does not exist`);\n }\n\n /**\n * Get the cell driver for the cell, if the cell does not exist, return null\n * The cell driver is default to HTMLElementDriver, you can specify a different driver class\n * @param query The query to locate the cell\n * @param driverClass Optional, the driver class to use for the cell, default to HTMLElementDriver\n * @returns\n */\n async getCell<DriverT extends ComponentDriver>(\n query: DataGridCellQuery,\n driverClass: ComponentDriverCtor<DriverT> = HTMLElementDriver as ComponentDriverCtor<DriverT>\n ): Promise<DriverT | null> {\n const rowDriver = await this.getRow(query.rowIndex);\n\n if (rowDriver === null) {\n return null;\n }\n\n if ('columnIndex' in query) {\n return rowDriver.getCell(query.columnIndex, driverClass);\n }\n\n return rowDriver.getCell(query.columnField, driverClass);\n }\n\n /**\n * Get the text content of the cell, if the cell does not exist, throw an error\n * @param query The query to locate the cell\n * @returns\n */\n async getCellText(query: DataGridCellQuery): Promise<string> {\n const cell = await this.getCell(query);\n if (cell != null) {\n const text = await cell.getText();\n return text!;\n }\n\n const columnIdentifier = 'columnIndex' in query ? query.columnIndex : query.columnField;\n throw new Error(`Cell at row:${query.rowIndex} column:${columnIdentifier} does not exist`);\n }\n\n //#region Footer\n /**\n * Determine if the pagination footer is currently visible.\n */\n isFooterVisible(): Promise<boolean> {\n return this.parts.footer.isVisible();\n }\n\n /**\n * Check whether the \"previous page\" control is enabled.\n */\n async isPreviousPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isPreviousPageEnabled();\n }\n\n /**\n * Navigate to the previous page using the grid footer control.\n */\n async gotoPreviousPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoPreviousPage();\n }\n\n /**\n * Check whether the \"next page\" control is enabled.\n */\n async isNextPageEnabled(): Promise<boolean> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.isNextPageEnabled();\n }\n\n /**\n * Navigate to the next page using the grid footer control.\n */\n async gotoNextPage(): Promise<void> {\n await this.enforcePartExistence('footer');\n await this.parts.footer.gotoNextPage();\n }\n\n /**\n * Read the textual description of the current pagination state.\n */\n async getPaginationDescription(): Promise<Optional<string>> {\n await this.enforcePartExistence('footer');\n return this.parts.footer.getText();\n }\n //#endregion Footer\n\n override get driverName(): string {\n return 'MuiV8DataGridProDriver';\n }\n}\n"],"mappings":";;;AAWA,MAAM,sBAAsB;;;;AAK5B,IAAsB,wBAAtB,cAAoD,gBAAgB;CAClE,MAAgB,eAAgC;EAC9C,IAAI,QAAQ;EACZ,WAAW,MAAM,KAAK,WAAW,oBAC/B,MACA,KAAK,eAAe,GACpB,mBACA,mBACF,GACE;EAEF,OAAO;CACT;;;;;;CAOA,MAAM,aAAgC;EACpC,MAAM,WAAqB,CAAC;EAC5B,WAAW,MAAM,QAAQ,WAAW,oBAClC,MACA,KAAK,eAAe,GACpB,mBACA,mBACF,GAAG;GACD,MAAM,OAAO,MAAM,KAAK,QAAQ;GAChC,SAAS,KAAK,KAAM,KAAK,CAAC;EAC5B;EACA,OAAO;CACT;;;;;;;;CASA,MAAM,QACJ,kBACA,cAA4C,mBACnB;EACzB,IAAI;EACJ,IAAI,OAAO,qBAAqB,UAC9B,cAAc,YAAY,iBAAiB,iBAAiB,SAAS,CAAC;OAEtE,cAAc,YAAY,cAAc,gBAAgB;EAE1D,MAAM,UAAU,YAAY,OAAO,KAAK,SAAS,WAAW;EAE5D,IAAI,MADqB,KAAK,WAAW,OAAO,OAAO,GAErD,OAAO,IAAI,YAAY,SAAS,KAAK,YAAY,KAAK,gBAAgB;EAGxE,OAAO;CACT;AAGF;;;ACxEA,IAAa,wBAAb,cA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Atomic Testing Component driver to help drive Material UI X V8 components",
|
|
5
|
-
"main": "dist/index.cjs",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/index.d.cts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"src"
|
|
11
|
-
],
|
|
12
|
-
"author": "Tianzhen Lin <tangent@usa.net>",
|
|
13
5
|
"keywords": [
|
|
14
|
-
"testing",
|
|
15
|
-
"react",
|
|
16
|
-
"unit",
|
|
17
6
|
"integration",
|
|
18
|
-
"
|
|
7
|
+
"integration-driver",
|
|
19
8
|
"material-ui",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
9
|
+
"mui",
|
|
10
|
+
"react",
|
|
11
|
+
"testing",
|
|
12
|
+
"unit",
|
|
13
|
+
"v6"
|
|
22
14
|
],
|
|
23
15
|
"license": "MIT",
|
|
16
|
+
"author": "Tianzhen Lin <tangent@usa.net>",
|
|
24
17
|
"repository": {
|
|
25
18
|
"type": "git",
|
|
26
19
|
"url": "https://github.com/atomic-testing/atomic-testing.git",
|
|
27
20
|
"directory": "packages/component-driver-mui-x-v8"
|
|
28
21
|
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"src"
|
|
25
|
+
],
|
|
26
|
+
"main": "dist/index.cjs",
|
|
27
|
+
"module": "dist/index.mjs",
|
|
28
|
+
"types": "dist/index.d.cts",
|
|
34
29
|
"exports": {
|
|
35
30
|
".": {
|
|
36
31
|
"types": "./dist/index.d.mts",
|
|
@@ -38,8 +33,13 @@
|
|
|
38
33
|
"require": "./dist/index.cjs"
|
|
39
34
|
}
|
|
40
35
|
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@atomic-testing/component-driver-html": "0.84.1",
|
|
38
|
+
"@atomic-testing/core": "0.84.1",
|
|
39
|
+
"@atomic-testing/component-driver-mui-v6": "0.84.1"
|
|
40
|
+
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsdown",
|
|
43
|
-
"check:type": "
|
|
43
|
+
"check:type": "tsgo --noEmit"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { HTMLElementDriver } from '@atomic-testing/component-driver-html';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
byAttribute,
|
|
4
|
+
ComponentDriver,
|
|
5
|
+
ComponentDriverCtor,
|
|
6
|
+
listHelper,
|
|
7
|
+
locatorUtil,
|
|
8
|
+
PartLocator,
|
|
9
|
+
} from '@atomic-testing/core';
|
|
3
10
|
|
|
4
11
|
// In MUI7, there is an extra div preceding the actual data cells. We need to skip it.
|
|
5
12
|
const columnStartingIndex = 1;
|