@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
package/dist/types.d.ts
CHANGED
|
@@ -133,12 +133,16 @@ export type ContactCardField = {
|
|
|
133
133
|
property: string;
|
|
134
134
|
};
|
|
135
135
|
/**
|
|
136
|
-
* A table column whose bound property carries
|
|
137
|
-
*
|
|
138
|
-
*
|
|
136
|
+
* A table column whose bound property carries a `Common.Text` annotation. `textProperty` is the
|
|
137
|
+
* sortable text target (always present); `columnProperty` is the column's own property, omitted when
|
|
138
|
+
* `UI.TextArrangement` is `TextOnly` (only the text is sortable). When several columns share one text
|
|
139
|
+
* target, each emits its own `columnProperty` sort test but only the first emits the text-property
|
|
140
|
+
* test; the rest set `skipTextPropertyTest`.
|
|
139
141
|
*/
|
|
140
142
|
export type TextAnnotationColumn = {
|
|
143
|
+
columnProperty?: string;
|
|
141
144
|
textProperty: string;
|
|
145
|
+
skipTextPropertyTest?: boolean;
|
|
142
146
|
};
|
|
143
147
|
export type BodySubSectionFeatureData = {
|
|
144
148
|
id: string;
|
|
@@ -268,6 +272,12 @@ export interface ActionButtonState {
|
|
|
268
272
|
* For example: "_it/__OperationControl/deductDiscount"
|
|
269
273
|
*/
|
|
270
274
|
dynamicPath?: string;
|
|
275
|
+
/**
|
|
276
|
+
* Set when the action has no `Core.OperationAvailable` annotation and is bound to a single
|
|
277
|
+
* instance: it is disabled with no selection and becomes enabled once a row is selected. Unlike
|
|
278
|
+
* `'dynamic'`, this flip is deterministic, so the generated test can assert both states.
|
|
279
|
+
*/
|
|
280
|
+
selectionEnables?: boolean;
|
|
271
281
|
/**
|
|
272
282
|
* The invocation grouping type if specified (e.g., "Isolated", "ChangeSet").
|
|
273
283
|
*/
|
|
@@ -57,6 +57,7 @@ export declare function findOperationAvailableAnnotation(metadata: ConvertedMeta
|
|
|
57
57
|
export declare function analyzeOperationAvailability(operationAvailable: OperationAvailableWithPaths | undefined, requiresSelection?: boolean): {
|
|
58
58
|
enabled: boolean | 'dynamic';
|
|
59
59
|
dynamicPath?: string;
|
|
60
|
+
selectionEnables?: boolean;
|
|
60
61
|
};
|
|
61
62
|
/**
|
|
62
63
|
* Extracts the enum member value from an annotation.
|
|
@@ -94,7 +94,7 @@ export function findOperationAvailableAnnotation(metadata, actionMethodName) {
|
|
|
94
94
|
*/
|
|
95
95
|
export function analyzeOperationAvailability(operationAvailable, requiresSelection) {
|
|
96
96
|
if (operationAvailable === undefined) {
|
|
97
|
-
return { enabled: !requiresSelection };
|
|
97
|
+
return { enabled: !requiresSelection, selectionEnables: requiresSelection === true };
|
|
98
98
|
}
|
|
99
99
|
if (typeof operationAvailable === 'boolean') {
|
|
100
100
|
return { enabled: operationAvailable };
|
|
@@ -144,7 +144,7 @@ export function buildActionButtonState(item, metadata, criticalActions) {
|
|
|
144
144
|
const actionTarget = item.ActionTarget;
|
|
145
145
|
const isBound = actionTarget?.isBound === true;
|
|
146
146
|
const requiresSelection = isBound && actionTarget?.parameters?.[0]?.isCollection !== true;
|
|
147
|
-
const { enabled, dynamicPath } = analyzeOperationAvailability(operationAvailable, requiresSelection);
|
|
147
|
+
const { enabled, dynamicPath, selectionEnables } = analyzeOperationAvailability(operationAvailable, requiresSelection);
|
|
148
148
|
return {
|
|
149
149
|
label: item.Label || '',
|
|
150
150
|
action: actionMethod,
|
|
@@ -153,6 +153,7 @@ export function buildActionButtonState(item, metadata, criticalActions) {
|
|
|
153
153
|
visible: true,
|
|
154
154
|
enabled,
|
|
155
155
|
dynamicPath,
|
|
156
|
+
selectionEnables,
|
|
156
157
|
invocationGrouping: item.InvocationGrouping ? extractEnumMemberValue(item.InvocationGrouping) : undefined,
|
|
157
158
|
isCritical: criticalActions?.has(actionMethod) ?? false,
|
|
158
159
|
parameterDialogFields: collectActionParameterNames(actionTarget)
|
|
@@ -184,7 +185,7 @@ export function buildActionStateFromSpecModelKey(aggregationKey, label, converte
|
|
|
184
185
|
const isBound = actionDefinition?.isBound === true;
|
|
185
186
|
const requiresSelection = isBound && actionDefinition?.parameters?.[0]?.isCollection !== true;
|
|
186
187
|
const operationAvailable = findOperationAvailableAnnotation(convertedMetadata, actionMethod);
|
|
187
|
-
const { enabled, dynamicPath } = analyzeOperationAvailability(operationAvailable, requiresSelection);
|
|
188
|
+
const { enabled, dynamicPath, selectionEnables } = analyzeOperationAvailability(operationAvailable, requiresSelection);
|
|
188
189
|
return {
|
|
189
190
|
label: label ?? '',
|
|
190
191
|
action: actionMethod,
|
|
@@ -193,6 +194,7 @@ export function buildActionStateFromSpecModelKey(aggregationKey, label, converte
|
|
|
193
194
|
visible: true,
|
|
194
195
|
enabled,
|
|
195
196
|
dynamicPath,
|
|
197
|
+
selectionEnables,
|
|
196
198
|
isCritical: criticalActions?.has(actionMethod) ?? false,
|
|
197
199
|
parameterDialogFields: collectActionParameterNames(actionDefinition)
|
|
198
200
|
};
|
|
@@ -208,26 +208,16 @@ export declare function getPropertyLabelFromMetadata(convertedMetadata: Converte
|
|
|
208
208
|
*/
|
|
209
209
|
export declare function isHiddenFilter(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
|
|
210
210
|
/**
|
|
211
|
-
* Returns true if the property
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
* @param
|
|
216
|
-
* @param
|
|
217
|
-
* @
|
|
218
|
-
|
|
219
|
-
export declare function hasTextArrangement(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
|
|
220
|
-
/**
|
|
221
|
-
* Returns true if the property carries a `@com.sap.vocabularies.UI.v1.Hidden` annotation.
|
|
222
|
-
* A hidden property is not exposed as a sortable column in the sort dialog, so it cannot be
|
|
223
|
-
* used as a sort target.
|
|
224
|
-
*
|
|
225
|
-
* @param convertedMetadata - already-converted OData metadata (metadata merged with local annotations)
|
|
226
|
-
* @param entitySetName - name of the entity set that owns the property (undefined → false)
|
|
227
|
-
* @param propertyName - name of the property to inspect
|
|
228
|
-
* @returns true if the property is hidden
|
|
211
|
+
* Returns true if the property's `UI.TextArrangement` is `TextOnly`, checking both the nested
|
|
212
|
+
* (`Common.Text`) and sibling (property-level) locations. Under `TextOnly` the code property is not
|
|
213
|
+
* sortable, so its sort test must be skipped.
|
|
214
|
+
*
|
|
215
|
+
* @param convertedMetadata - converted OData metadata (metadata merged with local annotations)
|
|
216
|
+
* @param entitySetName - entity set owning the property (undefined → false)
|
|
217
|
+
* @param propertyName - property to inspect
|
|
218
|
+
* @returns true if the text arrangement is TextOnly
|
|
229
219
|
*/
|
|
230
|
-
export declare function
|
|
220
|
+
export declare function isTextOnlyArrangement(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
|
|
231
221
|
/**
|
|
232
222
|
* Checks the state of action buttons defined in UI.LineItem annotations for a given entity set.
|
|
233
223
|
*
|
|
@@ -157,15 +157,23 @@ export function getListReportFeatures(listReportPage, log, metadata, manifest, r
|
|
|
157
157
|
// `@UI.HiddenFilter` properties cannot be added via the adaptation dialog; skip the check when metadata is missing.
|
|
158
158
|
.filter((key) => !convertedMetadata || !isHiddenFilter(convertedMetadata, listReportPage.entitySet, key))
|
|
159
159
|
: undefined;
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
// (sort target) property is not hidden — a hidden property is not a sortable column.
|
|
160
|
+
// A maintained text annotation emits a sort test for the text target property (no TextArrangement
|
|
161
|
+
// required). The code column is also sorted, except under TextOnly where it is not sortable.
|
|
163
162
|
const meta = convertedMetadata;
|
|
163
|
+
const seenTextProperties = new Set();
|
|
164
164
|
const textAnnotationColumns = meta
|
|
165
|
-
? extractTextAnnotationColumnsFromNode(listReportPage.model.root)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
.
|
|
165
|
+
? extractTextAnnotationColumnsFromNode(listReportPage.model.root).map((candidate) => {
|
|
166
|
+
// Dedupe the text-property sort test per text target; each code column keeps its own.
|
|
167
|
+
const skipTextPropertyTest = seenTextProperties.has(candidate.textProperty);
|
|
168
|
+
seenTextProperties.add(candidate.textProperty);
|
|
169
|
+
return {
|
|
170
|
+
columnProperty: isTextOnlyArrangement(meta, listReportPage.entitySet, candidate.columnProperty)
|
|
171
|
+
? undefined
|
|
172
|
+
: candidate.columnProperty,
|
|
173
|
+
textProperty: candidate.textProperty,
|
|
174
|
+
skipTextPropertyTest
|
|
175
|
+
};
|
|
176
|
+
})
|
|
169
177
|
: [];
|
|
170
178
|
return {
|
|
171
179
|
name: listReportPage.name,
|
|
@@ -288,6 +296,7 @@ export function getListReportTabs(listReportPage, convertedMetadata, manifest, r
|
|
|
288
296
|
}
|
|
289
297
|
const viewNodes = resolveViewTableNodes(listReportPage.model.root);
|
|
290
298
|
const nodeByKey = new Map(viewNodes.map((entry) => [entry.key, entry.node]));
|
|
299
|
+
const criticalActions = collectCriticalActionNames(convertedMetadata);
|
|
291
300
|
const tabs = [];
|
|
292
301
|
views.forEach((view, index) => {
|
|
293
302
|
// Match the spec-model view node by key; fall back to model order (both lists exclude custom tabs).
|
|
@@ -301,7 +310,7 @@ export function getListReportTabs(listReportPage, convertedMetadata, manifest, r
|
|
|
301
310
|
let deleteButton = buildButtonState();
|
|
302
311
|
if (convertedMetadata && entitySet) {
|
|
303
312
|
const actionNames = getToolBarActionItems(getToolBarActionsFromTableNode(tableNode));
|
|
304
|
-
toolBarActions = safeCheckActionButtonStates(convertedMetadata, entitySet, actionNames, log);
|
|
313
|
+
toolBarActions = safeCheckActionButtonStates(convertedMetadata, entitySet, actionNames, log, criticalActions);
|
|
305
314
|
const buttonVisibility = safeCheckButtonVisibilityFromMetadata(convertedMetadata, entitySet, log);
|
|
306
315
|
createButton = buildButtonState(buttonVisibility?.create);
|
|
307
316
|
deleteButton = buildButtonState(buttonVisibility?.delete);
|
|
@@ -567,43 +576,27 @@ export function isHiddenFilter(convertedMetadata, entitySetName, propertyName) {
|
|
|
567
576
|
return property?.annotations?.UI?.HiddenFilter?.valueOf() === true;
|
|
568
577
|
}
|
|
569
578
|
/**
|
|
570
|
-
* Returns true if the property
|
|
571
|
-
*
|
|
579
|
+
* Returns true if the property's `UI.TextArrangement` is `TextOnly`, checking both the nested
|
|
580
|
+
* (`Common.Text`) and sibling (property-level) locations. Under `TextOnly` the code property is not
|
|
581
|
+
* sortable, so its sort test must be skipped.
|
|
572
582
|
*
|
|
573
|
-
* @param convertedMetadata -
|
|
574
|
-
* @param entitySetName -
|
|
575
|
-
* @param propertyName -
|
|
576
|
-
* @returns true if the
|
|
577
|
-
*/
|
|
578
|
-
export function hasTextArrangement(convertedMetadata, entitySetName, propertyName) {
|
|
579
|
-
if (!entitySetName) {
|
|
580
|
-
return false;
|
|
581
|
-
}
|
|
582
|
-
const entitySet = convertedMetadata.entitySets.find((es) => es.name === entitySetName);
|
|
583
|
-
const property = entitySet?.entityType?.entityProperties?.find((p) => p.name === propertyName);
|
|
584
|
-
// TextArrangement is a nested annotation on the Common.Text term (see vocabularies-types Common.Text).
|
|
585
|
-
return property?.annotations?.Common?.Text?.annotations?.UI?.TextArrangement !== undefined;
|
|
586
|
-
}
|
|
587
|
-
/**
|
|
588
|
-
* Returns true if the property carries a `@com.sap.vocabularies.UI.v1.Hidden` annotation.
|
|
589
|
-
* A hidden property is not exposed as a sortable column in the sort dialog, so it cannot be
|
|
590
|
-
* used as a sort target.
|
|
591
|
-
*
|
|
592
|
-
* @param convertedMetadata - already-converted OData metadata (metadata merged with local annotations)
|
|
593
|
-
* @param entitySetName - name of the entity set that owns the property (undefined → false)
|
|
594
|
-
* @param propertyName - name of the property to inspect
|
|
595
|
-
* @returns true if the property is hidden
|
|
583
|
+
* @param convertedMetadata - converted OData metadata (metadata merged with local annotations)
|
|
584
|
+
* @param entitySetName - entity set owning the property (undefined → false)
|
|
585
|
+
* @param propertyName - property to inspect
|
|
586
|
+
* @returns true if the text arrangement is TextOnly
|
|
596
587
|
*/
|
|
597
|
-
export function
|
|
588
|
+
export function isTextOnlyArrangement(convertedMetadata, entitySetName, propertyName) {
|
|
598
589
|
if (!entitySetName) {
|
|
599
590
|
return false;
|
|
600
591
|
}
|
|
601
592
|
const entitySet = convertedMetadata.entitySets.find((es) => es.name === entitySetName);
|
|
602
593
|
const property = entitySet?.entityType?.entityProperties?.find((p) => p.name === propertyName);
|
|
603
|
-
// The
|
|
604
|
-
//
|
|
605
|
-
|
|
606
|
-
|
|
594
|
+
// The converter also populates TextArrangement as a property-level sibling of Common.Text, a
|
|
595
|
+
// shape vocabularies-types does not declare — hence the indexed access.
|
|
596
|
+
const siblingArrangement = property?.annotations?.UI?.['TextArrangement'];
|
|
597
|
+
const textArrangement = property?.annotations?.Common?.Text?.annotations?.UI?.TextArrangement ?? siblingArrangement;
|
|
598
|
+
// The converted enum value stringifies to e.g. "UI.TextArrangementType/TextOnly".
|
|
599
|
+
return textArrangement !== undefined && String(textArrangement).endsWith('/TextOnly');
|
|
607
600
|
}
|
|
608
601
|
/**
|
|
609
602
|
* Checks the state of action buttons defined in UI.LineItem annotations for a given entity set.
|
package/dist/utils/tableUtils.js
CHANGED
|
@@ -196,13 +196,15 @@ export function extractTextAnnotationColumnsFromNode(node) {
|
|
|
196
196
|
}
|
|
197
197
|
const columnItems = getAggregations(columnsAggregation);
|
|
198
198
|
const candidates = [];
|
|
199
|
-
const
|
|
199
|
+
const seenColumnProperties = new Set();
|
|
200
200
|
Object.entries(columnItems).forEach(([columnKey, column]) => {
|
|
201
201
|
if (!isDefaultAvailableColumn(column)) {
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
const text = column.properties?.text;
|
|
205
|
-
|
|
205
|
+
// The spec model uses the sentinel value "None" (any casing) to mean "no text annotation is
|
|
206
|
+
// maintained" — such columns must not produce a sort test.
|
|
207
|
+
if (text?.artifactType !== 'Annotation' || !text.value || text.value.toLowerCase() === 'none') {
|
|
206
208
|
return;
|
|
207
209
|
}
|
|
208
210
|
// A text target reached through a navigation property (e.g. "_DunningProcedure/DunningProcedure_Text")
|
|
@@ -211,10 +213,11 @@ export function extractTextAnnotationColumnsFromNode(node) {
|
|
|
211
213
|
return;
|
|
212
214
|
}
|
|
213
215
|
const columnProperty = getColumnIdentifier(column, columnKey);
|
|
214
|
-
|
|
216
|
+
// Deduplicate by code column: distinct columns may share one text target.
|
|
217
|
+
if (!columnProperty || seenColumnProperties.has(columnProperty)) {
|
|
215
218
|
return;
|
|
216
219
|
}
|
|
217
|
-
|
|
220
|
+
seenColumnProperties.add(columnProperty);
|
|
218
221
|
candidates.push({ columnProperty, textProperty: text.value });
|
|
219
222
|
});
|
|
220
223
|
return candidates;
|
package/package.json
CHANGED
|
@@ -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() {
|
|
@@ -77,43 +76,86 @@ sap.ui.define([
|
|
|
77
76
|
// });
|
|
78
77
|
|
|
79
78
|
<%_ if (tabs && tabs.length > 0) { -%>
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
<%_ tabs.forEach(function(tab) { -%>
|
|
80
|
+
/// View "<%- tab.key %>" ///
|
|
81
|
+
<%_ if (tab.createButton.visible && !isALP) { -%>
|
|
82
|
+
opaTest(<%- JSON.stringify("Check the create button in view " + tab.key) %>, function (Given, When, Then) {
|
|
82
83
|
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
83
|
-
<%_ if (tab.createButton.visible && !isALP) { _%>
|
|
84
84
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
|
|
85
85
|
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
<%_ } -%>
|
|
89
|
+
<%_ if (tab.deleteButton.visible) { -%>
|
|
90
|
+
opaTest(<%- JSON.stringify("Check the delete button in view " + tab.key) %>, function (Given, When, Then) {
|
|
91
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
88
92
|
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
|
|
89
93
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
<%_ } -%>
|
|
97
|
+
<%_ tab.toolBarActions.forEach(function(item) { -%>
|
|
98
|
+
<%_ if (item.visible) { -%>
|
|
99
|
+
opaTest(<%- JSON.stringify("Check the " + item.label + " action in view " + tab.key) %>, function (Given, When, Then) {
|
|
100
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
101
|
+
<%_ if (item.menuActions) { _%>
|
|
102
|
+
<%_ if (item.splitButton) { _%>
|
|
103
|
+
// "<%- 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:
|
|
104
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
|
|
105
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
|
|
106
|
+
<%_ } else { _%>
|
|
107
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
|
|
108
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
|
|
109
|
+
<%_ item.menuActions.forEach(function(menuAction) { _%>
|
|
110
|
+
<%_ if (menuAction.visible) { _%>
|
|
111
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckMenuAction("<%- menuAction.label %>");
|
|
112
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteMenuAction("<%- menuAction.label %>");
|
|
113
|
+
<%_ } _%>
|
|
114
|
+
<%_ }); _%>
|
|
90
115
|
<%_ } _%>
|
|
91
|
-
<%_
|
|
92
|
-
<%_ if (item.visible) { _%>
|
|
116
|
+
<%_ } else { _%>
|
|
93
117
|
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
|
|
94
118
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
95
119
|
<%_ } _%>
|
|
96
|
-
|
|
97
|
-
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
<%_ } -%>
|
|
123
|
+
<%_ }); -%>
|
|
124
|
+
<%_ if (Object.keys(tab.tableColumns).length > 0) { -%>
|
|
125
|
+
opaTest(<%- JSON.stringify("Check table columns in view " + tab.key) %>, function (Given, When, Then) {
|
|
126
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
98
127
|
Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
|
|
99
|
-
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
<%_ } -%>
|
|
131
|
+
opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (Given, When, Then) {
|
|
132
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
133
|
+
<%_ if (!hideFilterBar) { -%>
|
|
134
|
+
// Populate the table so the row check has data.
|
|
135
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
136
|
+
<%_ } -%>
|
|
100
137
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
|
|
101
|
-
<%_ }); -%>
|
|
102
138
|
});
|
|
139
|
+
|
|
140
|
+
<%_ }); -%>
|
|
103
141
|
<%_ } else { -%>
|
|
104
|
-
<%_ if (
|
|
105
|
-
opaTest("Check
|
|
106
|
-
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
107
|
-
<%_ if (createButton.visible && !isALP) { _%>
|
|
142
|
+
<%_ if (createButton.visible && !isALP) { -%>
|
|
143
|
+
opaTest("Check the create button", function (Given, When, Then) {
|
|
108
144
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
109
145
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
|
|
110
|
-
|
|
111
|
-
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
<%_ } -%>
|
|
149
|
+
<%_ if (deleteButton.visible) { -%>
|
|
150
|
+
opaTest("Check the delete button", function (Given, When, Then) {
|
|
112
151
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
|
|
113
152
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
<%_ } -%>
|
|
156
|
+
<%_ (toolBarActions || []).forEach(function(item) { -%>
|
|
157
|
+
<%_ if (item.visible) { -%>
|
|
158
|
+
opaTest(<%- JSON.stringify("Check the " + item.label + " action") %>, function (Given, When, Then) {
|
|
117
159
|
<%_ if (item.menuActions) { _%>
|
|
118
160
|
<%_ if (item.splitButton) { _%>
|
|
119
161
|
// "<%- 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:
|
|
@@ -133,24 +175,17 @@ sap.ui.define([
|
|
|
133
175
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
134
176
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
135
177
|
<%_ } _%>
|
|
136
|
-
<%_ } _%>
|
|
137
|
-
<%_ }); -%>
|
|
138
|
-
<%_ } -%>
|
|
139
|
-
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
140
|
-
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
141
|
-
<%_ } -%>
|
|
142
178
|
});
|
|
179
|
+
|
|
143
180
|
<%_ } -%>
|
|
144
|
-
<%_
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
149
|
-
<%_ }); -%>
|
|
181
|
+
<%_ }); -%>
|
|
182
|
+
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
183
|
+
opaTest("Check table columns", function (Given, When, Then) {
|
|
184
|
+
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
150
185
|
});
|
|
186
|
+
|
|
151
187
|
<%_ } -%>
|
|
152
188
|
<%_ } -%>
|
|
153
|
-
|
|
154
189
|
<%_ if (startLR) { -%>
|
|
155
190
|
opaTest("Navigate to ObjectPage", function (Given, When, Then) {
|
|
156
191
|
// Note: this test will fail if the ListReport page doesn't show any data
|
|
@@ -20,15 +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
23
|
-%>
|
|
25
24
|
<% if (usesFilterFieldIdentifier) { -%>
|
|
26
25
|
import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
|
|
27
26
|
<% } -%>
|
|
28
27
|
import runner from "./pages/JourneyRunner";
|
|
29
|
-
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
30
|
-
import { SortOrder } from "sap/ui/core/library";
|
|
31
|
-
<%_ } -%>
|
|
32
28
|
|
|
33
29
|
function journey() {
|
|
34
30
|
QUnit.module("<%- name%>ListReport journey");
|
|
@@ -85,43 +81,87 @@ function journey() {
|
|
|
85
81
|
// });
|
|
86
82
|
|
|
87
83
|
<%_ if (tabs && tabs.length > 0) { -%>
|
|
88
|
-
|
|
89
|
-
|
|
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) {
|
|
90
88
|
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
91
|
-
<%_ if (tab.createButton.visible && !isALP) { _%>
|
|
92
89
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
|
|
93
90
|
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
|
|
94
|
-
|
|
95
|
-
|
|
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 %>" });
|
|
96
97
|
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
|
|
97
98
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
<%_ } -%>
|
|
102
|
+
<%_ tab.toolBarActions.forEach(function(item) { -%>
|
|
103
|
+
<%_ if (item.visible) { -%>
|
|
104
|
+
opaTest(<%- JSON.stringify("Check the " + item.label + " action in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
105
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
106
|
+
<%_ if (item.menuActions) { _%>
|
|
107
|
+
<%_ if (item.splitButton) { _%>
|
|
108
|
+
// "<%- 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:
|
|
109
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
|
|
110
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
|
|
111
|
+
<%_ } else { _%>
|
|
112
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>");
|
|
113
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteAction("<%- item.label %>");
|
|
114
|
+
<%_ item.menuActions.forEach(function(menuAction) { _%>
|
|
115
|
+
<%_ if (menuAction.visible) { _%>
|
|
116
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckMenuAction("<%- menuAction.label %>");
|
|
117
|
+
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iExecuteMenuAction("<%- menuAction.label %>");
|
|
98
118
|
<%_ } _%>
|
|
99
|
-
<%_
|
|
100
|
-
<%_
|
|
119
|
+
<%_ }); _%>
|
|
120
|
+
<%_ } _%>
|
|
121
|
+
<%_ } else { _%>
|
|
101
122
|
// When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
|
|
102
123
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
103
124
|
<%_ } _%>
|
|
104
|
-
|
|
105
|
-
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
<%_ } -%>
|
|
128
|
+
<%_ }); -%>
|
|
129
|
+
<%_ if (Object.keys(tab.tableColumns).length > 0) { -%>
|
|
130
|
+
opaTest(<%- JSON.stringify("Check table columns in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
131
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
106
132
|
Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
|
|
107
|
-
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
<%_ } -%>
|
|
136
|
+
opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
137
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
138
|
+
<%_ if (!hideFilterBar) { -%>
|
|
139
|
+
// Populate the table so the row check has data.
|
|
140
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
141
|
+
<%_ } -%>
|
|
108
142
|
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
|
|
109
|
-
<%_ }); -%>
|
|
110
143
|
});
|
|
144
|
+
|
|
145
|
+
<%_ }); -%>
|
|
111
146
|
<%_ } else { -%>
|
|
112
|
-
<%_ if (
|
|
113
|
-
opaTest("Check
|
|
114
|
-
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
115
|
-
<%_ if (createButton.visible && !isALP) { _%>
|
|
147
|
+
<%_ if (createButton.visible && !isALP) { -%>
|
|
148
|
+
opaTest("Check the create button", function (_Given: Given, _When: When, Then: Then) {
|
|
116
149
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
117
150
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
|
|
118
|
-
|
|
119
|
-
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
<%_ } -%>
|
|
154
|
+
<%_ if (deleteButton.visible) { -%>
|
|
155
|
+
opaTest("Check the delete button", function (_Given: Given, _When: When, Then: Then) {
|
|
120
156
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
|
|
121
157
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
<%_ } -%>
|
|
161
|
+
<%_ (toolBarActions || []).forEach(function(item) { -%>
|
|
162
|
+
<%_ if (item.visible) { -%>
|
|
163
|
+
<%_ const usesWhen = item.menuActions && !item.splitButton; _%>
|
|
164
|
+
opaTest(<%- JSON.stringify("Check the " + item.label + " action") %>, function (_Given: Given, <% if (usesWhen) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
|
|
125
165
|
<%_ if (item.menuActions) { _%>
|
|
126
166
|
<%_ if (item.splitButton) { _%>
|
|
127
167
|
// "<%- 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:
|
|
@@ -141,24 +181,17 @@ function journey() {
|
|
|
141
181
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
142
182
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
143
183
|
<%_ } _%>
|
|
144
|
-
<%_ } _%>
|
|
145
|
-
<%_ }); -%>
|
|
146
|
-
<%_ } -%>
|
|
147
|
-
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
148
|
-
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
149
|
-
<%_ } -%>
|
|
150
184
|
});
|
|
185
|
+
|
|
151
186
|
<%_ } -%>
|
|
152
|
-
<%_
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
|
|
157
|
-
<%_ }); -%>
|
|
187
|
+
<%_ }); -%>
|
|
188
|
+
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
189
|
+
opaTest("Check table columns", function (_Given: Given, _When: When, Then: Then) {
|
|
190
|
+
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
158
191
|
});
|
|
192
|
+
|
|
159
193
|
<%_ } -%>
|
|
160
194
|
<%_ } -%>
|
|
161
|
-
|
|
162
195
|
<%_ if (startLR) { -%>
|
|
163
196
|
opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
|
|
164
197
|
// Note: this test will fail if the ListReport page doesn't show any data
|