@atomic-testing/component-driver-mui-x-v8 0.58.0 → 0.59.0

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.
Files changed (31) hide show
  1. package/dist/index.d.mts +199 -0
  2. package/dist/index.d.ts +199 -1
  3. package/dist/index.js +362 -17
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +338 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +7 -7
  8. package/dist/components/datagrid/DataGridCellQuery.d.ts +0 -9
  9. package/dist/components/datagrid/DataGridCellQuery.js +0 -3
  10. package/dist/components/datagrid/DataGridCellQuery.js.map +0 -1
  11. package/dist/components/datagrid/DataGridDataRowDriver.d.ts +0 -8
  12. package/dist/components/datagrid/DataGridDataRowDriver.js +0 -19
  13. package/dist/components/datagrid/DataGridDataRowDriver.js.map +0 -1
  14. package/dist/components/datagrid/DataGridFooterDriver.d.ts +0 -27
  15. package/dist/components/datagrid/DataGridFooterDriver.js +0 -69
  16. package/dist/components/datagrid/DataGridFooterDriver.js.map +0 -1
  17. package/dist/components/datagrid/DataGridHeaderRowDriver.d.ts +0 -9
  18. package/dist/components/datagrid/DataGridHeaderRowDriver.js +0 -33
  19. package/dist/components/datagrid/DataGridHeaderRowDriver.js.map +0 -1
  20. package/dist/components/datagrid/DataGridPaginationActionDriver.d.ts +0 -25
  21. package/dist/components/datagrid/DataGridPaginationActionDriver.js +0 -64
  22. package/dist/components/datagrid/DataGridPaginationActionDriver.js.map +0 -1
  23. package/dist/components/datagrid/DataGridProDriver.d.ts +0 -93
  24. package/dist/components/datagrid/DataGridProDriver.js +0 -227
  25. package/dist/components/datagrid/DataGridProDriver.js.map +0 -1
  26. package/dist/components/datagrid/DataGridRowDriverBase.d.ts +0 -23
  27. package/dist/components/datagrid/DataGridRowDriverBase.js +0 -107
  28. package/dist/components/datagrid/DataGridRowDriverBase.js.map +0 -1
  29. package/dist/components/datagrid/index.d.ts +0 -4
  30. package/dist/components/datagrid/index.js +0 -25
  31. package/dist/components/datagrid/index.js.map +0 -1
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DataGridPaginationActionDriver = void 0;
13
- const component_driver_html_1 = require("@atomic-testing/component-driver-html");
14
- const core_1 = require("@atomic-testing/core");
15
- const parts = {
16
- previousButton: {
17
- locator: (0, core_1.byAttribute)('aria-label', 'Go to previous page'),
18
- driver: component_driver_html_1.HTMLButtonDriver,
19
- },
20
- nextButton: {
21
- locator: (0, core_1.byAttribute)('aria-label', 'Go to next page'),
22
- driver: component_driver_html_1.HTMLButtonDriver,
23
- },
24
- };
25
- /**
26
- * Driver for Material UI v6 DataGridPro component.
27
- * @see https://mui.com/x/react-data-grid/
28
- */
29
- class DataGridPaginationActionDriver extends core_1.ComponentDriver {
30
- constructor(locator, interactor, option) {
31
- super(locator, interactor, Object.assign(Object.assign({}, option), { parts }));
32
- }
33
- isPreviousPageEnabled() {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- yield this.enforcePartExistence('previousButton');
36
- const isDisabled = yield this.parts.previousButton.isDisabled();
37
- return !isDisabled;
38
- });
39
- }
40
- gotoPreviousPage() {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- yield this.enforcePartExistence('previousButton');
43
- yield this.parts.previousButton.click();
44
- });
45
- }
46
- isNextPageEnabled() {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- yield this.enforcePartExistence('nextButton');
49
- const isDisabled = yield this.parts.nextButton.isDisabled();
50
- return !isDisabled;
51
- });
52
- }
53
- gotoNextPage() {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- yield this.enforcePartExistence('nextButton');
56
- yield this.parts.nextButton.click();
57
- });
58
- }
59
- get driverName() {
60
- return 'MuiV8DataGridPaginationActionDriver';
61
- }
62
- }
63
- exports.DataGridPaginationActionDriver = DataGridPaginationActionDriver;
64
- //# sourceMappingURL=DataGridPaginationActionDriver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataGridPaginationActionDriver.js","sourceRoot":"","sources":["../../../src/components/datagrid/DataGridPaginationActionDriver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iFAAyE;AACzE,+CAO8B;AAE9B,MAAM,KAAK,GAAG;IACZ,cAAc,EAAE;QACd,OAAO,EAAE,IAAA,kBAAW,EAAC,YAAY,EAAE,qBAAqB,CAAC;QACzD,MAAM,EAAE,wCAAgB;KACzB;IACD,UAAU,EAAE;QACV,OAAO,EAAE,IAAA,kBAAW,EAAC,YAAY,EAAE,iBAAiB,CAAC;QACrD,MAAM,EAAE,wCAAgB;KACzB;CACkB,CAAC;AAEtB;;;GAGG;AACH,MAAa,8BAA+B,SAAQ,sBAA6B;IAC/E,YAAY,OAAoB,EAAE,UAAsB,EAAE,MAAwC;QAChG,KAAK,CAAC,OAAO,EAAE,UAAU,kCACpB,MAAM,KACT,KAAK,IACL,CAAC;IACL,CAAC;IAEK,qBAAqB;;YACzB,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;YAClD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;YAChE,OAAO,CAAC,UAAU,CAAC;QACrB,CAAC;KAAA;IAEK,gBAAgB;;YACpB,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;YAClD,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC1C,CAAC;KAAA;IAEK,iBAAiB;;YACrB,MAAM,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;YAC9C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;YAC5D,OAAO,CAAC,UAAU,CAAC;QACrB,CAAC;KAAA;IAEK,YAAY;;YAChB,MAAM,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;YAC9C,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACtC,CAAC;KAAA;IAED,IAAa,UAAU;QACrB,OAAO,qCAAqC,CAAC;IAC/C,CAAC;CACF;AAjCD,wEAiCC"}
@@ -1,93 +0,0 @@
1
- import { HTMLElementDriver } from '@atomic-testing/component-driver-html';
2
- import { ComponentDriver, IComponentDriverOption, Interactor, Optional, PartLocator } from '@atomic-testing/core';
3
- import { DataGridCellQuery } from './DataGridCellQuery';
4
- import { DataGridFooterDriver } from './DataGridFooterDriver';
5
- import { DataGridHeaderRowDriver } from './DataGridHeaderRowDriver';
6
- declare const parts: {
7
- headerRow: {
8
- locator: PartLocator;
9
- driver: typeof DataGridHeaderRowDriver;
10
- };
11
- loading: {
12
- locator: import("@atomic-testing/core").CssLocator;
13
- driver: typeof HTMLElementDriver;
14
- };
15
- skeletonOverlay: {
16
- locator: import("@atomic-testing/core").CssLocator;
17
- driver: typeof HTMLElementDriver;
18
- };
19
- footer: {
20
- locator: import("@atomic-testing/core").CssLocator;
21
- driver: typeof DataGridFooterDriver;
22
- };
23
- };
24
- /**
25
- * Driver for Material UI v8 DataGridPro component.
26
- * V8 DataGridPro component does not support data-testid, to use data-testid
27
- * to locate the component, you need to put the data-testid on the parent element of the grid
28
- * @see https://mui.com/x/react-data-grid/
29
- */
30
- export declare class DataGridProDriver extends ComponentDriver<typeof parts> {
31
- constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
32
- /**
33
- * Checks if the data grid is currently loading.
34
- * @returns A promise that resolves to a boolean indicating if the data grid is loading.
35
- */
36
- isLoading(): Promise<boolean>;
37
- /**
38
- * Waits for the data grid to exit the loading state.
39
- * @param timeoutMs The maximum time to wait for the load to complete, in milliseconds.
40
- */
41
- waitForLoad(timeoutMs?: number): Promise<void>;
42
- /**
43
- * The number of columns currently displayed in the data grid, note that data grid pro
44
- * uses virtualize rendering, therefore the column count heavily depends on the viewport size
45
- * @returns The number of columns currently displayed in the data grid
46
- */
47
- getColumnCount(): Promise<number>;
48
- /**
49
- * The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering
50
- * @returns The array of text of the header row
51
- */
52
- getHeaderText(): Promise<string[]>;
53
- /**
54
- * The number of rows currently displayed in the data grid, note that data grid pro
55
- * uses virtualize rendering, therefore the row count heavily depends on the viewport size
56
- * @returns The number of columns currently displayed in the data grid
57
- */
58
- getRowCount(): Promise<number>;
59
- /**
60
- * Return the row driver for the row at the specified index, if the row does not exist, return null
61
- * @param rowIndex
62
- * @returns
63
- */
64
- getRow(rowIndex: number): Promise<DataGridHeaderRowDriver | null>;
65
- /**
66
- * The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering
67
- * @param rowIndex The index of the row
68
- * @returns The array of text of the specified row
69
- */
70
- getRowText(rowIndex: number): Promise<string[]>;
71
- /**
72
- * Get the cell driver for the cell, if the cell does not exist, return null
73
- * The cell driver is default to HTMLElementDriver, you can specify a different driver class
74
- * @param query The query to locate the cell
75
- * @param driverClass Optional, the driver class to use for the cell, default to HTMLElementDriver
76
- * @returns
77
- */
78
- getCell<DriverT extends ComponentDriver>(query: DataGridCellQuery, driverClass?: typeof ComponentDriver): Promise<DriverT | null>;
79
- /**
80
- * Get the text content of the cell, if the cell does not exist, throw an error
81
- * @param query The query to locate the cell
82
- * @returns
83
- */
84
- getCellText(query: DataGridCellQuery): Promise<string>;
85
- isFooterVisible(): Promise<boolean>;
86
- isPreviousPageEnabled(): Promise<boolean>;
87
- gotoPreviousPage(): Promise<void>;
88
- isNextPageEnabled(): Promise<boolean>;
89
- gotoNextPage(): Promise<void>;
90
- getPaginationDescription(): Promise<Optional<string>>;
91
- get driverName(): string;
92
- }
93
- export {};
@@ -1,227 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __asyncValues = (this && this.__asyncValues) || function (o) {
12
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
13
- var m = o[Symbol.asyncIterator], i;
14
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
15
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
16
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
17
- };
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.DataGridProDriver = void 0;
20
- const component_driver_html_1 = require("@atomic-testing/component-driver-html");
21
- const core_1 = require("@atomic-testing/core");
22
- const DataGridFooterDriver_1 = require("./DataGridFooterDriver");
23
- const DataGridHeaderRowDriver_1 = require("./DataGridHeaderRowDriver");
24
- const parts = {
25
- headerRow: {
26
- locator: (0, core_1.byCssClass)('MuiDataGrid-columnHeaders').chain((0, core_1.byCssSelector)('[role=row]:first-of-type')),
27
- driver: DataGridHeaderRowDriver_1.DataGridHeaderRowDriver,
28
- },
29
- loading: {
30
- locator: (0, core_1.byRole)('progressbar'),
31
- driver: component_driver_html_1.HTMLElementDriver,
32
- },
33
- skeletonOverlay: {
34
- locator: (0, core_1.byCssClass)('MuiDataGrid-main--hasSkeletonLoadingOverlay'),
35
- driver: component_driver_html_1.HTMLElementDriver,
36
- },
37
- footer: {
38
- locator: (0, core_1.byCssClass)('MuiDataGrid-footerContainer'),
39
- driver: DataGridFooterDriver_1.DataGridFooterDriver,
40
- },
41
- };
42
- const dataRowLocator = (0, core_1.byCssSelector)('[role=row][data-rowindex]');
43
- /**
44
- * Driver for Material UI v8 DataGridPro component.
45
- * V8 DataGridPro component does not support data-testid, to use data-testid
46
- * to locate the component, you need to put the data-testid on the parent element of the grid
47
- * @see https://mui.com/x/react-data-grid/
48
- */
49
- class DataGridProDriver extends core_1.ComponentDriver {
50
- constructor(locator, interactor, option) {
51
- super(locator, interactor, Object.assign(Object.assign({}, option), { parts }));
52
- }
53
- /**
54
- * Checks if the data grid is currently loading.
55
- * @returns A promise that resolves to a boolean indicating if the data grid is loading.
56
- */
57
- isLoading() {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- const result = yield Promise.all([this.parts.skeletonOverlay.isVisible(), this.parts.loading.isVisible()]);
60
- return result.some(v => v);
61
- });
62
- }
63
- /**
64
- * Waits for the data grid to exit the loading state.
65
- * @param timeoutMs The maximum time to wait for the load to complete, in milliseconds.
66
- */
67
- waitForLoad() {
68
- return __awaiter(this, arguments, void 0, function* (timeoutMs = 10000) {
69
- yield this.parts.headerRow.waitUntilComponentState();
70
- yield this.waitUntil({ probeFn: () => this.isLoading(), terminateCondition: false, timeoutMs });
71
- });
72
- }
73
- /**
74
- * The number of columns currently displayed in the data grid, note that data grid pro
75
- * uses virtualize rendering, therefore the column count heavily depends on the viewport size
76
- * @returns The number of columns currently displayed in the data grid
77
- */
78
- getColumnCount() {
79
- return __awaiter(this, void 0, void 0, function* () {
80
- return this.parts.headerRow.getColumnCount();
81
- });
82
- }
83
- /**
84
- * The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering
85
- * @returns The array of text of the header row
86
- */
87
- getHeaderText() {
88
- return __awaiter(this, void 0, void 0, function* () {
89
- return this.parts.headerRow.getRowText();
90
- });
91
- }
92
- /**
93
- * The number of rows currently displayed in the data grid, note that data grid pro
94
- * uses virtualize rendering, therefore the row count heavily depends on the viewport size
95
- * @returns The number of columns currently displayed in the data grid
96
- */
97
- getRowCount() {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- var _a, e_1, _b, _c;
100
- const gridRowLocator = core_1.locatorUtil.append(this.locator, dataRowLocator);
101
- let count = 0;
102
- try {
103
- for (var _d = true, _e = __asyncValues(core_1.listHelper.getListItemIterator(this, gridRowLocator, component_driver_html_1.HTMLElementDriver)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
104
- _c = _f.value;
105
- _d = false;
106
- const _ = _c;
107
- count++;
108
- }
109
- }
110
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
111
- finally {
112
- try {
113
- if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
114
- }
115
- finally { if (e_1) throw e_1.error; }
116
- }
117
- return count;
118
- });
119
- }
120
- /**
121
- * Return the row driver for the row at the specified index, if the row does not exist, return null
122
- * @param rowIndex
123
- * @returns
124
- */
125
- getRow(rowIndex) {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- const rowLocator = core_1.locatorUtil.append(this.locator, (0, core_1.byCssSelector)(`[role=row][data-rowindex="${rowIndex}"]`));
128
- const rowExists = yield this.interactor.exists(rowLocator);
129
- if (rowExists) {
130
- return new DataGridHeaderRowDriver_1.DataGridHeaderRowDriver(rowLocator, this.interactor, this.commutableOption);
131
- }
132
- return null;
133
- });
134
- }
135
- /**
136
- * The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering
137
- * @param rowIndex The index of the row
138
- * @returns The array of text of the specified row
139
- */
140
- getRowText(rowIndex) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- const row = yield this.getRow(rowIndex);
143
- if (row != null) {
144
- return row.getRowText();
145
- }
146
- throw new Error(`Row ${rowIndex} does not exist`);
147
- });
148
- }
149
- /**
150
- * Get the cell driver for the cell, if the cell does not exist, return null
151
- * The cell driver is default to HTMLElementDriver, you can specify a different driver class
152
- * @param query The query to locate the cell
153
- * @param driverClass Optional, the driver class to use for the cell, default to HTMLElementDriver
154
- * @returns
155
- */
156
- getCell(query_1) {
157
- return __awaiter(this, arguments, void 0, function* (query,
158
- // @ts-ignore
159
- driverClass = component_driver_html_1.HTMLElementDriver) {
160
- const rowDriver = yield this.getRow(query.rowIndex);
161
- if (rowDriver === null) {
162
- return null;
163
- }
164
- if ('columnIndex' in query) {
165
- return rowDriver.getCell(query.columnIndex, driverClass);
166
- }
167
- return rowDriver.getCell(query.columnField, driverClass);
168
- });
169
- }
170
- /**
171
- * Get the text content of the cell, if the cell does not exist, throw an error
172
- * @param query The query to locate the cell
173
- * @returns
174
- */
175
- getCellText(query) {
176
- return __awaiter(this, void 0, void 0, function* () {
177
- var _a;
178
- const cell = yield this.getCell(query);
179
- if (cell != null) {
180
- const text = yield cell.getText();
181
- return text;
182
- }
183
- //@ts-ignore
184
- throw new Error(`Cell at row:${query.rowIndex} column:${(_a = query.columnIndex) !== null && _a !== void 0 ? _a : query.columnField} does not exist`);
185
- });
186
- }
187
- //#region Footer
188
- isFooterVisible() {
189
- return this.parts.footer.isVisible();
190
- }
191
- isPreviousPageEnabled() {
192
- return __awaiter(this, void 0, void 0, function* () {
193
- yield this.enforcePartExistence('footer');
194
- return this.parts.footer.isPreviousPageEnabled();
195
- });
196
- }
197
- gotoPreviousPage() {
198
- return __awaiter(this, void 0, void 0, function* () {
199
- yield this.enforcePartExistence('footer');
200
- yield this.parts.footer.gotoPreviousPage();
201
- });
202
- }
203
- isNextPageEnabled() {
204
- return __awaiter(this, void 0, void 0, function* () {
205
- yield this.enforcePartExistence('footer');
206
- return this.parts.footer.isNextPageEnabled();
207
- });
208
- }
209
- gotoNextPage() {
210
- return __awaiter(this, void 0, void 0, function* () {
211
- yield this.enforcePartExistence('footer');
212
- yield this.parts.footer.gotoNextPage();
213
- });
214
- }
215
- getPaginationDescription() {
216
- return __awaiter(this, void 0, void 0, function* () {
217
- yield this.enforcePartExistence('footer');
218
- return this.parts.footer.getText();
219
- });
220
- }
221
- //#endregion Footer
222
- get driverName() {
223
- return 'MuiV8DataGridProDriver';
224
- }
225
- }
226
- exports.DataGridProDriver = DataGridProDriver;
227
- //# sourceMappingURL=DataGridProDriver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataGridProDriver.js","sourceRoot":"","sources":["../../../src/components/datagrid/DataGridProDriver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,iFAA0E;AAC1E,+CAY8B;AAG9B,iEAA8D;AAC9D,uEAAoE;AAEpE,MAAM,KAAK,GAAG;IACZ,SAAS,EAAE;QACT,OAAO,EAAE,IAAA,iBAAU,EAAC,2BAA2B,CAAC,CAAC,KAAK,CAAC,IAAA,oBAAa,EAAC,0BAA0B,CAAC,CAAC;QACjG,MAAM,EAAE,iDAAuB;KAChC;IACD,OAAO,EAAE;QACP,OAAO,EAAE,IAAA,aAAM,EAAC,aAAa,CAAC;QAC9B,MAAM,EAAE,yCAAiB;KAC1B;IACD,eAAe,EAAE;QACf,OAAO,EAAE,IAAA,iBAAU,EAAC,6CAA6C,CAAC;QAClE,MAAM,EAAE,yCAAiB;KAC1B;IACD,MAAM,EAAE;QACN,OAAO,EAAE,IAAA,iBAAU,EAAC,6BAA6B,CAAC;QAClD,MAAM,EAAE,2CAAoB;KAC7B;CACkB,CAAC;AAEtB,MAAM,cAAc,GAAG,IAAA,oBAAa,EAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAa,iBAAkB,SAAQ,sBAA6B;IAClE,YAAY,OAAoB,EAAE,UAAsB,EAAE,MAAwC;QAChG,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C5B,MAAM,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrC,CAAC;KAAA;IACD,mBAAmB;IAEnB,IAAa,UAAU;QACrB,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF;AAhKD,8CAgKC"}
@@ -1,23 +0,0 @@
1
- import { ComponentDriver, PartLocator } from '@atomic-testing/core';
2
- /**
3
- * Base class for data grid row
4
- */
5
- export declare abstract class DataGridRowDriverBase extends ComponentDriver {
6
- protected getCellCount(): Promise<number>;
7
- /**
8
- * Get the text of each visible cell in the row.
9
- * Caveat: Because of virtualization, the text of the cell may not be available until the cell is visible.
10
- * @returns A promise array of text of each visible cell in the row
11
- */
12
- getRowText(): Promise<string[]>;
13
- /**
14
- * Get the cell driver at the specified index or data field.
15
- * Caveat: Because of virtualization, the cell may not be available until the cell is visible.
16
- * @param cellIndexOrField number: column index, string: column field
17
- * @param driverClass The driver class of the cell. Default is HTMLElementDriver
18
- * @returns A promise of the cell driver, or null if the cell is not found
19
- */
20
- getCell<DriverT extends ComponentDriver>(cellIndexOrField: number | string, // number: column index, string: column field
21
- driverClass?: typeof ComponentDriver): Promise<DriverT | null>;
22
- protected abstract getCellLocator(): PartLocator;
23
- }
@@ -1,107 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __asyncValues = (this && this.__asyncValues) || function (o) {
12
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
13
- var m = o[Symbol.asyncIterator], i;
14
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
15
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
16
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
17
- };
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.DataGridRowDriverBase = void 0;
20
- const component_driver_html_1 = require("@atomic-testing/component-driver-html");
21
- const core_1 = require("@atomic-testing/core");
22
- // In MUI7, there is an extra div preceding the actual data cells. We need to skip it.
23
- const columnStartingIndex = 1;
24
- /**
25
- * Base class for data grid row
26
- */
27
- class DataGridRowDriverBase extends core_1.ComponentDriver {
28
- getCellCount() {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- var _a, e_1, _b, _c;
31
- let count = 0;
32
- try {
33
- for (var _d = true, _e = __asyncValues(core_1.listHelper.getListItemIterator(this, this.getCellLocator(), component_driver_html_1.HTMLElementDriver, columnStartingIndex)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
34
- _c = _f.value;
35
- _d = false;
36
- const _ = _c;
37
- count++;
38
- }
39
- }
40
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
41
- finally {
42
- try {
43
- if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
44
- }
45
- finally { if (e_1) throw e_1.error; }
46
- }
47
- return count;
48
- });
49
- }
50
- /**
51
- * Get the text of each visible cell in the row.
52
- * Caveat: Because of virtualization, the text of the cell may not be available until the cell is visible.
53
- * @returns A promise array of text of each visible cell in the row
54
- */
55
- getRowText() {
56
- return __awaiter(this, void 0, void 0, function* () {
57
- var _a, e_2, _b, _c;
58
- const textList = [];
59
- try {
60
- for (var _d = true, _e = __asyncValues(core_1.listHelper.getListItemIterator(this, this.getCellLocator(), component_driver_html_1.HTMLElementDriver, columnStartingIndex)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
61
- _c = _f.value;
62
- _d = false;
63
- const cell = _c;
64
- const text = yield cell.getText();
65
- textList.push(text.trim());
66
- }
67
- }
68
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
69
- finally {
70
- try {
71
- if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
72
- }
73
- finally { if (e_2) throw e_2.error; }
74
- }
75
- return textList;
76
- });
77
- }
78
- /**
79
- * Get the cell driver at the specified index or data field.
80
- * Caveat: Because of virtualization, the cell may not be available until the cell is visible.
81
- * @param cellIndexOrField number: column index, string: column field
82
- * @param driverClass The driver class of the cell. Default is HTMLElementDriver
83
- * @returns A promise of the cell driver, or null if the cell is not found
84
- */
85
- getCell(cellIndexOrField_1) {
86
- return __awaiter(this, arguments, void 0, function* (cellIndexOrField, // number: column index, string: column field
87
- // @ts-ignore
88
- driverClass = component_driver_html_1.HTMLElementDriver) {
89
- let cellLocator;
90
- if (typeof cellIndexOrField === 'number') {
91
- cellLocator = (0, core_1.byAttribute)('data-colindex', cellIndexOrField.toString());
92
- }
93
- else {
94
- cellLocator = (0, core_1.byAttribute)('data-field', cellIndexOrField);
95
- }
96
- const locator = core_1.locatorUtil.append(this.locator, cellLocator);
97
- const cellExists = yield this.interactor.exists(locator);
98
- if (cellExists) {
99
- // @ts-ignore
100
- return new driverClass(locator, this.interactor, this.commutableOption);
101
- }
102
- return null;
103
- });
104
- }
105
- }
106
- exports.DataGridRowDriverBase = DataGridRowDriverBase;
107
- //# sourceMappingURL=DataGridRowDriverBase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataGridRowDriverBase.js","sourceRoot":"","sources":["../../../src/components/datagrid/DataGridRowDriverBase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,iFAA0E;AAC1E,+CAA0G;AAE1G,sFAAsF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kBAAW,EAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;YAC5D,CAAC;YACD,MAAM,OAAO,GAAG,kBAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAC9D,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACzD,IAAI,UAAU,EAAE,CAAC;gBACf,aAAa;gBACb,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC1E,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CAGF;AA9DD,sDA8DC"}
@@ -1,4 +0,0 @@
1
- export * from './DataGridCellQuery';
2
- export { DataGridDataRowDriver } from './DataGridDataRowDriver';
3
- export { DataGridHeaderRowDriver } from './DataGridHeaderRowDriver';
4
- export { DataGridProDriver } from './DataGridProDriver';
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.DataGridProDriver = exports.DataGridHeaderRowDriver = exports.DataGridDataRowDriver = void 0;
18
- __exportStar(require("./DataGridCellQuery"), exports);
19
- var DataGridDataRowDriver_1 = require("./DataGridDataRowDriver");
20
- Object.defineProperty(exports, "DataGridDataRowDriver", { enumerable: true, get: function () { return DataGridDataRowDriver_1.DataGridDataRowDriver; } });
21
- var DataGridHeaderRowDriver_1 = require("./DataGridHeaderRowDriver");
22
- Object.defineProperty(exports, "DataGridHeaderRowDriver", { enumerable: true, get: function () { return DataGridHeaderRowDriver_1.DataGridHeaderRowDriver; } });
23
- var DataGridProDriver_1 = require("./DataGridProDriver");
24
- Object.defineProperty(exports, "DataGridProDriver", { enumerable: true, get: function () { return DataGridProDriver_1.DataGridProDriver; } });
25
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/datagrid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA"}