@sap-ux/ui5-test-writer 1.11.0 → 1.12.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 +6 -0
- package/dist/utils/actionUtils.d.ts +31 -1
- package/dist/utils/actionUtils.js +73 -0
- package/dist/utils/listReportUtils.d.ts +6 -3
- package/dist/utils/listReportUtils.js +20 -11
- package/dist/utils/objectPageUtils.js +1 -66
- package/package.json +1 -1
- package/templates/v4/1.148/integration/ListReportJourney.js +17 -0
- package/templates/v4/1.148/integration/ListReportJourney.ts +19 -1
- package/templates/v4/1.148/integration/ObjectPageJourney.js +18 -0
- package/templates/v4/1.148/integration/ObjectPageJourney.ts +20 -2
- package/templates/v4/latest/integration/ListReportJourney.js +16 -1
- package/templates/v4/latest/integration/ListReportJourney.ts +18 -2
- package/templates/v4/latest/integration/ObjectPageJourney.js +18 -0
- package/templates/v4/latest/integration/ObjectPageJourney.ts +20 -1
package/dist/types.d.ts
CHANGED
|
@@ -264,6 +264,12 @@ export interface ActionButtonState {
|
|
|
264
264
|
* `iExecuteMenuAction` match menu entries by their rendered text, not by a stable id).
|
|
265
265
|
*/
|
|
266
266
|
menuActions?: MenuActionState[];
|
|
267
|
+
/**
|
|
268
|
+
* Set when a menu (drop-down) button declares a `defaultAction`, so Fiori Elements renders it as a
|
|
269
|
+
* split button. Its dropdown can only be opened via the arrow, which the `sap.fe.test` API cannot
|
|
270
|
+
* press — so the generated test asserts the button but omits the (unreachable) menu drill-down.
|
|
271
|
+
*/
|
|
272
|
+
splitButton?: boolean;
|
|
267
273
|
/**
|
|
268
274
|
* Set for custom (manifest-declared) actions that have no OData `DataFieldForAction` counterpart.
|
|
269
275
|
* These are matched at runtime by their rendered label, so the writer emits the label-string form
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ConvertedMetadata } from '@sap-ux/vocabularies-types';
|
|
2
|
-
import type { ActionButtonState, ButtonState, ButtonVisibilityResult } from '../types.js';
|
|
2
|
+
import type { ActionButtonState, ButtonState, ButtonVisibilityResult, MenuActionState } from '../types.js';
|
|
3
|
+
import { type AggregationItem } from './modelUtils.js';
|
|
4
|
+
import type { I18nLabelResolver } from './i18nUtils.js';
|
|
3
5
|
import type { DataFieldForAction } from '@sap-ux/vocabularies-types/vocabularies/UI.js';
|
|
4
6
|
import type { OperationAvailable } from '@sap-ux/vocabularies-types/vocabularies/Core.js';
|
|
5
7
|
import type { DeleteRestrictionsType, InsertRestrictionsType, UpdateRestrictionsType } from '@sap-ux/vocabularies-types/vocabularies/Capabilities.js';
|
|
@@ -163,5 +165,33 @@ export declare function safeCheckButtonVisibility(metadata: string, entitySetNam
|
|
|
163
165
|
* @returns ButtonState for the edit button, or undefined if error occurs
|
|
164
166
|
*/
|
|
165
167
|
export declare function safeCheckEditVisibility(metadata: string, entitySetName: string, log?: Logger): ButtonState | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Determines whether an action aggregation entry is a menu (drop-down) grouping several actions.
|
|
170
|
+
*
|
|
171
|
+
* @param item - action aggregation entry from the spec model
|
|
172
|
+
* @returns true if the entry represents an annotation menu or a manifest (custom) menu
|
|
173
|
+
*/
|
|
174
|
+
export declare function isMenuActionItem(item: AggregationItem): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Builds the individual menu item states contained in a menu action node. Child actions are read
|
|
177
|
+
* from the nested `actions` aggregation of the menu node (`menuItem.aggregations.actions`).
|
|
178
|
+
*
|
|
179
|
+
* @param menuItem - the menu container aggregation entry
|
|
180
|
+
* @param convertedMetadata - converted OData metadata for resolving annotation-backed children; when omitted children are matched by label only
|
|
181
|
+
* @param schemaNamespace - OData schema namespace used as service identifier
|
|
182
|
+
* @param resolveLabel - resolver for i18n placeholder labels (`{i18n>key}` → translated text)
|
|
183
|
+
* @returns array of menu item states
|
|
184
|
+
*/
|
|
185
|
+
export declare function buildMenuItemStates(menuItem: AggregationItem, convertedMetadata: ConvertedMetadata | undefined, schemaNamespace: string, resolveLabel: I18nLabelResolver): MenuActionState[];
|
|
186
|
+
/**
|
|
187
|
+
* Builds a menu action button state from a menu aggregation entry (annotation or custom menu).
|
|
188
|
+
*
|
|
189
|
+
* @param menuItem - the menu container aggregation entry
|
|
190
|
+
* @param convertedMetadata - converted OData metadata for resolving annotation-backed children; when omitted children are matched by label only
|
|
191
|
+
* @param schemaNamespace - OData schema namespace used as service identifier
|
|
192
|
+
* @param resolveLabel - resolver for i18n placeholder labels
|
|
193
|
+
* @returns the menu action button state
|
|
194
|
+
*/
|
|
195
|
+
export declare function buildMenuActionState(menuItem: AggregationItem, convertedMetadata: ConvertedMetadata | undefined, schemaNamespace: string, resolveLabel: I18nLabelResolver): ActionButtonState;
|
|
166
196
|
export {};
|
|
167
197
|
//# sourceMappingURL=actionUtils.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAggregations } from './modelUtils.js';
|
|
1
2
|
import { parse } from '@sap-ux/edmx-parser';
|
|
2
3
|
import { convert } from '@sap-ux/annotation-converter';
|
|
3
4
|
const DATA_FIELD_FOR_ACTION = 'DataFieldForAction';
|
|
@@ -344,4 +345,76 @@ export function safeCheckEditVisibility(metadata, entitySetName, log) {
|
|
|
344
345
|
return undefined;
|
|
345
346
|
}
|
|
346
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Determines whether an action aggregation entry is a menu (drop-down) grouping several actions.
|
|
350
|
+
*
|
|
351
|
+
* @param item - action aggregation entry from the spec model
|
|
352
|
+
* @returns true if the entry represents an annotation menu or a manifest (custom) menu
|
|
353
|
+
*/
|
|
354
|
+
export function isMenuActionItem(item) {
|
|
355
|
+
return item.menuType !== undefined || item.schema?.dataType === 'DataFieldForActionGroup';
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Builds the individual menu item states contained in a menu action node. Child actions are read
|
|
359
|
+
* from the nested `actions` aggregation of the menu node (`menuItem.aggregations.actions`).
|
|
360
|
+
*
|
|
361
|
+
* @param menuItem - the menu container aggregation entry
|
|
362
|
+
* @param convertedMetadata - converted OData metadata for resolving annotation-backed children; when omitted children are matched by label only
|
|
363
|
+
* @param schemaNamespace - OData schema namespace used as service identifier
|
|
364
|
+
* @param resolveLabel - resolver for i18n placeholder labels (`{i18n>key}` → translated text)
|
|
365
|
+
* @returns array of menu item states
|
|
366
|
+
*/
|
|
367
|
+
export function buildMenuItemStates(menuItem, convertedMetadata, schemaNamespace, resolveLabel) {
|
|
368
|
+
const innerContainer = getAggregations(menuItem)['actions'];
|
|
369
|
+
if (!innerContainer) {
|
|
370
|
+
return [];
|
|
371
|
+
}
|
|
372
|
+
const innerEntries = getAggregations(innerContainer);
|
|
373
|
+
return Object.entries(innerEntries).map(([childKey, child]) => {
|
|
374
|
+
const annotationState = convertedMetadata
|
|
375
|
+
? buildActionStateFromSpecModelKey(childKey, child.description, convertedMetadata, schemaNamespace)
|
|
376
|
+
: undefined;
|
|
377
|
+
if (annotationState) {
|
|
378
|
+
return {
|
|
379
|
+
label: annotationState.label,
|
|
380
|
+
visible: annotationState.visible,
|
|
381
|
+
service: annotationState.service,
|
|
382
|
+
action: annotationState.action,
|
|
383
|
+
unbound: annotationState.unbound,
|
|
384
|
+
enabled: annotationState.enabled,
|
|
385
|
+
dynamicPath: annotationState.dynamicPath
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
const { label, unresolved } = resolveLabel(child.description);
|
|
389
|
+
return { label, visible: true, labelUnresolved: unresolved || undefined };
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Builds a menu action button state from a menu aggregation entry (annotation or custom menu).
|
|
394
|
+
*
|
|
395
|
+
* @param menuItem - the menu container aggregation entry
|
|
396
|
+
* @param convertedMetadata - converted OData metadata for resolving annotation-backed children; when omitted children are matched by label only
|
|
397
|
+
* @param schemaNamespace - OData schema namespace used as service identifier
|
|
398
|
+
* @param resolveLabel - resolver for i18n placeholder labels
|
|
399
|
+
* @returns the menu action button state
|
|
400
|
+
*/
|
|
401
|
+
export function buildMenuActionState(menuItem, convertedMetadata, schemaNamespace, resolveLabel) {
|
|
402
|
+
const menuType = menuItem.menuType === 'Annotation' || menuItem.schema?.dataType === 'DataFieldForActionGroup'
|
|
403
|
+
? 'Annotation'
|
|
404
|
+
: 'CustomMenu';
|
|
405
|
+
// A `defaultAction` makes FE render a split button whose menu cannot be opened via the OPA API.
|
|
406
|
+
const defaultAction = menuItem
|
|
407
|
+
.properties?.defaultAction?.value;
|
|
408
|
+
const { label, unresolved } = resolveLabel(menuItem.description);
|
|
409
|
+
return {
|
|
410
|
+
label,
|
|
411
|
+
action: '',
|
|
412
|
+
visible: true,
|
|
413
|
+
enabled: true,
|
|
414
|
+
menuType,
|
|
415
|
+
splitButton: defaultAction ? true : undefined,
|
|
416
|
+
labelUnresolved: unresolved || undefined,
|
|
417
|
+
menuActions: buildMenuItemStates(menuItem, convertedMetadata, schemaNamespace, resolveLabel)
|
|
418
|
+
};
|
|
419
|
+
}
|
|
347
420
|
//# sourceMappingURL=actionUtils.js.map
|
|
@@ -76,13 +76,16 @@ export declare function getListReportFeatures(listReportPage: PageWithModelV4, l
|
|
|
76
76
|
*/
|
|
77
77
|
export declare function getToolBarActions(pageModel: TreeModel): TreeAggregations;
|
|
78
78
|
/**
|
|
79
|
-
* Extracts custom (manifest-declared) toolbar actions from the List Report
|
|
79
|
+
* Extracts custom (manifest-declared) and menu (drop-down) toolbar actions from the List Report
|
|
80
|
+
* table toolbar. Annotation-backed single actions are handled separately via the OData metadata
|
|
81
|
+
* path, so they are not emitted here.
|
|
80
82
|
*
|
|
81
83
|
* @param pageModel - the tree model containing the table toolbar definitions
|
|
82
84
|
* @param resolveLabel - resolver for i18n placeholder labels
|
|
83
|
-
* @
|
|
85
|
+
* @param convertedMetadata - converted OData metadata, required to resolve annotation-backed menu children
|
|
86
|
+
* @returns array of custom and menu toolbar action button states
|
|
84
87
|
*/
|
|
85
|
-
export declare function extractCustomToolBarActions(pageModel: TreeModel, resolveLabel: I18nLabelResolver): ActionButtonState[];
|
|
88
|
+
export declare function extractCustomToolBarActions(pageModel: TreeModel, resolveLabel: I18nLabelResolver, convertedMetadata?: ConvertedMetadata): ActionButtonState[];
|
|
86
89
|
/**
|
|
87
90
|
* Retrieves filter field names from the page model using ux-specification.
|
|
88
91
|
*
|
|
@@ -3,7 +3,7 @@ import { passthroughLabelResolver } from './i18nUtils.js';
|
|
|
3
3
|
import { extractContactCardColumnsFromNode, extractTextAnnotationColumnsFromNode, resolvePrimaryTableNode } from './tableUtils.js';
|
|
4
4
|
import { parse, merge } from '@sap-ux/edmx-parser';
|
|
5
5
|
import { convert } from '@sap-ux/annotation-converter';
|
|
6
|
-
import { extractActionMethodName, buildActionButtonState, collectCriticalActionNames, safeCheckButtonVisibility, safeCheckButtonVisibilityFromMetadata } from './actionUtils.js';
|
|
6
|
+
import { extractActionMethodName, buildActionButtonState, buildMenuActionState, isMenuActionItem, collectCriticalActionNames, safeCheckButtonVisibility, safeCheckButtonVisibilityFromMetadata } from './actionUtils.js';
|
|
7
7
|
import { t } from '../i18n.js';
|
|
8
8
|
export { checkButtonVisibility, safeCheckEditVisibility } from './actionUtils.js';
|
|
9
9
|
export { safeCheckButtonVisibility };
|
|
@@ -128,10 +128,11 @@ export function getListReportFeatures(listReportPage, log, metadata, manifest, r
|
|
|
128
128
|
log?.debug(`Failed to parse metadata: ${error instanceof Error ? error.message : String(error)}`);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
// Custom (manifest-declared) toolbar actions have no OData counterpart
|
|
132
|
-
//
|
|
133
|
-
// actions (
|
|
134
|
-
|
|
131
|
+
// Custom (manifest-declared) and menu (drop-down) toolbar actions have no OData counterpart in
|
|
132
|
+
// `safeCheckActionButtonStates` (which matches annotation actions by name). extractCustomToolBarActions
|
|
133
|
+
// adds custom actions (matched by label) and menu buttons with their child actions, without
|
|
134
|
+
// duplicating the annotation-backed actions already captured above.
|
|
135
|
+
toolBarActions = toolBarActions.concat(extractCustomToolBarActions(listReportPage.model, resolveLabel, convertedMetadata));
|
|
135
136
|
// Custom filter fields are matched by rendered label, so resolve unresolved i18n
|
|
136
137
|
// placeholders via the property's OData `@Common.Label`.
|
|
137
138
|
const filterBarItems = filterFieldEntries.map((entry) => {
|
|
@@ -201,23 +202,31 @@ export function getToolBarActions(pageModel) {
|
|
|
201
202
|
return actionAggregations;
|
|
202
203
|
}
|
|
203
204
|
/**
|
|
204
|
-
* Extracts custom (manifest-declared) toolbar actions from the List Report
|
|
205
|
+
* Extracts custom (manifest-declared) and menu (drop-down) toolbar actions from the List Report
|
|
206
|
+
* table toolbar. Annotation-backed single actions are handled separately via the OData metadata
|
|
207
|
+
* path, so they are not emitted here.
|
|
205
208
|
*
|
|
206
209
|
* @param pageModel - the tree model containing the table toolbar definitions
|
|
207
210
|
* @param resolveLabel - resolver for i18n placeholder labels
|
|
208
|
-
* @
|
|
211
|
+
* @param convertedMetadata - converted OData metadata, required to resolve annotation-backed menu children
|
|
212
|
+
* @returns array of custom and menu toolbar action button states
|
|
209
213
|
*/
|
|
210
|
-
export function extractCustomToolBarActions(pageModel, resolveLabel) {
|
|
214
|
+
export function extractCustomToolBarActions(pageModel, resolveLabel, convertedMetadata) {
|
|
211
215
|
const actionAggregations = getToolBarActions(pageModel);
|
|
212
|
-
const
|
|
216
|
+
const schemaNamespace = convertedMetadata?.namespace ?? '';
|
|
217
|
+
const actions = [];
|
|
213
218
|
for (const key of Object.keys(actionAggregations ?? {})) {
|
|
214
219
|
const item = actionAggregations[key];
|
|
220
|
+
if (isMenuActionItem(item)) {
|
|
221
|
+
actions.push(buildMenuActionState(item, convertedMetadata, schemaNamespace, resolveLabel));
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
215
224
|
if (item?.schema?.actionType !== 'Custom') {
|
|
216
225
|
continue;
|
|
217
226
|
}
|
|
218
227
|
const { label, unresolved } = resolveLabel(item.description);
|
|
219
228
|
if (label) {
|
|
220
|
-
|
|
229
|
+
actions.push({
|
|
221
230
|
label,
|
|
222
231
|
action: '',
|
|
223
232
|
visible: true,
|
|
@@ -227,7 +236,7 @@ export function extractCustomToolBarActions(pageModel, resolveLabel) {
|
|
|
227
236
|
});
|
|
228
237
|
}
|
|
229
238
|
}
|
|
230
|
-
return
|
|
239
|
+
return actions;
|
|
231
240
|
}
|
|
232
241
|
/**
|
|
233
242
|
* Retrieves filter field names from the page model using ux-specification.
|
|
@@ -2,7 +2,7 @@ import { getAggregations, parseDataFieldForAnnotationName } from './modelUtils.j
|
|
|
2
2
|
import { passthroughLabelResolver } from './i18nUtils.js';
|
|
3
3
|
import { extractContactCardColumnsFromNode, extractTableColumnsFromNode } from './tableUtils.js';
|
|
4
4
|
import { PageTypeV4 } from '@sap/ux-specification/dist/types/src/common/page.js';
|
|
5
|
-
import { buildActionStateFromSpecModelKey, collectCriticalActionNames, safeCheckButtonVisibility, safeCheckEditVisibility } from './actionUtils.js';
|
|
5
|
+
import { buildActionStateFromSpecModelKey, buildMenuActionState, isMenuActionItem, collectCriticalActionNames, safeCheckButtonVisibility, safeCheckEditVisibility } from './actionUtils.js';
|
|
6
6
|
import { getMergedConvertedMetadata } from './metadataXmlUtils.js';
|
|
7
7
|
import { getListReportViews } from './listReportUtils.js';
|
|
8
8
|
/**
|
|
@@ -245,71 +245,6 @@ function extractObjectPageBodySectionsData(objectPage, convertedMetadata, schema
|
|
|
245
245
|
}
|
|
246
246
|
return bodySections;
|
|
247
247
|
}
|
|
248
|
-
/**
|
|
249
|
-
* Determines whether an action aggregation entry is a menu (drop-down) grouping several actions.
|
|
250
|
-
*
|
|
251
|
-
* @param item - action aggregation entry from the spec model
|
|
252
|
-
* @returns true if the entry represents an annotation menu or a manifest (custom) menu
|
|
253
|
-
*/
|
|
254
|
-
function isMenuActionItem(item) {
|
|
255
|
-
return item.menuType !== undefined || item.schema?.dataType === 'DataFieldForActionGroup';
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Builds the individual menu item states contained in a menu action node.
|
|
259
|
-
*
|
|
260
|
-
* @param menuItem - the menu container aggregation entry
|
|
261
|
-
* @param convertedMetadata - converted OData metadata for resolving annotation actions
|
|
262
|
-
* @param schemaNamespace - OData schema namespace used as service identifier
|
|
263
|
-
* @param resolveLabel - resolver for i18n placeholder labels (`{i18n>key}` → translated text)
|
|
264
|
-
* @returns array of menu item states
|
|
265
|
-
*/
|
|
266
|
-
function buildMenuItemStates(menuItem, convertedMetadata, schemaNamespace, resolveLabel) {
|
|
267
|
-
const innerContainer = getAggregations(menuItem)['actions'];
|
|
268
|
-
if (!innerContainer) {
|
|
269
|
-
return [];
|
|
270
|
-
}
|
|
271
|
-
const innerEntries = getAggregations(innerContainer);
|
|
272
|
-
return Object.entries(innerEntries).map(([childKey, child]) => {
|
|
273
|
-
const annotationState = buildActionStateFromSpecModelKey(childKey, child.description, convertedMetadata, schemaNamespace);
|
|
274
|
-
if (annotationState) {
|
|
275
|
-
return {
|
|
276
|
-
label: annotationState.label,
|
|
277
|
-
visible: annotationState.visible,
|
|
278
|
-
service: annotationState.service,
|
|
279
|
-
action: annotationState.action,
|
|
280
|
-
unbound: annotationState.unbound,
|
|
281
|
-
enabled: annotationState.enabled,
|
|
282
|
-
dynamicPath: annotationState.dynamicPath
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
const { label, unresolved } = resolveLabel(child.description);
|
|
286
|
-
return { label, visible: true, labelUnresolved: unresolved || undefined };
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Builds a menu action button state from a menu aggregation entry (annotation or custom menu).
|
|
291
|
-
*
|
|
292
|
-
* @param menuItem - the menu container aggregation entry
|
|
293
|
-
* @param convertedMetadata - converted OData metadata for resolving annotation actions
|
|
294
|
-
* @param schemaNamespace - OData schema namespace used as service identifier
|
|
295
|
-
* @param resolveLabel - resolver for i18n placeholder labels
|
|
296
|
-
* @returns the menu action button state
|
|
297
|
-
*/
|
|
298
|
-
function buildMenuActionState(menuItem, convertedMetadata, schemaNamespace, resolveLabel) {
|
|
299
|
-
const menuType = menuItem.menuType === 'Annotation' || menuItem.schema?.dataType === 'DataFieldForActionGroup'
|
|
300
|
-
? 'Annotation'
|
|
301
|
-
: 'CustomMenu';
|
|
302
|
-
const { label, unresolved } = resolveLabel(menuItem.description);
|
|
303
|
-
return {
|
|
304
|
-
label,
|
|
305
|
-
action: '',
|
|
306
|
-
visible: true,
|
|
307
|
-
enabled: true,
|
|
308
|
-
menuType,
|
|
309
|
-
labelUnresolved: unresolved || undefined,
|
|
310
|
-
menuActions: buildMenuItemStates(menuItem, convertedMetadata, schemaNamespace, resolveLabel)
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
248
|
/**
|
|
314
249
|
* Builds an action button state for a custom (manifest-declared) action that has no OData
|
|
315
250
|
* `DataFieldForAction` counterpart. These are matched at runtime by their rendered label.
|
package/package.json
CHANGED
|
@@ -87,9 +87,26 @@ sap.ui.define([
|
|
|
87
87
|
<%_ } _%>
|
|
88
88
|
<%_ toolBarActions.forEach(function(item) { _%>
|
|
89
89
|
<%_ if (item.visible) { _%>
|
|
90
|
+
<%_ if (item.menuActions) { _%>
|
|
91
|
+
<%_ if (item.splitButton) { _%>
|
|
92
|
+
// "<%- 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:
|
|
93
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
94
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
95
|
+
<%_ } else { _%>
|
|
96
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
97
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
98
|
+
<%_ item.menuActions.forEach(function(menuAction) { _%>
|
|
99
|
+
<%_ if (menuAction.visible) { _%>
|
|
100
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckMenuAction("<%- menuAction.label %>");
|
|
101
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteMenuAction("<%- menuAction.label %>");
|
|
102
|
+
<%_ } _%>
|
|
103
|
+
<%_ }); _%>
|
|
104
|
+
<%_ } _%>
|
|
105
|
+
<%_ } else { _%>
|
|
90
106
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
91
107
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
92
108
|
<%_ } _%>
|
|
109
|
+
<%_ } _%>
|
|
93
110
|
<%_ }); -%>
|
|
94
111
|
<%_ } -%>
|
|
95
112
|
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
@@ -20,6 +20,7 @@ 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; });
|
|
23
24
|
-%>
|
|
24
25
|
<% if (usesFilterFieldIdentifier) { -%>
|
|
25
26
|
import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
|
|
@@ -82,7 +83,7 @@ function journey() {
|
|
|
82
83
|
// });
|
|
83
84
|
|
|
84
85
|
<%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
|
|
85
|
-
opaTest("Check table columns and actions", function (_Given: Given, _When: When
|
|
86
|
+
opaTest("Check table columns and actions", function (_Given: Given, <% if (toolBarHasMenu) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
|
|
86
87
|
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
87
88
|
<%_ if (createButton.visible && !isALP) { _%>
|
|
88
89
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
@@ -94,9 +95,26 @@ function journey() {
|
|
|
94
95
|
<%_ } _%>
|
|
95
96
|
<%_ toolBarActions.forEach(function(item) { _%>
|
|
96
97
|
<%_ if (item.visible) { _%>
|
|
98
|
+
<%_ if (item.menuActions) { _%>
|
|
99
|
+
<%_ if (item.splitButton) { _%>
|
|
100
|
+
// "<%- 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:
|
|
101
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
102
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
103
|
+
<%_ } else { _%>
|
|
104
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
105
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
106
|
+
<%_ item.menuActions.forEach(function(menuAction) { _%>
|
|
107
|
+
<%_ if (menuAction.visible) { _%>
|
|
108
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckMenuAction("<%- menuAction.label %>");
|
|
109
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteMenuAction("<%- menuAction.label %>");
|
|
110
|
+
<%_ } _%>
|
|
111
|
+
<%_ }); _%>
|
|
112
|
+
<%_ } _%>
|
|
113
|
+
<%_ } else { _%>
|
|
97
114
|
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
98
115
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
99
116
|
<%_ } _%>
|
|
117
|
+
<%_ } _%>
|
|
100
118
|
<%_ }); -%>
|
|
101
119
|
<%_ } -%>
|
|
102
120
|
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
@@ -55,6 +55,11 @@ sap.ui.define([
|
|
|
55
55
|
<% headerActions.forEach(function(action) { -%>
|
|
56
56
|
<% if (action.visible) { -%>
|
|
57
57
|
<% if (action.menuActions) { -%>
|
|
58
|
+
<% if (action.splitButton) { -%>
|
|
59
|
+
// <%- JSON.stringify(action.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:
|
|
60
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
61
|
+
// When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
62
|
+
<% } else { -%>
|
|
58
63
|
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
59
64
|
When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
60
65
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -63,6 +68,7 @@ sap.ui.define([
|
|
|
63
68
|
// When.onThe<%- name%>Generated.onHeader().iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
64
69
|
<% } -%>
|
|
65
70
|
<% }); -%>
|
|
71
|
+
<% } -%>
|
|
66
72
|
<% } else if (action.enabled === 'dynamic') { -%>
|
|
67
73
|
Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
68
74
|
// When.onThe<%- name%>Generated.onHeader().iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
@@ -114,6 +120,11 @@ sap.ui.define([
|
|
|
114
120
|
<% if (action.visible) { -%>
|
|
115
121
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
116
122
|
<% if (action.menuActions) { -%>
|
|
123
|
+
<% if (action.splitButton) { -%>
|
|
124
|
+
// <%- JSON.stringify(action.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:
|
|
125
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
126
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
127
|
+
<% } else { -%>
|
|
117
128
|
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
118
129
|
When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
119
130
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -122,6 +133,7 @@ sap.ui.define([
|
|
|
122
133
|
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
123
134
|
<% } -%>
|
|
124
135
|
<% }); -%>
|
|
136
|
+
<% } -%>
|
|
125
137
|
<% } else if (action.enabled === 'dynamic') { -%>
|
|
126
138
|
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
127
139
|
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
@@ -131,6 +143,11 @@ sap.ui.define([
|
|
|
131
143
|
<% } -%>
|
|
132
144
|
<% } else { -%>
|
|
133
145
|
<% if (action.menuActions) { -%>
|
|
146
|
+
<% if (action.splitButton) { -%>
|
|
147
|
+
// <%- JSON.stringify(action.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:
|
|
148
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
149
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
150
|
+
<% } else { -%>
|
|
134
151
|
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
135
152
|
When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
136
153
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -139,6 +156,7 @@ sap.ui.define([
|
|
|
139
156
|
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
140
157
|
<% } -%>
|
|
141
158
|
<% }); -%>
|
|
159
|
+
<% } -%>
|
|
142
160
|
<% } else if (action.enabled === 'dynamic') { -%>
|
|
143
161
|
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
144
162
|
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
@@ -31,7 +31,7 @@ const usesFormIdentifier = (bodySections || []).some(function(section) {
|
|
|
31
31
|
});
|
|
32
32
|
return subSectionsHaveForm || sectionHasFormFields || hasFormAction;
|
|
33
33
|
});
|
|
34
|
-
const headerHasMenu = (headerActions || []).some(function(action) { return action.visible && action.menuActions; });
|
|
34
|
+
const headerHasMenu = (headerActions || []).some(function(action) { return action.visible && action.menuActions && !action.splitButton; });
|
|
35
35
|
-%>
|
|
36
36
|
<% if (usesFieldIdentifier) { -%>
|
|
37
37
|
import type { FieldIdentifier } from "sap/fe/test/api/BaseAPI";
|
|
@@ -75,6 +75,11 @@ function journey() {
|
|
|
75
75
|
<% headerActions.forEach(function(action) { -%>
|
|
76
76
|
<% if (action.visible) { -%>
|
|
77
77
|
<% if (action.menuActions) { -%>
|
|
78
|
+
<% if (action.splitButton) { -%>
|
|
79
|
+
// <%- JSON.stringify(action.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:
|
|
80
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
81
|
+
// When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
82
|
+
<% } else { -%>
|
|
78
83
|
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
79
84
|
When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
80
85
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -83,6 +88,7 @@ function journey() {
|
|
|
83
88
|
// When.onThe<%- name%>Generated.onHeader().iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
84
89
|
<% } -%>
|
|
85
90
|
<% }); -%>
|
|
91
|
+
<% } -%>
|
|
86
92
|
<% } else if (action.enabled === 'dynamic') { -%>
|
|
87
93
|
Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
88
94
|
// When.onThe<%- name%>Generated.onHeader().iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
@@ -124,7 +130,7 @@ function journey() {
|
|
|
124
130
|
<% } -%>
|
|
125
131
|
<% if (bodySections?.length > 0) { -%>
|
|
126
132
|
<% bodySections.forEach(function(section) { -%>
|
|
127
|
-
opaTest("Check the <%- section.id %> section of the Object Page", function (_Given: Given, <% if (bodySections.length > 1 || (section.actions && section.actions.some(function(a) { return a.visible && a.menuActions; }))) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
|
|
133
|
+
opaTest("Check the <%- section.id %> section of the Object Page", function (_Given: Given, <% if (bodySections.length > 1 || (section.actions && section.actions.some(function(a) { return a.visible && a.menuActions && !a.splitButton; }))) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
|
|
128
134
|
<% if (bodySections.length > 1) { -%>
|
|
129
135
|
When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
|
|
130
136
|
<% } -%>
|
|
@@ -134,6 +140,11 @@ function journey() {
|
|
|
134
140
|
<% if (action.visible) { -%>
|
|
135
141
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
136
142
|
<% if (action.menuActions) { -%>
|
|
143
|
+
<% if (action.splitButton) { -%>
|
|
144
|
+
// <%- JSON.stringify(action.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:
|
|
145
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
146
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
147
|
+
<% } else { -%>
|
|
137
148
|
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
138
149
|
When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
139
150
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -142,6 +153,7 @@ function journey() {
|
|
|
142
153
|
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
143
154
|
<% } -%>
|
|
144
155
|
<% }); -%>
|
|
156
|
+
<% } -%>
|
|
145
157
|
<% } else if (action.enabled === 'dynamic') { -%>
|
|
146
158
|
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
147
159
|
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
@@ -151,6 +163,11 @@ function journey() {
|
|
|
151
163
|
<% } -%>
|
|
152
164
|
<% } else { -%>
|
|
153
165
|
<% if (action.menuActions) { -%>
|
|
166
|
+
<% if (action.splitButton) { -%>
|
|
167
|
+
// <%- JSON.stringify(action.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:
|
|
168
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
169
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
170
|
+
<% } else { -%>
|
|
154
171
|
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
155
172
|
When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
156
173
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -159,6 +176,7 @@ function journey() {
|
|
|
159
176
|
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
160
177
|
<% } -%>
|
|
161
178
|
<% }); -%>
|
|
179
|
+
<% } -%>
|
|
162
180
|
<% } else if (action.enabled === 'dynamic') { -%>
|
|
163
181
|
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
164
182
|
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
@@ -87,7 +87,22 @@ sap.ui.define([
|
|
|
87
87
|
<%_ } _%>
|
|
88
88
|
<%_ toolBarActions.forEach(function(item) { _%>
|
|
89
89
|
<%_ if (item.visible) { _%>
|
|
90
|
-
<%_ if (item.
|
|
90
|
+
<%_ if (item.menuActions) { _%>
|
|
91
|
+
<%_ if (item.splitButton) { _%>
|
|
92
|
+
// "<%- 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:
|
|
93
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
94
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
95
|
+
<%_ } else { _%>
|
|
96
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
97
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
98
|
+
<%_ item.menuActions.forEach(function(menuAction) { _%>
|
|
99
|
+
<%_ if (menuAction.visible) { _%>
|
|
100
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckMenuAction("<%- menuAction.label %>");
|
|
101
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteMenuAction("<%- menuAction.label %>");
|
|
102
|
+
<%_ } _%>
|
|
103
|
+
<%_ }); _%>
|
|
104
|
+
<%_ } _%>
|
|
105
|
+
<%_ } else if (item.custom) { _%>
|
|
91
106
|
<%_ if (item.labelUnresolved) { _%>
|
|
92
107
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
93
108
|
<%_ } _%>
|
|
@@ -20,6 +20,7 @@ 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; });
|
|
23
24
|
-%>
|
|
24
25
|
<% if (usesFilterFieldIdentifier) { -%>
|
|
25
26
|
import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
|
|
@@ -82,7 +83,7 @@ function journey() {
|
|
|
82
83
|
// });
|
|
83
84
|
|
|
84
85
|
<%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
|
|
85
|
-
opaTest("Check table columns and actions", function (_Given: Given, <% if (toolBarActions && toolBarActions.some(function(item) { return item.visible && item.isCritical && item.enabled !== 'dynamic'; }))
|
|
86
|
+
opaTest("Check table columns and actions", function (_Given: Given, <% if (toolBarHasMenu || (toolBarActions && toolBarActions.some(function(item) { return item.visible && item.isCritical && item.enabled !== 'dynamic'; }))) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
|
|
86
87
|
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
87
88
|
<%_ if (createButton.visible && !isALP) { _%>
|
|
88
89
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
@@ -94,7 +95,22 @@ function journey() {
|
|
|
94
95
|
<%_ } _%>
|
|
95
96
|
<%_ toolBarActions.forEach(function(item) { _%>
|
|
96
97
|
<%_ if (item.visible) { _%>
|
|
97
|
-
<%_ if (item.
|
|
98
|
+
<%_ if (item.menuActions) { _%>
|
|
99
|
+
<%_ if (item.splitButton) { _%>
|
|
100
|
+
// "<%- 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:
|
|
101
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
102
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
103
|
+
<%_ } else { _%>
|
|
104
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
|
|
105
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
|
|
106
|
+
<%_ item.menuActions.forEach(function(menuAction) { _%>
|
|
107
|
+
<%_ if (menuAction.visible) { _%>
|
|
108
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckMenuAction("<%- menuAction.label %>");
|
|
109
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteMenuAction("<%- menuAction.label %>");
|
|
110
|
+
<%_ } _%>
|
|
111
|
+
<%_ }); _%>
|
|
112
|
+
<%_ } _%>
|
|
113
|
+
<%_ } else if (item.custom) { _%>
|
|
98
114
|
<%_ if (item.labelUnresolved) { _%>
|
|
99
115
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
100
116
|
<%_ } _%>
|
|
@@ -55,6 +55,11 @@ sap.ui.define([
|
|
|
55
55
|
<% headerActions.forEach(function(action) { -%>
|
|
56
56
|
<% if (action.visible) { -%>
|
|
57
57
|
<% if (action.menuActions) { -%>
|
|
58
|
+
<% if (action.splitButton) { -%>
|
|
59
|
+
// <%- JSON.stringify(action.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:
|
|
60
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
61
|
+
// When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
62
|
+
<% } else { -%>
|
|
58
63
|
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
59
64
|
When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
60
65
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -63,6 +68,7 @@ sap.ui.define([
|
|
|
63
68
|
// When.onThe<%- name%>Generated.onHeader().iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
64
69
|
<% } -%>
|
|
65
70
|
<% }); -%>
|
|
71
|
+
<% } -%>
|
|
66
72
|
<% } else if (action.custom) { -%>
|
|
67
73
|
<% if (action.labelUnresolved) { -%>
|
|
68
74
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
@@ -140,6 +146,11 @@ sap.ui.define([
|
|
|
140
146
|
<% if (action.visible) { -%>
|
|
141
147
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
142
148
|
<% if (action.menuActions) { -%>
|
|
149
|
+
<% if (action.splitButton) { -%>
|
|
150
|
+
// <%- JSON.stringify(action.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:
|
|
151
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
152
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
153
|
+
<% } else { -%>
|
|
143
154
|
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
144
155
|
When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
145
156
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -148,6 +159,7 @@ sap.ui.define([
|
|
|
148
159
|
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
149
160
|
<% } -%>
|
|
150
161
|
<% }); -%>
|
|
162
|
+
<% } -%>
|
|
151
163
|
<% } else if (action.custom) { -%>
|
|
152
164
|
<% if (action.labelUnresolved) { -%>
|
|
153
165
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
@@ -176,6 +188,11 @@ sap.ui.define([
|
|
|
176
188
|
<% } -%>
|
|
177
189
|
<% } else { -%>
|
|
178
190
|
<% if (action.menuActions) { -%>
|
|
191
|
+
<% if (action.splitButton) { -%>
|
|
192
|
+
// <%- JSON.stringify(action.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:
|
|
193
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
194
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
195
|
+
<% } else { -%>
|
|
179
196
|
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
180
197
|
When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
181
198
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -184,6 +201,7 @@ sap.ui.define([
|
|
|
184
201
|
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
185
202
|
<% } -%>
|
|
186
203
|
<% }); -%>
|
|
204
|
+
<% } -%>
|
|
187
205
|
<% } else if (action.custom) { -%>
|
|
188
206
|
<% if (action.labelUnresolved) { -%>
|
|
189
207
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
@@ -36,9 +36,10 @@ const usesWhenInBody = (bodySections || []).length > 1 || (bodySections || []).s
|
|
|
36
36
|
|| (section.contactCardFields && section.contactCardFields.length > 0)
|
|
37
37
|
|| (section.contactCardColumns && section.contactCardColumns.length > 0)
|
|
38
38
|
|| (section.subSections || []).some(function(sub) { return (sub.contactCardFields && sub.contactCardFields.length > 0) || (sub.contactCardColumns && sub.contactCardColumns.length > 0); })
|
|
39
|
+
|| (section.actions || []).some(function(action) { return action.visible && action.menuActions && !action.splitButton; })
|
|
39
40
|
|| (section.actions || []).some(function(action) { return action.visible && ((action.isCritical && action.enabled !== 'dynamic') || action.menuActions); });
|
|
40
41
|
});
|
|
41
|
-
const headerHasMenu = (headerActions || []).some(function(action) { return action.visible && action.menuActions; });
|
|
42
|
+
const headerHasMenu = (headerActions || []).some(function(action) { return action.visible && action.menuActions && !action.splitButton; });
|
|
42
43
|
-%>
|
|
43
44
|
<% if (usesFieldIdentifier) { -%>
|
|
44
45
|
import type { FieldIdentifier } from "sap/fe/test/api/BaseAPI";
|
|
@@ -82,6 +83,11 @@ function journey() {
|
|
|
82
83
|
<% headerActions.forEach(function(action) { -%>
|
|
83
84
|
<% if (action.visible) { -%>
|
|
84
85
|
<% if (action.menuActions) { -%>
|
|
86
|
+
<% if (action.splitButton) { -%>
|
|
87
|
+
// <%- JSON.stringify(action.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:
|
|
88
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
89
|
+
// When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
90
|
+
<% } else { -%>
|
|
85
91
|
Then.onThe<%- name%>Generated.onHeader().iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
86
92
|
When.onThe<%- name%>Generated.onHeader().iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
87
93
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -90,6 +96,7 @@ function journey() {
|
|
|
90
96
|
// When.onThe<%- name%>Generated.onHeader().iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
91
97
|
<% } -%>
|
|
92
98
|
<% }); -%>
|
|
99
|
+
<% } -%>
|
|
93
100
|
<% } else if (action.custom) { -%>
|
|
94
101
|
<% if (action.labelUnresolved) { -%>
|
|
95
102
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
@@ -167,6 +174,11 @@ function journey() {
|
|
|
167
174
|
<% if (action.visible) { -%>
|
|
168
175
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
169
176
|
<% if (action.menuActions) { -%>
|
|
177
|
+
<% if (action.splitButton) { -%>
|
|
178
|
+
// <%- JSON.stringify(action.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:
|
|
179
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
180
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
181
|
+
<% } else { -%>
|
|
170
182
|
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
171
183
|
When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
172
184
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -175,6 +187,7 @@ function journey() {
|
|
|
175
187
|
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
176
188
|
<% } -%>
|
|
177
189
|
<% }); -%>
|
|
190
|
+
<% } -%>
|
|
178
191
|
<% } else if (action.custom) { -%>
|
|
179
192
|
<% if (action.labelUnresolved) { -%>
|
|
180
193
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|
|
@@ -203,6 +216,11 @@ function journey() {
|
|
|
203
216
|
<% } -%>
|
|
204
217
|
<% } else { -%>
|
|
205
218
|
<% if (action.menuActions) { -%>
|
|
219
|
+
<% if (action.splitButton) { -%>
|
|
220
|
+
// <%- JSON.stringify(action.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:
|
|
221
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
222
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
223
|
+
<% } else { -%>
|
|
206
224
|
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction(<%- JSON.stringify(action.label) %>);
|
|
207
225
|
When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iExecuteAction(<%- JSON.stringify(action.label) %>);
|
|
208
226
|
<% action.menuActions.forEach(function(menuAction) { -%>
|
|
@@ -211,6 +229,7 @@ function journey() {
|
|
|
211
229
|
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iExecuteMenuAction(<%- JSON.stringify(menuAction.label) %>);
|
|
212
230
|
<% } -%>
|
|
213
231
|
<% }); -%>
|
|
232
|
+
<% } -%>
|
|
214
233
|
<% } else if (action.custom) { -%>
|
|
215
234
|
<% if (action.labelUnresolved) { -%>
|
|
216
235
|
// TODO: label is an unresolved i18n key; replace with the rendered action text
|