@sap-ux/ui5-test-writer 1.16.2 → 1.17.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/dist/types.d.ts +13 -3
- package/dist/utils/actionUtils.d.ts +1 -0
- package/dist/utils/actionUtils.js +5 -3
- package/dist/utils/listReportUtils.d.ts +9 -19
- package/dist/utils/listReportUtils.js +31 -38
- package/dist/utils/tableUtils.js +7 -4
- package/package.json +1 -1
- package/templates/v4/1.148/integration/ListReportJourney.js +71 -36
- package/templates/v4/1.148/integration/ListReportJourney.ts +70 -37
- package/templates/v4/1.152/integration/ListReportJourney.js +165 -34
- package/templates/v4/1.152/integration/ListReportJourney.ts +167 -39
- package/templates/v4/1.84/integration/ListReportJourney.js +21 -25
- package/templates/v4/1.84/integration/ListReportJourney.ts +19 -25
- package/templates/v4/latest/integration/ListReportJourney.js +177 -38
- package/templates/v4/latest/integration/ListReportJourney.ts +178 -42
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
sap.ui.define([
|
|
19
19
|
"sap/ui/test/opaQunit",
|
|
20
|
-
"./pages/JourneyRunner"
|
|
21
|
-
|
|
22
|
-
], function (opaTest, runner<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>, coreLibrary<% } %>) {
|
|
20
|
+
"./pages/JourneyRunner"
|
|
21
|
+
], function (opaTest, runner) {
|
|
23
22
|
"use strict";
|
|
24
23
|
|
|
25
24
|
function journey() {
|
|
@@ -76,38 +75,35 @@ sap.ui.define([
|
|
|
76
75
|
// Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
|
|
77
76
|
// });
|
|
78
77
|
|
|
79
|
-
<%_ if (
|
|
80
|
-
opaTest("Check
|
|
81
|
-
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
82
|
-
<%_ if (createButton.visible && !isALP) { _%>
|
|
78
|
+
<%_ if (createButton.visible && !isALP) { -%>
|
|
79
|
+
opaTest("Check the create button", function (Given, When, Then) {
|
|
83
80
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
84
81
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
<%_ } -%>
|
|
85
|
+
<%_ if (deleteButton.visible) { -%>
|
|
86
|
+
opaTest("Check the delete button", function (Given, When, Then) {
|
|
87
87
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
|
|
88
88
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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) {
|
|
92
95
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
93
96
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
94
|
-
<%_ } _%>
|
|
95
|
-
<%_ }); -%>
|
|
96
|
-
<%_ } -%>
|
|
97
|
-
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
98
|
-
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
99
|
-
<%_ } -%>
|
|
100
97
|
});
|
|
98
|
+
|
|
101
99
|
<%_ } -%>
|
|
102
|
-
<%_
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
107
|
-
<%_ }); -%>
|
|
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) %>);
|
|
108
104
|
});
|
|
109
|
-
<%_ } -%>
|
|
110
105
|
|
|
106
|
+
<%_ } -%>
|
|
111
107
|
<%_ if (startLR) { -%>
|
|
112
108
|
opaTest("Navigate to ObjectPage", function (Given, When, Then) {
|
|
113
109
|
// Note: this test will fail if the ListReport page doesn't show any data
|
|
@@ -25,9 +25,6 @@ const usesFilterFieldIdentifier =
|
|
|
25
25
|
import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
|
|
26
26
|
<% } -%>
|
|
27
27
|
import runner from "./pages/JourneyRunner";
|
|
28
|
-
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
29
|
-
import { SortOrder } from "sap/ui/core/library";
|
|
30
|
-
<%_ } -%>
|
|
31
28
|
|
|
32
29
|
function journey() {
|
|
33
30
|
QUnit.module("<%- name%>ListReport journey");
|
|
@@ -83,38 +80,35 @@ function journey() {
|
|
|
83
80
|
// Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
|
|
84
81
|
// });
|
|
85
82
|
|
|
86
|
-
<%_ if (
|
|
87
|
-
opaTest("Check
|
|
88
|
-
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
89
|
-
<%_ if (createButton.visible && !isALP) { _%>
|
|
83
|
+
<%_ if (createButton.visible && !isALP) { -%>
|
|
84
|
+
opaTest("Check the create button", function (_Given: Given, _When: When, Then: Then) {
|
|
90
85
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
91
86
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
<%_ } -%>
|
|
90
|
+
<%_ if (deleteButton.visible) { -%>
|
|
91
|
+
opaTest("Check the delete button", function (_Given: Given, _When: When, Then: Then) {
|
|
94
92
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
|
|
95
93
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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) {
|
|
99
100
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
100
101
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
101
|
-
<%_ } _%>
|
|
102
|
-
<%_ }); -%>
|
|
103
|
-
<%_ } -%>
|
|
104
|
-
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
105
|
-
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
106
|
-
<%_ } -%>
|
|
107
102
|
});
|
|
103
|
+
|
|
108
104
|
<%_ } -%>
|
|
109
|
-
<%_
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
|
|
114
|
-
<%_ }); -%>
|
|
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) %>);
|
|
115
109
|
});
|
|
116
|
-
<%_ } -%>
|
|
117
110
|
|
|
111
|
+
<%_ } -%>
|
|
118
112
|
<%_ if (startLR) { -%>
|
|
119
113
|
opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
|
|
120
114
|
// Note: this test will fail if the ListReport page doesn't show any data
|
|
@@ -77,34 +77,134 @@ sap.ui.define([
|
|
|
77
77
|
// });
|
|
78
78
|
|
|
79
79
|
<%_ if (tabs && tabs.length > 0) { -%>
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
<%_ tabs.forEach(function(tab) { -%>
|
|
81
|
+
/// View "<%- tab.key %>" ///
|
|
82
|
+
<%_ if (tab.createButton.visible && !isALP) { -%>
|
|
83
|
+
opaTest(<%- JSON.stringify("Check the create button in view " + tab.key) %>, function (Given, When, Then) {
|
|
82
84
|
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
83
|
-
<%_ if (tab.createButton.visible && !isALP) { _%>
|
|
84
85
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
|
|
85
|
-
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").
|
|
86
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteCreate();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
<%_ } -%>
|
|
90
|
+
<%_ if (tab.deleteButton.visible) { -%>
|
|
91
|
+
opaTest(<%- JSON.stringify("Check the delete button in view " + tab.key) %>, function (Given, When, Then) {
|
|
92
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
93
|
+
<%_ const deleteIsSelectionGated = tab.deleteButton.enabled === true; _%>
|
|
94
|
+
<%_ if (deleteIsSelectionGated) { _%>
|
|
95
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true, enabled: false });
|
|
96
|
+
<%_ if (!hideFilterBar) { _%>
|
|
97
|
+
// Populate the table and select a row so Delete becomes enabled.
|
|
98
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
86
99
|
<%_ } _%>
|
|
87
|
-
|
|
88
|
-
|
|
100
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
101
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true, enabled: true });
|
|
102
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteDelete();
|
|
103
|
+
// Deselect the row so the following actions start with an empty selection.
|
|
104
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
105
|
+
<%_ } else { _%>
|
|
89
106
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
|
|
107
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteDelete();
|
|
90
108
|
<%_ } _%>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
<%_ } -%>
|
|
112
|
+
<%_ tab.toolBarActions.forEach(function(item) { -%>
|
|
113
|
+
<%_ if (item.visible) { -%>
|
|
114
|
+
opaTest(<%- JSON.stringify("Check the " + item.label + " action in view " + tab.key) %>, function (Given, When, Then) {
|
|
115
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
116
|
+
<%_ if (item.menuActions) { _%>
|
|
117
|
+
<%_ if (item.splitButton) { _%>
|
|
118
|
+
// "<%- 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:
|
|
119
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
|
|
120
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
|
|
121
|
+
<%_ } else { _%>
|
|
122
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
|
|
123
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
|
|
124
|
+
<%_ item.menuActions.forEach(function(menuAction) { _%>
|
|
125
|
+
<%_ if (menuAction.visible) { _%>
|
|
126
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckMenuAction("<%- menuAction.label %>");
|
|
127
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteMenuAction("<%- menuAction.label %>");
|
|
128
|
+
<%_ } _%>
|
|
129
|
+
<%_ }); _%>
|
|
130
|
+
<%_ } _%>
|
|
131
|
+
<%_ } else if (item.custom) { _%>
|
|
94
132
|
<%_ if (item.labelUnresolved) { _%>
|
|
95
133
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
96
134
|
<%_ } _%>
|
|
97
|
-
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
|
|
98
135
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { visible: true });
|
|
136
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
|
|
99
137
|
<%_ } else { _%>
|
|
100
|
-
|
|
138
|
+
<%_ const hasParamDialog = item.parameterDialogFields && item.parameterDialogFields.length > 0; _%>
|
|
101
139
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: <%- item.enabled === true %> });
|
|
140
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
|
|
141
|
+
<%_ if (item.selectionEnables && !item.isCritical && !hasParamDialog) { _%>
|
|
142
|
+
<%_ if (!hideFilterBar) { _%>
|
|
143
|
+
// Populate the table and select a row so the action becomes enabled.
|
|
144
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
102
145
|
<%_ } _%>
|
|
146
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
147
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: true });
|
|
148
|
+
// Deselect the row so the following actions start with an empty selection.
|
|
149
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
150
|
+
<%_ } else if ((item.isCritical || hasParamDialog) && item.enabled === 'dynamic') { _%>
|
|
151
|
+
// "<%- 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' %>.
|
|
152
|
+
<%_ if (!hideFilterBar) { _%>
|
|
153
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
103
154
|
<%_ } _%>
|
|
155
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
156
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
|
|
157
|
+
<%_ if (hasParamDialog) { _%>
|
|
158
|
+
<%_ item.parameterDialogFields.forEach(function(parameter) { _%>
|
|
159
|
+
// Then.onThe<%- startLR%>Generated.onActionDialog().iCheckActionParameterDialogField({ property: "<%- parameter %>" }, undefined, { visible: true });
|
|
104
160
|
<%_ }); _%>
|
|
105
|
-
|
|
106
|
-
|
|
161
|
+
// When.onThe<%- startLR%>Generated.onActionDialog().iCancel();
|
|
162
|
+
<%_ } else { _%>
|
|
163
|
+
// Then.onThe<%- startLR%>Generated.onMessageDialog().iCheckState();
|
|
164
|
+
// When.onThe<%- startLR%>Generated.onMessageDialog().iCancel();
|
|
165
|
+
<%_ } _%>
|
|
166
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
167
|
+
<%_ } else if (item.isCritical || hasParamDialog) { _%>
|
|
168
|
+
<%_ if (!hideFilterBar) { _%>
|
|
169
|
+
// Populate the table so the action below has a row to select.
|
|
170
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
171
|
+
<%_ } _%>
|
|
172
|
+
<%_ if (item.enabled !== true) { _%>
|
|
173
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
174
|
+
<%_ } _%>
|
|
175
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
|
|
176
|
+
<%_ if (hasParamDialog) { _%>
|
|
177
|
+
<%_ item.parameterDialogFields.forEach(function(parameter) { _%>
|
|
178
|
+
Then.onThe<%- startLR%>Generated.onActionDialog().iCheckActionParameterDialogField({ property: "<%- parameter %>" }, undefined, { visible: true });
|
|
179
|
+
<%_ }); _%>
|
|
180
|
+
When.onThe<%- startLR%>Generated.onActionDialog().iCancel();
|
|
181
|
+
<%_ } else { _%>
|
|
182
|
+
Then.onThe<%- startLR%>Generated.onMessageDialog().iCheckState();
|
|
183
|
+
When.onThe<%- startLR%>Generated.onMessageDialog().iCancel();
|
|
184
|
+
<%_ } _%>
|
|
185
|
+
<%_ if (item.enabled !== true) { _%>
|
|
186
|
+
// Deselect the row so the following actions start with an empty selection.
|
|
187
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iSelectRows(0);
|
|
188
|
+
<%_ } _%>
|
|
107
189
|
<%_ } _%>
|
|
190
|
+
<%_ } _%>
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
<%_ } -%>
|
|
194
|
+
<%_ }); -%>
|
|
195
|
+
<%_ if (Object.keys(tab.tableColumns).length > 0) { -%>
|
|
196
|
+
opaTest(<%- JSON.stringify("Check table columns in view " + tab.key) %>, function (Given, When, Then) {
|
|
197
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
198
|
+
Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
<%_ } -%>
|
|
202
|
+
opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (Given, When, Then) {
|
|
203
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
204
|
+
<%_ if (!hideFilterBar) { -%>
|
|
205
|
+
// Populate the table so the row check has data.
|
|
206
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
207
|
+
<%_ } -%>
|
|
108
208
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
|
|
109
209
|
<%_ if (tab.contactCardColumns.length > 0) { _%>
|
|
110
210
|
// Reveal popin details so low-priority (e.g. contact-card) columns become clickable
|
|
@@ -115,27 +215,42 @@ sap.ui.define([
|
|
|
115
215
|
When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iClickLink(0, "<%- column.property %>");
|
|
116
216
|
Then.onThe<%- startLR %>Generated.onDialog().iCheckContactDialog({ controlType: "sap.ui.mdc.link.Panel" });
|
|
117
217
|
<%_ }); _%>
|
|
118
|
-
<%_ }); -%>
|
|
119
218
|
});
|
|
219
|
+
|
|
220
|
+
<%_ }); -%>
|
|
120
221
|
<%_ } else { -%>
|
|
121
|
-
<%_ if (
|
|
122
|
-
opaTest("Check
|
|
123
|
-
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
124
|
-
<%_ if (createButton.visible && !isALP) { _%>
|
|
222
|
+
<%_ if (createButton.visible && !isALP) { -%>
|
|
223
|
+
opaTest("Check the create button", function (Given, When, Then) {
|
|
125
224
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
126
|
-
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).
|
|
225
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteCreate();
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
<%_ } -%>
|
|
229
|
+
<%_ if (deleteButton.visible) { -%>
|
|
230
|
+
opaTest("Check the delete button", function (Given, When, Then) {
|
|
231
|
+
<%_ /* deleteButton.enabled = Capabilities Deletable (not current UI state); when deletable, Delete is selection-gated: disabled with no selection, enabled once a row is selected. */ -%>
|
|
232
|
+
<%_ const deleteIsSelectionGated = deleteButton.enabled === true; _%>
|
|
233
|
+
<%_ if (deleteIsSelectionGated) { _%>
|
|
234
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true, enabled: false });
|
|
235
|
+
<%_ if (!hideFilterBar) { _%>
|
|
236
|
+
// Populate the table and select a row so Delete becomes enabled.
|
|
237
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
127
238
|
<%_ } _%>
|
|
128
|
-
|
|
129
|
-
|
|
239
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
240
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true, enabled: true });
|
|
241
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteDelete();
|
|
242
|
+
// Deselect the row so the following actions start with an empty selection.
|
|
243
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
244
|
+
<%_ } else { _%>
|
|
130
245
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
|
|
246
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteDelete();
|
|
131
247
|
<%_ } _%>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<%_ if (item.visible) { _%>
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
<%_ } -%>
|
|
251
|
+
<%_ (toolBarActions || []).forEach(function(item) { -%>
|
|
252
|
+
<%_ if (item.visible) { -%>
|
|
253
|
+
opaTest(<%- JSON.stringify("Check the " + item.label + " action") %>, function (Given, When, Then) {
|
|
139
254
|
<%_ if (item.menuActions) { _%>
|
|
140
255
|
<%_ if (item.splitButton) { _%>
|
|
141
256
|
// "<%- 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:
|
|
@@ -155,13 +270,22 @@ sap.ui.define([
|
|
|
155
270
|
<%_ if (item.labelUnresolved) { _%>
|
|
156
271
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
157
272
|
<%_ } _%>
|
|
158
|
-
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
159
273
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { visible: true });
|
|
274
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
160
275
|
<%_ } else { _%>
|
|
161
|
-
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
|
|
162
|
-
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: <%- item.enabled === true %> });
|
|
163
276
|
<%_ const hasParamDialog = item.parameterDialogFields && item.parameterDialogFields.length > 0; _%>
|
|
164
|
-
|
|
277
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: <%- item.enabled === true %> });
|
|
278
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
|
|
279
|
+
<%_ if (item.selectionEnables && !item.isCritical && !hasParamDialog) { _%>
|
|
280
|
+
<%_ if (!hideFilterBar) { _%>
|
|
281
|
+
// Populate the table and select a row so the action becomes enabled.
|
|
282
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
283
|
+
<%_ } _%>
|
|
284
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
285
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: true });
|
|
286
|
+
// Deselect the row so the following actions start with an empty selection.
|
|
287
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
288
|
+
<%_ } else if ((item.isCritical || hasParamDialog) && item.enabled === 'dynamic') { _%>
|
|
165
289
|
// "<%- 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' %>.
|
|
166
290
|
<%_ if (!hideFilterBar) { _%>
|
|
167
291
|
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
@@ -179,6 +303,10 @@ sap.ui.define([
|
|
|
179
303
|
<%_ } _%>
|
|
180
304
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
181
305
|
<%_ } else if (item.isCritical || hasParamDialog) { _%>
|
|
306
|
+
<%_ if (!hideFilterBar) { _%>
|
|
307
|
+
// Populate the table so the action below has a row to select.
|
|
308
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
309
|
+
<%_ } _%>
|
|
182
310
|
<%_ if (item.enabled !== true) { _%>
|
|
183
311
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
184
312
|
<%_ } _%>
|
|
@@ -198,21 +326,32 @@ sap.ui.define([
|
|
|
198
326
|
<%_ } _%>
|
|
199
327
|
<%_ } _%>
|
|
200
328
|
<%_ } _%>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
<%_ } -%>
|
|
332
|
+
<%_ }); -%>
|
|
333
|
+
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
334
|
+
opaTest("Check table columns", function (Given, When, Then) {
|
|
205
335
|
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
206
|
-
<%_ } -%>
|
|
207
336
|
});
|
|
337
|
+
|
|
208
338
|
<%_ } -%>
|
|
209
339
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
210
340
|
opaTest("Check text annotation for columns", function (Given, When, Then) {
|
|
211
341
|
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
342
|
+
<%_ if (column.columnProperty) { _%>
|
|
343
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.Ascending);
|
|
344
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
345
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.None);
|
|
346
|
+
<%_ } _%>
|
|
347
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
212
348
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
|
|
213
349
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
350
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.None);
|
|
351
|
+
<%_ } _%>
|
|
214
352
|
<%_ }); -%>
|
|
215
353
|
});
|
|
354
|
+
|
|
216
355
|
<%_ } -%>
|
|
217
356
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0 && columnPersonalizationSupported !== false) { -%>
|
|
218
357
|
opaTest("Check columns in adaptation dialog", function (Given, When, Then) {
|
|
@@ -223,8 +362,8 @@ sap.ui.define([
|
|
|
223
362
|
<%_ }); -%>
|
|
224
363
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iConfirmColumnAdaptation();
|
|
225
364
|
});
|
|
226
|
-
<%_ } -%>
|
|
227
365
|
|
|
366
|
+
<%_ } -%>
|
|
228
367
|
<%_ if (contactCardColumns.length > 0) { -%>
|
|
229
368
|
opaTest("Check contact card links", function (Given, When, Then) {
|
|
230
369
|
// Reveal popin details so low-priority (e.g. contact-card) columns become clickable
|