@sap_oss/wdio-qmate-service 2.17.0 → 2.18.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.
- package/lib/reuse/modules/ui5/table.d.ts +168 -10
- package/lib/reuse/modules/ui5/table.js +393 -23
- package/lib/reuse/modules/ui5/table.js.map +1 -1
- package/lib/reuse/modules/ui5/types/ui5.types.d.ts +20 -10
- package/lib/reuse/modules/util/browser.d.ts +1 -1
- package/lib/reuse/modules/util/browser.js +2 -2
- package/lib/reuse/modules/util/browser.js.map +1 -1
- package/package.json +1 -1
- package/test/reuse/ui5/table/deselectAllRows.spec.js +71 -0
- package/test/reuse/ui5/table/deselectRowByIndex.spec.js +86 -0
- package/test/reuse/ui5/table/getSelectorForRowByIndex.spec.js +78 -0
- package/test/reuse/ui5/table/getSelectorsForRowsByValues.spec.js +152 -0
- package/test/reuse/ui5/table/getTotalNumberOfRows.spec.js +55 -10
- package/test/reuse/ui5/table/getTotalNumberOfRowsByValues.spec.js +115 -0
- package/test/reuse/ui5/table/openItemByIndex.spec.js +84 -0
- package/test/reuse/ui5/table/openItemByValues.spec.js +102 -0
- package/test/reuse/ui5/table/selectAllRows.spec.js +64 -0
- package/test/reuse/ui5/table/selectRowByIndex.spec.js +89 -0
- package/test/reuse/ui5/table/test.table.conf.js +11 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Ui5Selector } from "./types/ui5.types";
|
|
1
2
|
/**
|
|
2
3
|
* @class table
|
|
3
4
|
* @memberof ui5
|
|
@@ -5,12 +6,15 @@
|
|
|
5
6
|
export declare class Table {
|
|
6
7
|
private vlf;
|
|
7
8
|
private ErrorHandler;
|
|
9
|
+
private static readonly SMART_TABLE_METADATA;
|
|
10
|
+
private static readonly TABLE_METADATA;
|
|
11
|
+
private static readonly COLUMN_LIST_ITEM_METADATA;
|
|
8
12
|
/**
|
|
9
13
|
* @function sortColumnAscending
|
|
10
14
|
* @memberOf ui5.table
|
|
11
15
|
* @description Sorts the given column "Ascending".
|
|
12
16
|
* @param {String} columnName - The name of the column to sort.
|
|
13
|
-
* @param {
|
|
17
|
+
* @param {Ui5Selector} tableSelector - The selector describing the table element (in case there are more then one).
|
|
14
18
|
* @example await ui5.table.sortColumnAscending("Supplier");
|
|
15
19
|
* @example const glAccountItemsTable = {
|
|
16
20
|
* "elementProperties": {
|
|
@@ -21,13 +25,13 @@ export declare class Table {
|
|
|
21
25
|
* };
|
|
22
26
|
* await ui5.table.sortColumnAscending("Amount", glAccountItemsTable);
|
|
23
27
|
*/
|
|
24
|
-
sortColumnAscending(columnName: string, tableSelector:
|
|
28
|
+
sortColumnAscending(columnName: string, tableSelector: Ui5Selector): Promise<void>;
|
|
25
29
|
/**
|
|
26
30
|
* @function sortColumnDescending
|
|
27
31
|
* @memberOf ui5.table
|
|
28
32
|
* @description Sorts the given column "Descending".
|
|
29
33
|
* @param {String} columnName The name of the column to sort.
|
|
30
|
-
* @param {
|
|
34
|
+
* @param {Ui5Selector} tableSelector - The selector describing the table element (in case there are more then one).
|
|
31
35
|
* @example await ui5.table.sortColumnDescending("Supplier");
|
|
32
36
|
* @example const glAccountItemsTable = {
|
|
33
37
|
* "elementProperties": {
|
|
@@ -38,12 +42,12 @@ export declare class Table {
|
|
|
38
42
|
* };
|
|
39
43
|
* await ui5.table.sortColumnDescending("Amount", glAccountItemsTable);
|
|
40
44
|
*/
|
|
41
|
-
sortColumnDescending(columnName: string, tableSelector:
|
|
45
|
+
sortColumnDescending(columnName: string, tableSelector: Ui5Selector): Promise<void>;
|
|
42
46
|
/**
|
|
43
47
|
* @function clickSettingsButton
|
|
44
48
|
* @memberOf ui5.table
|
|
45
49
|
* @description Opens the user Settings.
|
|
46
|
-
* @param {
|
|
50
|
+
* @param {Ui5Selector} tableSelector - The selector describing the table element (in case there are more then one).
|
|
47
51
|
* @example await ui5.table.clickSettingsButton();
|
|
48
52
|
* @example const glAccountItemsTable = {
|
|
49
53
|
* "elementProperties": {
|
|
@@ -54,12 +58,12 @@ export declare class Table {
|
|
|
54
58
|
* };
|
|
55
59
|
* await ui5.table.clickSettingsButton(glAccountItemsTable);
|
|
56
60
|
*/
|
|
57
|
-
clickSettingsButton(tableSelector:
|
|
61
|
+
clickSettingsButton(tableSelector: Ui5Selector): Promise<void>;
|
|
58
62
|
/**
|
|
59
63
|
* @function getTotalNumberOfRows
|
|
60
64
|
* @memberOf ui5.table
|
|
61
65
|
* @description Returns the total number of rows in the table.
|
|
62
|
-
* @param {
|
|
66
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
63
67
|
* @returns {Number} The total number of rows in the table.
|
|
64
68
|
* @example const selector = {
|
|
65
69
|
* elementProperties: {
|
|
@@ -70,11 +74,165 @@ export declare class Table {
|
|
|
70
74
|
* };
|
|
71
75
|
* const numberOfRows = await ui5.table.getTotalNumberOfRows(selector);
|
|
72
76
|
*/
|
|
73
|
-
getTotalNumberOfRows(
|
|
74
|
-
|
|
77
|
+
getTotalNumberOfRows(tableSelectorOrId: Ui5Selector | string): Promise<number>;
|
|
78
|
+
/**
|
|
79
|
+
* @function getTotalNumberOfRowsByValues
|
|
80
|
+
* @memberOf ui5.table
|
|
81
|
+
* @description Returns the total number of rows in the table that match the given values.
|
|
82
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
83
|
+
* @param {String | Array<String>} values - The value(s) to match in the table rows.
|
|
84
|
+
* @param {Number} [index=0] - The index of the matching row to consider.
|
|
85
|
+
* @returns {Number} The total number of matching rows in the table.
|
|
86
|
+
* @example const selector = {
|
|
87
|
+
* elementProperties: {
|
|
88
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
89
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
90
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
91
|
+
* }
|
|
92
|
+
* };
|
|
93
|
+
* const numberOfRows = await ui5.table.getTotalNumberOfRowsByValues(selector, ["value1", "value2"]);
|
|
94
|
+
* const numberOfRows = await ui5.table.getTotalNumberOfRowsByValues(selector, "value");
|
|
95
|
+
**/
|
|
96
|
+
getTotalNumberOfRowsByValues(tableSelectorOrId: Ui5Selector | string, values: string | Array<string>): Promise<number>;
|
|
97
|
+
/**
|
|
98
|
+
* @function selectRowByIndex
|
|
99
|
+
* @memberOf ui5.table
|
|
100
|
+
* @description Selects a row in the table by its index.
|
|
101
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
102
|
+
* @param {Number} index - The index of the row to select.
|
|
103
|
+
* @example await ui5.table.selectRowByIndex("application-ReportingTask-run-component---ReportList--ReportingTable", 0);
|
|
104
|
+
* @example const selector = {
|
|
105
|
+
* elementProperties: {
|
|
106
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
107
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
108
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
109
|
+
* }
|
|
110
|
+
* };
|
|
111
|
+
* await ui5.table.selectRowByIndex(selector, 0);
|
|
112
|
+
*/
|
|
113
|
+
selectRowByIndex(tableSelectorOrId: Ui5Selector | string, index: number): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* @function openItemByIndex
|
|
116
|
+
* @memberOf ui5.table
|
|
117
|
+
* @description Opens the item in the table by its index.
|
|
118
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
119
|
+
* @param {Number} index - The index of the item to open.
|
|
120
|
+
* @example const selector = {
|
|
121
|
+
* elementProperties: {
|
|
122
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
123
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
124
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
125
|
+
* }
|
|
126
|
+
* };
|
|
127
|
+
* await ui5.table.openItemByIndex(selector, 0);
|
|
128
|
+
* @example const id = "application-ReportingTask-run-component---ReportList--ReportingTable";
|
|
129
|
+
* await ui5.table.openItemByIndex(id, 0);
|
|
130
|
+
*/
|
|
131
|
+
openItemByIndex(tableSelectorOrId: Ui5Selector | string, index: number): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* @function openItemByValues
|
|
134
|
+
* @memberOf ui5.table
|
|
135
|
+
* @description Opens the item in the table containing the given values. If multiple items match, it opens the index-th item.
|
|
136
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
137
|
+
* @param {String | Array<String>} values - The value(s) to match in the table rows.
|
|
138
|
+
* @param {Number} [index=0] - The index of the matching row to consider.
|
|
139
|
+
* @example const selector = {
|
|
140
|
+
* elementProperties: {
|
|
141
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
142
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
143
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
144
|
+
* }
|
|
145
|
+
* };
|
|
146
|
+
* await ui5.table.openItemByValues(selector, ["value1", "value2"]);
|
|
147
|
+
* @example const id = "application-ReportingTask-run-component---ReportList--ReportingTable";
|
|
148
|
+
* await ui5.table.openItemByValues(id, "value");
|
|
149
|
+
*/
|
|
150
|
+
openItemByValues(tableSelectorOrId: Ui5Selector | string, values: string | Array<string>, index?: number): Promise<undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* @function getSelectorsForRowsByValues
|
|
153
|
+
* @memberOf ui5.table
|
|
154
|
+
* @description Gets the selectors of rows in the table that contain the given values. If multiple values are provided, it only returns the selectors of rows that contain all of them.
|
|
155
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
156
|
+
* @param {string} values - The value(s) to match in the table rows.
|
|
157
|
+
* @example const id = "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
158
|
+
* await ui5.table.getSelectorsForRowsByValues(id, "February");
|
|
159
|
+
* @example const selector = {
|
|
160
|
+
* elementProperties: {
|
|
161
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
162
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
163
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
164
|
+
* }
|
|
165
|
+
* };
|
|
166
|
+
* await ui5.table.getSelectorsForRowsByValues(selector, ["January", "2022"]);
|
|
167
|
+
*/
|
|
168
|
+
getSelectorsForRowsByValues(tableSelector: Ui5Selector | string, values: string | Array<string>): Promise<Array<Ui5Selector>>;
|
|
169
|
+
/**
|
|
170
|
+
* @function getSelectorForRowByIndex
|
|
171
|
+
* @memberOf ui5.table
|
|
172
|
+
* @description Gets the selector of a row in the table by its index.
|
|
173
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
174
|
+
* @param {Number} index - The index of the item to open.
|
|
175
|
+
* @example const selector = {
|
|
176
|
+
* elementProperties: {
|
|
177
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
178
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
179
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
180
|
+
* }
|
|
181
|
+
* };
|
|
182
|
+
* const rowSelector = await ui5.table.getSelectorForRowByIndex(selector, 0);
|
|
183
|
+
* @example id = "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
184
|
+
* const rowSelector = await ui5.table.getSelectorForRowByIndex(id, 0);
|
|
185
|
+
*/
|
|
186
|
+
getSelectorForRowByIndex(tableSelector: any, index: number): Promise<Ui5Selector>;
|
|
187
|
+
/**
|
|
188
|
+
* @function selectAllRows
|
|
189
|
+
* @memberOf ui5.table
|
|
190
|
+
* @description Selects all rows in the table.
|
|
191
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
192
|
+
* @example await ui5.table.selectAllRows("application-ReportingTask-run-component---ReportList--ReportingTable");
|
|
193
|
+
* await ui5.table.selectAllRows(selector);
|
|
194
|
+
*/
|
|
195
|
+
selectAllRows(tableSelectorOrId: Ui5Selector | string): Promise<void>;
|
|
196
|
+
/**
|
|
197
|
+
* @function deselectRowByIndex
|
|
198
|
+
* @memberOf ui5.table
|
|
199
|
+
* @description Deselects a row in the table by its index.
|
|
200
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
201
|
+
* @example const selector = {
|
|
202
|
+
* elementProperties: {
|
|
203
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
204
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
205
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
206
|
+
* }
|
|
207
|
+
* };
|
|
208
|
+
* await ui5.table.deselectRowByIndex(selector, 0);
|
|
209
|
+
* @example const id = "application-ReportingTask-run-component---ReportList--ReportingTable";
|
|
210
|
+
* await ui5.table.deselectRowByIndex(id, 0);
|
|
211
|
+
*/
|
|
212
|
+
deselectRowByIndex(tableSelectorOrId: Ui5Selector | string, index: number): Promise<void>;
|
|
213
|
+
/**
|
|
214
|
+
* @function deselectAllRows
|
|
215
|
+
* @memberOf ui5.table
|
|
216
|
+
* @description Deselects all rows in the table.
|
|
217
|
+
* @param {Ui5Selector | String} tableSelectorOrId - The selector or ID describing the table (sap.m.Table | sap.ui.comp.smarttable.SmartTable).
|
|
218
|
+
* @example await ui5.table.deselectAllRows("application-ReportingTask-run-component---ReportList--ReportingTable");
|
|
219
|
+
* @example const selector = {
|
|
220
|
+
* elementProperties: {
|
|
221
|
+
* viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
222
|
+
* metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
223
|
+
* id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
224
|
+
* }
|
|
225
|
+
* };
|
|
226
|
+
* await ui5.table.deselectAllRows(selector);
|
|
227
|
+
*/
|
|
228
|
+
deselectAllRows(tableSelectorOrId: Ui5Selector | string): Promise<void>;
|
|
229
|
+
private _resolveTableSelectorOrId;
|
|
230
|
+
private _getId;
|
|
231
|
+
private _getTableMetadata;
|
|
232
|
+
private _constructTableSelector;
|
|
75
233
|
private _extractRowCountFromTitle;
|
|
76
234
|
private _clickColumn;
|
|
77
|
-
private
|
|
235
|
+
private _getSortValueGridTable;
|
|
78
236
|
private _getSortIndicatorValue;
|
|
79
237
|
private _prepareAncestorSelector;
|
|
80
238
|
}
|