@sap-ux/ui5-test-writer 1.16.3 → 1.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.
@@ -20,19 +20,11 @@ import type { Given, When, Then } from "./types/OpaJourneyTypes.gen";
20
20
  <%_
21
21
  const usesFilterFieldIdentifier =
22
22
  !hideFilterBar && filterBarItems && filterBarItems.some(function(item) { return item.custom; });
23
- const toolBarHasMenu = (toolBarActions || []).some(function(item) { return item.visible && item.menuActions && !item.splitButton; });
24
- const toolBarHasDialogAction = (toolBarActions || []).some(function(item) {
25
- return item.visible && !item.menuActions && !item.custom && item.enabled !== 'dynamic' &&
26
- (item.isCritical || (item.parameterDialogFields && item.parameterDialogFields.length > 0));
27
- });
28
23
  -%>
29
24
  <% if (usesFilterFieldIdentifier) { -%>
30
25
  import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
31
26
  <% } -%>
32
27
  import runner from "./pages/JourneyRunner";
33
- <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
34
- import { SortOrder } from "sap/ui/core/library";
35
- <%_ } -%>
36
28
 
37
29
  function journey() {
38
30
  QUnit.module("<%- name%>ListReport journey");
@@ -89,34 +81,150 @@ function journey() {
89
81
  // });
90
82
 
91
83
  <%_ if (tabs && tabs.length > 0) { -%>
92
- opaTest("Check table columns and actions per tab", function (_Given: Given, When: When, Then: Then) {
93
- <%_ tabs.forEach(function(tab) { _%>
84
+ <%_ tabs.forEach(function(tab) { -%>
85
+ /// View "<%- tab.key %>" ///
86
+ <%_ if (tab.createButton.visible && !isALP) { -%>
87
+ opaTest(<%- JSON.stringify("Check the create button in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
94
88
  When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
95
- <%_ if (tab.createButton.visible && !isALP) { _%>
96
89
  Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
97
- // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
90
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteCreate();
91
+ });
92
+
93
+ <%_ } -%>
94
+ <%_ if (tab.deleteButton.visible) { -%>
95
+ opaTest(<%- JSON.stringify("Check the delete button in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
96
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
97
+ <%_ const deleteIsSelectionGated = tab.deleteButton.enabled === true; _%>
98
+ <%_ if (deleteIsSelectionGated) { _%>
99
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true, enabled: false });
100
+ <%_ if (!hideFilterBar) { _%>
101
+ // Populate the table and select a row so Delete becomes enabled.
102
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
98
103
  <%_ } _%>
99
- <%_ if (tab.deleteButton.visible) { _%>
100
- // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
104
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
105
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true, enabled: true });
106
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteDelete();
107
+ // Deselect the row so the following actions start with an empty selection.
108
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
109
+ <%_ } else { _%>
101
110
  Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
111
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteDelete();
102
112
  <%_ } _%>
103
- <%_ tab.toolBarActions.forEach(function(item) { _%>
104
- <%_ if (item.visible) { _%>
105
- <%_ if (item.custom) { _%>
113
+ });
114
+
115
+ <%_ } -%>
116
+ <%_ tab.toolBarActions.forEach(function(item) { -%>
117
+ <%_ if (item.visible) { -%>
118
+ opaTest(<%- JSON.stringify("Check the " + item.label + " action in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
119
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
120
+ <%_ if (item.menuActions) { _%>
121
+ <%_ if (item.splitButton) { _%>
122
+ // "<%- item.label %>" is a split menu button (has a default action); its drop-down cannot be opened via the test API, so its menu items are not checked. Pressing it triggers the default action:
123
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
124
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
125
+ <%_ } else { _%>
126
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
127
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
128
+ <%_ item.menuActions.forEach(function(menuAction) { _%>
129
+ <%_ if (menuAction.visible) { _%>
130
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckMenuAction("<%- menuAction.label %>");
131
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteMenuAction("<%- menuAction.label %>");
132
+ <%_ } _%>
133
+ <%_ }); _%>
134
+ <%_ } _%>
135
+ <%_ } else if (item.custom) { _%>
106
136
  <%_ if (item.labelUnresolved) { _%>
107
137
  // TODO: label is an unresolved i18n key; replace with the rendered action text
108
138
  <%_ } _%>
109
- // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
110
139
  Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { visible: true });
140
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
111
141
  <%_ } else { _%>
112
- // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
142
+ <%_ const hasParamDialog = item.parameterDialogFields && item.parameterDialogFields.length > 0; _%>
113
143
  Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: <%- item.enabled === true %> });
144
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
145
+ <%_ if (item.selectionEnables && !item.isCritical && !hasParamDialog) { _%>
146
+ <%_ if (!hideFilterBar) { _%>
147
+ // Populate the table and select a row so the action becomes enabled.
148
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
149
+ <%_ } _%>
150
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
151
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: true });
152
+ // Deselect the row so the following actions start with an empty selection.
153
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
154
+ <%_ } else if ((item.isCritical || hasParamDialog) && item.enabled === 'dynamic') { _%>
155
+ // "<%- item.label %>" is conditionally enabled (Core.OperationAvailable path); it may be disabled for the selected row. Uncomment and select a row that enables it to test the <%- hasParamDialog ? 'action parameter dialog' : 'confirmation dialog' %>.
156
+ <%_ if (!hideFilterBar) { _%>
157
+ // When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
114
158
  <%_ } _%>
159
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
160
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
161
+ <%_ if (hasParamDialog) { _%>
162
+ <%_ item.parameterDialogFields.forEach(function(parameter) { _%>
163
+ // Then.onThe<%- startLR%>Generated.onActionDialog().iCheckActionParameterDialogField({ property: "<%- parameter %>" }, undefined, { visible: true });
164
+ <%_ }); _%>
165
+ // When.onThe<%- startLR%>Generated.onActionDialog().iCancel();
166
+ <%_ } else { _%>
167
+ // Then.onThe<%- startLR%>Generated.onMessageDialog().iCheckState();
168
+ // When.onThe<%- startLR%>Generated.onMessageDialog().iCancel();
169
+ <%_ } _%>
170
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
171
+ <%_ } else if (item.isCritical || hasParamDialog) { _%>
172
+ <%_ if (!hideFilterBar) { _%>
173
+ // Populate the table so the action below has a row to select.
174
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
115
175
  <%_ } _%>
176
+ <%_ if (item.enabled !== true) { _%>
177
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
178
+ <%_ } _%>
179
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
180
+ <%_ if (hasParamDialog) { _%>
181
+ <%_ item.parameterDialogFields.forEach(function(parameter) { _%>
182
+ Then.onThe<%- startLR%>Generated.onActionDialog().iCheckActionParameterDialogField({ property: "<%- parameter %>" }, undefined, { visible: true });
116
183
  <%_ }); _%>
117
- <%_ if (Object.keys(tab.tableColumns).length > 0) { _%>
184
+ When.onThe<%- startLR%>Generated.onActionDialog().iCancel();
185
+ <%_ } else { _%>
186
+ Then.onThe<%- startLR%>Generated.onMessageDialog().iCheckState();
187
+ When.onThe<%- startLR%>Generated.onMessageDialog().iCancel();
188
+ <%_ } _%>
189
+ <%_ if (item.enabled !== true) { _%>
190
+ // Deselect the row so the following actions start with an empty selection.
191
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
192
+ <%_ } _%>
193
+ <%_ } _%>
194
+ <%_ } _%>
195
+ });
196
+
197
+ <%_ } -%>
198
+ <%_ }); -%>
199
+ <%_ if (Object.keys(tab.tableColumns).length > 0) { -%>
200
+ opaTest(<%- JSON.stringify("Check table columns in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
201
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
118
202
  Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
203
+ });
204
+
205
+ <%_ } -%>
206
+ <%_ if (tab.textAnnotationColumns && tab.textAnnotationColumns.length > 0) { -%>
207
+ <%_ if (tab.columnPersonalizationSupported !== false) { -%>
208
+ opaTest(<%- JSON.stringify("Check the presence of the text columns for columns with a Text annotation in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
209
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
210
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iOpenColumnAdaptation();
211
+ <%_ tab.textAnnotationColumns.forEach(function(column) { _%>
212
+ <%_ if (!column.skipTextPropertyTest) { _%>
213
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
214
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
119
215
  <%_ } _%>
216
+ <%_ }); -%>
217
+ When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iConfirmColumnAdaptation();
218
+ });
219
+
220
+ <%_ } -%>
221
+ <%_ } -%>
222
+ opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
223
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
224
+ <%_ if (!hideFilterBar) { -%>
225
+ // Populate the table so the row check has data.
226
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
227
+ <%_ } -%>
120
228
  Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
121
229
  <%_ if (tab.contactCardColumns.length > 0) { _%>
122
230
  // Reveal popin details so low-priority (e.g. contact-card) columns become clickable; no-op on grid/analytical tables.
@@ -127,26 +235,44 @@ function journey() {
127
235
  When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iClickLink(0, "<%- column.property %>");
128
236
  Then.onThe<%- startLR %>Generated.onDialog().iCheckContactDialog({ controlType: "sap.ui.mdc.link.Panel" });
129
237
  <%_ }); _%>
130
- <%_ }); -%>
131
238
  });
239
+
240
+ <%_ }); -%>
132
241
  <%_ } else { -%>
133
- <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
134
- opaTest("Check table columns and actions", function (_Given: Given, <% if (toolBarHasMenu || toolBarHasDialogAction) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
135
- <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
136
- <%_ if (createButton.visible && !isALP) { _%>
242
+ <%_ if (createButton.visible && !isALP) { -%>
243
+ opaTest("Check the create button", function (_Given: Given, _When: When, Then: Then) {
137
244
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
138
245
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
246
+ });
247
+
248
+ <%_ } -%>
249
+ <%_ if (deleteButton.visible) { -%>
250
+ <%_ /* deleteButton.enabled = Capabilities Deletable (not current UI state); when deletable, Delete is selection-gated: disabled with no selection, enabled once a row is selected. */ -%>
251
+ <%_ const deleteIsSelectionGated = deleteButton.enabled === true; -%>
252
+ opaTest("Check the delete button", function (_Given: Given, <% if (deleteIsSelectionGated) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
253
+ <%_ if (deleteIsSelectionGated) { _%>
254
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true, enabled: false });
255
+ <%_ if (!hideFilterBar) { _%>
256
+ // Populate the table and select a row so Delete becomes enabled.
257
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
139
258
  <%_ } _%>
140
- <%_ if (deleteButton.visible) { _%>
141
- // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
259
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
260
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true, enabled: true });
261
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteDelete();
262
+ // Deselect the row so the following actions start with an empty selection.
263
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
264
+ <%_ } else { _%>
142
265
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
266
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteDelete();
143
267
  <%_ } _%>
144
- <%_ if (!hideFilterBar && toolBarHasDialogAction) { _%>
145
- // Populate the table so the actions below have a row to select.
146
- When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
147
- <%_ } _%>
148
- <%_ toolBarActions.forEach(function(item) { _%>
149
- <%_ if (item.visible) { _%>
268
+ });
269
+
270
+ <%_ } -%>
271
+ <%_ (toolBarActions || []).forEach(function(item) { -%>
272
+ <%_ if (item.visible) { -%>
273
+ <%_ const hasParamDialog = item.parameterDialogFields && item.parameterDialogFields.length > 0; _%>
274
+ <%_ const usesWhen = (item.menuActions && !item.splitButton) || (!item.menuActions && !item.custom && ((item.selectionEnables && !item.isCritical && !hasParamDialog) || ((item.isCritical || hasParamDialog) && item.enabled !== 'dynamic'))); _%>
275
+ opaTest(<%- JSON.stringify("Check the " + item.label + " action") %>, function (_Given: Given, <% if (usesWhen) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
150
276
  <%_ if (item.menuActions) { _%>
151
277
  <%_ if (item.splitButton) { _%>
152
278
  // "<%- item.label %>" is a split menu button (has a default action); its drop-down cannot be opened via the test API, so its menu items are not checked. Pressing it triggers the default action:
@@ -171,8 +297,16 @@ function journey() {
171
297
  <%_ } else { _%>
172
298
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
173
299
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: <%- item.enabled === true %> });
174
- <%_ const hasParamDialog = item.parameterDialogFields && item.parameterDialogFields.length > 0; _%>
175
- <%_ if ((item.isCritical || hasParamDialog) && item.enabled === 'dynamic') { _%>
300
+ <%_ if (item.selectionEnables && !item.isCritical && !hasParamDialog) { _%>
301
+ <%_ if (!hideFilterBar) { _%>
302
+ // Populate the table and select a row so the action becomes enabled.
303
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
304
+ <%_ } _%>
305
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
306
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: true });
307
+ // Deselect the row so the following actions start with an empty selection.
308
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
309
+ <%_ } else if ((item.isCritical || hasParamDialog) && item.enabled === 'dynamic') { _%>
176
310
  // "<%- item.label %>" is conditionally enabled (Core.OperationAvailable path); it may be disabled for the selected row. Uncomment and select a row that enables it to test the <%- hasParamDialog ? 'action parameter dialog' : 'confirmation dialog' %>.
177
311
  <%_ if (!hideFilterBar) { _%>
178
312
  // When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
@@ -190,6 +324,10 @@ function journey() {
190
324
  <%_ } _%>
191
325
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
192
326
  <%_ } else if (item.isCritical || hasParamDialog) { _%>
327
+ <%_ if (!hideFilterBar) { _%>
328
+ // Populate the table so the action below has a row to select.
329
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
330
+ <%_ } _%>
193
331
  <%_ if (item.enabled !== true) { _%>
194
332
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
195
333
  <%_ } _%>
@@ -209,33 +347,29 @@ function journey() {
209
347
  <%_ } _%>
210
348
  <%_ } _%>
211
349
  <%_ } _%>
212
- <%_ } _%>
213
- <%_ }); -%>
214
- <%_ } -%>
215
- <%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
216
- Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
217
- <%_ } -%>
218
350
  });
351
+
219
352
  <%_ } -%>
220
- <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
221
- opaTest("Check text annotation for columns", function (_Given: Given, When: When, Then: Then) {
222
- <%_ textAnnotationColumns.forEach(function(column) { _%>
223
- When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending);
224
- Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
225
- <%_ }); -%>
353
+ <%_ }); -%>
354
+ <%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
355
+ opaTest("Check table columns", function (_Given: Given, _When: When, Then: Then) {
356
+ Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
226
357
  });
358
+
227
359
  <%_ } -%>
228
360
  <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0 && columnPersonalizationSupported !== false) { -%>
229
- opaTest("Check columns in adaptation dialog", function (_Given: Given, When: When, Then: Then) {
361
+ opaTest("Check the presence of the text columns for columns with a Text annotation", function (_Given: Given, When: When, Then: Then) {
230
362
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iOpenColumnAdaptation();
231
363
  <%_ textAnnotationColumns.forEach(function(column) { _%>
364
+ <%_ if (!column.skipTextPropertyTest) { _%>
232
365
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
233
366
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
367
+ <%_ } _%>
234
368
  <%_ }); -%>
235
369
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iConfirmColumnAdaptation();
236
370
  });
237
- <%_ } -%>
238
371
 
372
+ <%_ } -%>
239
373
  <%_ if (contactCardColumns.length > 0) { -%>
240
374
  opaTest("Check contact card links", function (_Given: Given, When: When, Then: Then) {
241
375
  // Reveal popin details so low-priority (e.g. contact-card) columns become clickable; no-op on grid/analytical tables.
@@ -75,30 +75,35 @@ sap.ui.define([
75
75
  // Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
76
76
  // });
77
77
 
78
- <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
79
- opaTest("Check table columns and actions", function (Given, When, Then) {
80
- <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
81
- <%_ if (createButton.visible && !isALP) { _%>
78
+ <%_ if (createButton.visible && !isALP) { -%>
79
+ opaTest("Check the create button", function (Given, When, Then) {
82
80
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
83
81
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
84
- <%_ } _%>
85
- <%_ if (deleteButton.visible) { _%>
82
+ });
83
+
84
+ <%_ } -%>
85
+ <%_ if (deleteButton.visible) { -%>
86
+ opaTest("Check the delete button", function (Given, When, Then) {
86
87
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
87
88
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
88
- <%_ } _%>
89
- <%_ toolBarActions.forEach(function(item) { _%>
90
- <%_ if (item.visible) { _%>
89
+ });
90
+
91
+ <%_ } -%>
92
+ <%_ (toolBarActions || []).forEach(function(item) { -%>
93
+ <%_ if (item.visible) { -%>
94
+ opaTest(<%- JSON.stringify("Check the " + item.label + " action") %>, function (Given, When, Then) {
91
95
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
92
96
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
93
- <%_ } _%>
94
- <%_ }); -%>
95
- <%_ } -%>
96
- <%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
97
- Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
98
- <%_ } -%>
99
97
  });
98
+
100
99
  <%_ } -%>
100
+ <%_ }); -%>
101
+ <%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
102
+ opaTest("Check table columns", function (Given, When, Then) {
103
+ Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
104
+ });
101
105
 
106
+ <%_ } -%>
102
107
  <%_ if (startLR) { -%>
103
108
  opaTest("Navigate to ObjectPage", function (Given, When, Then) {
104
109
  // Note: this test will fail if the ListReport page doesn't show any data
@@ -80,30 +80,35 @@ function journey() {
80
80
  // Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
81
81
  // });
82
82
 
83
- <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
84
- opaTest("Check table columns and actions", function (_Given: Given, _When: When, Then: Then) {
85
- <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
86
- <%_ if (createButton.visible && !isALP) { _%>
83
+ <%_ if (createButton.visible && !isALP) { -%>
84
+ opaTest("Check the create button", function (_Given: Given, _When: When, Then: Then) {
87
85
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
88
86
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
89
- <%_ } _%>
90
- <%_ if (deleteButton.visible) { _%>
87
+ });
88
+
89
+ <%_ } -%>
90
+ <%_ if (deleteButton.visible) { -%>
91
+ opaTest("Check the delete button", function (_Given: Given, _When: When, Then: Then) {
91
92
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
92
93
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
93
- <%_ } _%>
94
- <%_ toolBarActions.forEach(function(item) { _%>
95
- <%_ if (item.visible) { _%>
94
+ });
95
+
96
+ <%_ } -%>
97
+ <%_ (toolBarActions || []).forEach(function(item) { -%>
98
+ <%_ if (item.visible) { -%>
99
+ opaTest(<%- JSON.stringify("Check the " + item.label + " action") %>, function (_Given: Given, _When: When, Then: Then) {
96
100
  // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
97
101
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
98
- <%_ } _%>
99
- <%_ }); -%>
100
- <%_ } -%>
101
- <%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
102
- Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
103
- <%_ } -%>
104
102
  });
103
+
105
104
  <%_ } -%>
105
+ <%_ }); -%>
106
+ <%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
107
+ opaTest("Check table columns", function (_Given: Given, _When: When, Then: Then) {
108
+ Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
109
+ });
106
110
 
111
+ <%_ } -%>
107
112
  <%_ if (startLR) { -%>
108
113
  opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
109
114
  // Note: this test will fail if the ListReport page doesn't show any data