@sap-ux/ui5-test-writer 1.12.1 → 1.13.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.
@@ -13,7 +13,8 @@ import { hasVirtualOPA5, addVirtualTestConfig } from './utils/virtualOpaUtils.js
13
13
  import { addJourneysToOpaJourneyTypes } from './utils/opaJourneyTypesUtils.js';
14
14
  import { getPackageScripts } from '@sap-ux/fiori-generator-shared';
15
15
  import { readHashFromFlpSandbox } from './utils/flpSandboxUtils.js';
16
- import { isALPManifestTarget } from './utils/listReportUtils.js';
16
+ import { getListReportViews, isALPManifestTarget } from './utils/listReportUtils.js';
17
+ import { resolveOriginatingView } from './utils/objectPageUtils.js';
17
18
  import { compareUI5VersionGte } from '@sap-ux/ui5-application-writer';
18
19
  const __dirname = dirname(fileURLToPath(import.meta.url));
19
20
  const V4_TEMPLATE_LATEST = 'latest';
@@ -109,10 +110,16 @@ export async function generateOPAFiles(basePath, options, metadata, fs, log, sta
109
110
  page.template = 'ListReport';
110
111
  }
111
112
  }
113
+ // Resolve which LR tab the navigated Object Page is reached from, so the multi-tab journey navigates
114
+ // from that tab rather than always the default one (the OP may live on a non-default tab's entity set).
115
+ const navigatedOPTabKey = LROP.pageOP
116
+ ? resolveOriginatingView(getListReportViews(manifest, LROP.pageLR?.targetKey), LROP.pageOP.entitySet, LROP.pageLR?.entitySet)?.key
117
+ : undefined;
112
118
  const journeyParams = {
113
119
  startPages,
114
120
  startLR: LROP.pageLR?.targetKey,
115
121
  navigatedOP: LROP.pageOP?.targetKey,
122
+ navigatedOPTabKey,
116
123
  hideFilterBar: config.hideFilterBar
117
124
  };
118
125
  const writeContext = {
package/dist/types.d.ts CHANGED
@@ -51,6 +51,7 @@ export type JourneyParams = {
51
51
  startPages: string[];
52
52
  startLR: string | undefined;
53
53
  navigatedOP: string | undefined;
54
+ navigatedOPTabKey?: string;
54
55
  hideFilterBar: boolean;
55
56
  };
56
57
  export type FEV4ManifestTarget = {
@@ -182,6 +183,27 @@ export type FilterBarItem = {
182
183
  description: string;
183
184
  custom: boolean;
184
185
  };
186
+ /**
187
+ * Per-tab feature data for a multi-table (Multiple Table Mode) List Report. Each non-custom tab is
188
+ * checked separately (columns, actions, create/delete, contact cards) against its own table.
189
+ */
190
+ export type ListReportTab = {
191
+ key: string;
192
+ entitySet?: string;
193
+ tableColumns: TableColumnFeatureData;
194
+ contactCardColumns: ContactCardField[];
195
+ toolBarActions: ActionButtonState[];
196
+ createButton: {
197
+ enabled?: boolean | string;
198
+ visible?: boolean;
199
+ dynamicPath?: string;
200
+ };
201
+ deleteButton: {
202
+ enabled?: boolean | string;
203
+ visible?: boolean;
204
+ dynamicPath?: string;
205
+ };
206
+ };
185
207
  export type ListReportFeatures = {
186
208
  name?: string;
187
209
  createButton?: {
@@ -209,6 +231,11 @@ export type ListReportFeatures = {
209
231
  * single-table LRs. Used to target a specific tab via `onTable("<key>")`.
210
232
  */
211
233
  tableIdentifiers?: string[];
234
+ /**
235
+ * Per-tab feature data for multi-table List Reports; empty for single-table LRs (in which case the
236
+ * top-level `tableColumns` / `toolBarActions` / `contactCardColumns` describe the single table).
237
+ */
238
+ tabs?: ListReportTab[];
212
239
  semanticKey?: {
213
240
  semanticKeyProperties?: string[];
214
241
  missingFromFilterBar?: string[];
@@ -1,6 +1,6 @@
1
1
  import type { Logger } from '@sap-ux/logger';
2
- import type { TreeAggregations, TreeModel } from '@sap/ux-specification/dist/types/src/parser/index.js';
3
- import type { ActionButtonsResult, ActionButtonState, ButtonState, FEV4ManifestTarget, ListReportFeatures } from '../types.js';
2
+ import type { TreeAggregation, TreeAggregations, TreeModel } from '@sap/ux-specification/dist/types/src/parser/index.js';
3
+ import type { ActionButtonsResult, ActionButtonState, ButtonState, FEV4ManifestTarget, ListReportFeatures, ListReportTab } from '../types.js';
4
4
  import { type I18nLabelResolver } from './i18nUtils.js';
5
5
  import type { ConvertedMetadata } from '@sap-ux/vocabularies-types';
6
6
  import { safeCheckButtonVisibility } from './actionUtils.js';
@@ -68,6 +68,13 @@ export declare function isALPFromManifest(manifest: Manifest, targetKey?: string
68
68
  * @returns feature data extracted from the List Report page model
69
69
  */
70
70
  export declare function getListReportFeatures(listReportPage: PageWithModelV4, log?: Logger, metadata?: string, manifest?: Manifest, resolveLabel?: I18nLabelResolver, annotationXmls?: string[]): ListReportFeatures;
71
+ /**
72
+ * Retrieves toolbar action definitions from a resolved table node.
73
+ *
74
+ * @param tableNode - the table node holding the `toolBar` aggregation
75
+ * @returns The toolbar actions aggregation object.
76
+ */
77
+ export declare function getToolBarActionsFromTableNode(tableNode: TreeAggregation): TreeAggregations;
71
78
  /**
72
79
  * Retrieves toolbar action definitions from the given tree model.
73
80
  *
@@ -76,9 +83,16 @@ export declare function getListReportFeatures(listReportPage: PageWithModelV4, l
76
83
  */
77
84
  export declare function getToolBarActions(pageModel: TreeModel): TreeAggregations;
78
85
  /**
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.
86
+ * Extracts custom (manifest-declared) and menu (drop-down) toolbar actions from a resolved table node.
87
+ *
88
+ * @param tableNode - the table node holding the `toolBar` aggregation
89
+ * @param resolveLabel - resolver for i18n placeholder labels
90
+ * @param convertedMetadata - converted OData metadata, required to resolve annotation-backed menu children
91
+ * @returns array of custom and menu toolbar action button states
92
+ */
93
+ export declare function extractCustomToolBarActionsFromTableNode(tableNode: TreeAggregation, resolveLabel: I18nLabelResolver, convertedMetadata?: ConvertedMetadata): ActionButtonState[];
94
+ /**
95
+ * Extracts custom (manifest-declared) and menu (drop-down) toolbar actions from the List Report table toolbar.
82
96
  *
83
97
  * @param pageModel - the tree model containing the table toolbar definitions
84
98
  * @param resolveLabel - resolver for i18n placeholder labels
@@ -86,6 +100,19 @@ export declare function getToolBarActions(pageModel: TreeModel): TreeAggregation
86
100
  * @returns array of custom and menu toolbar action button states
87
101
  */
88
102
  export declare function extractCustomToolBarActions(pageModel: TreeModel, resolveLabel: I18nLabelResolver, convertedMetadata?: ConvertedMetadata): ActionButtonState[];
103
+ /**
104
+ * Builds the per-tab feature data for a multi-table (Multiple Table Mode) List Report. Each non-custom
105
+ * tab is described by its own columns, contact-card columns, toolbar actions and create/delete state,
106
+ * resolved against that tab's entity set. Returns an empty array for single-table List Reports.
107
+ *
108
+ * @param listReportPage - the List Report page containing the tree model with per-tab table nodes
109
+ * @param convertedMetadata - already-converted OData metadata (undefined disables action/button state resolution)
110
+ * @param manifest - the application manifest, source of the non-custom tab keys and their entity sets
111
+ * @param resolveLabel - resolver for i18n placeholder labels
112
+ * @param log - optional logger instance
113
+ * @returns per-tab feature data in manifest order, empty for single-table List Reports
114
+ */
115
+ export declare function getListReportTabs(listReportPage: PageWithModelV4, convertedMetadata: ConvertedMetadata | undefined, manifest?: Manifest, resolveLabel?: I18nLabelResolver, log?: Logger): ListReportTab[];
89
116
  /**
90
117
  * Retrieves filter field names from the page model using ux-specification.
91
118
  *
@@ -1,6 +1,6 @@
1
1
  import { getFilterFields, getSelectionFieldItems, getSelectionFieldItemsWithLabels, getTableColumnData, getAggregations } from './modelUtils.js';
2
2
  import { passthroughLabelResolver } from './i18nUtils.js';
3
- import { extractContactCardColumnsFromNode, extractTextAnnotationColumnsFromNode, resolvePrimaryTableNode } from './tableUtils.js';
3
+ import { extractContactCardColumnsFromNode, extractContactCardColumnsFromTableNode, extractTableColumnsFromTableNode, extractTextAnnotationColumnsFromNode, resolvePrimaryTableNode, resolveViewTableNodes } from './tableUtils.js';
4
4
  import { parse, merge } from '@sap-ux/edmx-parser';
5
5
  import { convert } from '@sap-ux/annotation-converter';
6
6
  import { extractActionMethodName, buildActionButtonState, buildMenuActionState, isMenuActionItem, collectCriticalActionNames, safeCheckButtonVisibility, safeCheckButtonVisibilityFromMetadata } from './actionUtils.js';
@@ -178,12 +178,25 @@ export function getListReportFeatures(listReportPage, log, metadata, manifest, r
178
178
  textAnnotationColumns,
179
179
  isALP: manifest ? isALPFromManifest(manifest, listReportPage.name) : false,
180
180
  tableIdentifiers: getTableIdentifiers(manifest, listReportPage.name),
181
+ tabs: getListReportTabs(listReportPage, convertedMetadata, manifest, resolveLabel, log),
181
182
  semanticKey: {
182
183
  semanticKeyProperties,
183
184
  missingFromFilterBar: missingKeys?.length ? missingKeys : undefined
184
185
  }
185
186
  };
186
187
  }
188
+ /**
189
+ * Retrieves toolbar action definitions from a resolved table node.
190
+ *
191
+ * @param tableNode - the table node holding the `toolBar` aggregation
192
+ * @returns The toolbar actions aggregation object.
193
+ */
194
+ export function getToolBarActionsFromTableNode(tableNode) {
195
+ const toolBar = getAggregations(tableNode)['toolBar'];
196
+ const toolBarAggregations = getAggregations(toolBar);
197
+ const actions = toolBarAggregations['actions'];
198
+ return getAggregations(actions);
199
+ }
187
200
  /**
188
201
  * Retrieves toolbar action definitions from the given tree model.
189
202
  *
@@ -195,24 +208,19 @@ export function getToolBarActions(pageModel) {
195
208
  if (!tableNode) {
196
209
  return {};
197
210
  }
198
- const toolBar = getAggregations(tableNode)['toolBar'];
199
- const toolBarAggregations = getAggregations(toolBar);
200
- const actions = toolBarAggregations['actions'];
201
- const actionAggregations = getAggregations(actions);
202
- return actionAggregations;
211
+ return getToolBarActionsFromTableNode(tableNode);
203
212
  }
204
213
  /**
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
214
+ * Extracts custom (manifest-declared) and menu (drop-down) toolbar actions from the given toolbar
215
+ * actions aggregation. Annotation-backed single actions are handled separately via the OData metadata
207
216
  * path, so they are not emitted here.
208
217
  *
209
- * @param pageModel - the tree model containing the table toolbar definitions
218
+ * @param actionAggregations - the toolbar actions aggregation
210
219
  * @param resolveLabel - resolver for i18n placeholder labels
211
220
  * @param convertedMetadata - converted OData metadata, required to resolve annotation-backed menu children
212
221
  * @returns array of custom and menu toolbar action button states
213
222
  */
214
- export function extractCustomToolBarActions(pageModel, resolveLabel, convertedMetadata) {
215
- const actionAggregations = getToolBarActions(pageModel);
223
+ function extractCustomToolBarActionsFromAggregation(actionAggregations, resolveLabel, convertedMetadata) {
216
224
  const schemaNamespace = convertedMetadata?.namespace ?? '';
217
225
  const actions = [];
218
226
  for (const key of Object.keys(actionAggregations ?? {})) {
@@ -238,6 +246,78 @@ export function extractCustomToolBarActions(pageModel, resolveLabel, convertedMe
238
246
  }
239
247
  return actions;
240
248
  }
249
+ /**
250
+ * Extracts custom (manifest-declared) and menu (drop-down) toolbar actions from a resolved table node.
251
+ *
252
+ * @param tableNode - the table node holding the `toolBar` aggregation
253
+ * @param resolveLabel - resolver for i18n placeholder labels
254
+ * @param convertedMetadata - converted OData metadata, required to resolve annotation-backed menu children
255
+ * @returns array of custom and menu toolbar action button states
256
+ */
257
+ export function extractCustomToolBarActionsFromTableNode(tableNode, resolveLabel, convertedMetadata) {
258
+ return extractCustomToolBarActionsFromAggregation(getToolBarActionsFromTableNode(tableNode), resolveLabel, convertedMetadata);
259
+ }
260
+ /**
261
+ * Extracts custom (manifest-declared) and menu (drop-down) toolbar actions from the List Report table toolbar.
262
+ *
263
+ * @param pageModel - the tree model containing the table toolbar definitions
264
+ * @param resolveLabel - resolver for i18n placeholder labels
265
+ * @param convertedMetadata - converted OData metadata, required to resolve annotation-backed menu children
266
+ * @returns array of custom and menu toolbar action button states
267
+ */
268
+ export function extractCustomToolBarActions(pageModel, resolveLabel, convertedMetadata) {
269
+ return extractCustomToolBarActionsFromAggregation(getToolBarActions(pageModel), resolveLabel, convertedMetadata);
270
+ }
271
+ /**
272
+ * Builds the per-tab feature data for a multi-table (Multiple Table Mode) List Report. Each non-custom
273
+ * tab is described by its own columns, contact-card columns, toolbar actions and create/delete state,
274
+ * resolved against that tab's entity set. Returns an empty array for single-table List Reports.
275
+ *
276
+ * @param listReportPage - the List Report page containing the tree model with per-tab table nodes
277
+ * @param convertedMetadata - already-converted OData metadata (undefined disables action/button state resolution)
278
+ * @param manifest - the application manifest, source of the non-custom tab keys and their entity sets
279
+ * @param resolveLabel - resolver for i18n placeholder labels
280
+ * @param log - optional logger instance
281
+ * @returns per-tab feature data in manifest order, empty for single-table List Reports
282
+ */
283
+ export function getListReportTabs(listReportPage, convertedMetadata, manifest, resolveLabel = passthroughLabelResolver, log) {
284
+ const views = getListReportViews(manifest, listReportPage.name);
285
+ if (views.length <= 1) {
286
+ return [];
287
+ }
288
+ const viewNodes = resolveViewTableNodes(listReportPage.model.root);
289
+ const nodeByKey = new Map(viewNodes.map((entry) => [entry.key, entry.node]));
290
+ const tabs = [];
291
+ views.forEach((view, index) => {
292
+ // Match the spec-model view node by key; fall back to model order (both lists exclude custom tabs).
293
+ const tableNode = nodeByKey.get(view.key) ?? viewNodes[index]?.node;
294
+ if (!tableNode) {
295
+ return;
296
+ }
297
+ const entitySet = view.entitySet ?? listReportPage.entitySet;
298
+ let toolBarActions = [];
299
+ let createButton = buildButtonState();
300
+ let deleteButton = buildButtonState();
301
+ if (convertedMetadata && entitySet) {
302
+ const actionNames = getToolBarActionItems(getToolBarActionsFromTableNode(tableNode));
303
+ toolBarActions = safeCheckActionButtonStates(convertedMetadata, entitySet, actionNames, log);
304
+ const buttonVisibility = safeCheckButtonVisibilityFromMetadata(convertedMetadata, entitySet, log);
305
+ createButton = buildButtonState(buttonVisibility?.create);
306
+ deleteButton = buildButtonState(buttonVisibility?.delete);
307
+ }
308
+ toolBarActions = toolBarActions.concat(extractCustomToolBarActionsFromTableNode(tableNode, resolveLabel, convertedMetadata));
309
+ tabs.push({
310
+ key: view.key,
311
+ entitySet,
312
+ tableColumns: extractTableColumnsFromTableNode(tableNode),
313
+ contactCardColumns: extractContactCardColumnsFromTableNode(tableNode),
314
+ toolBarActions,
315
+ createButton,
316
+ deleteButton
317
+ });
318
+ });
319
+ return tabs;
320
+ }
241
321
  /**
242
322
  * Retrieves filter field names from the page model using ux-specification.
243
323
  *
@@ -59,6 +59,24 @@ export declare function transformTableColumns(columnAggregations: ColumnAggregat
59
59
  * @returns the table node holding column/toolbar aggregations, or undefined if none is found
60
60
  */
61
61
  export declare function resolvePrimaryTableNode(node: TreeAggregation): TreeAggregation | undefined;
62
+ /**
63
+ * Resolves the per-tab table nodes of a multi-view (Multiple Table Mode) List Report. Each entry pairs
64
+ * the spec-model view key with the table node carrying that tab's `columns`/`toolBar` aggregations.
65
+ *
66
+ * @param node - tree aggregation node that exposes a 'table' aggregation
67
+ * @returns per-view `{ key, node }` entries in model order; empty for single-table List Reports
68
+ */
69
+ export declare function resolveViewTableNodes(node: TreeAggregation): {
70
+ key: string;
71
+ node: TreeAggregation;
72
+ }[];
73
+ /**
74
+ * Extracts table column data from a resolved table node (one carrying a `columns` aggregation).
75
+ *
76
+ * @param tableNode - the table node holding the `columns` aggregation
77
+ * @returns a map of column identifiers to column state objects for use with iCheckColumns()
78
+ */
79
+ export declare function extractTableColumnsFromTableNode(tableNode: TreeAggregation): TableColumnFeatureData;
62
80
  /**
63
81
  * Extracts table column data from a spec model node that contains a 'table' aggregation.
64
82
  * Covers both page-level nodes (List Report, FPM) via their root and section-level nodes
@@ -68,6 +86,13 @@ export declare function resolvePrimaryTableNode(node: TreeAggregation): TreeAggr
68
86
  * @returns a map of column identifiers to column state objects for use with iCheckColumns()
69
87
  */
70
88
  export declare function extractTableColumnsFromNode(node: TreeAggregation): TableColumnFeatureData;
89
+ /**
90
+ * Extracts Contact-card columns from a resolved table node (one carrying a `columns` aggregation).
91
+ *
92
+ * @param tableNode - the table node holding the `columns` aggregation
93
+ * @returns array of Contact-card field descriptors for use with iClickLink/iCheckLink
94
+ */
95
+ export declare function extractContactCardColumnsFromTableNode(tableNode: TreeAggregation): ContactCardField[];
71
96
  /**
72
97
  * Extracts Contact-card columns from a spec model node that contains a 'table' aggregation.
73
98
  *
@@ -45,6 +45,17 @@ export function transformTableColumns(columnAggregations) {
45
45
  });
46
46
  return columns;
47
47
  }
48
+ /**
49
+ * Returns true when a candidate node is a usable table node, i.e. it directly exposes
50
+ * `columns` and/or `toolBar` aggregations.
51
+ *
52
+ * @param node - candidate tree aggregation node
53
+ * @returns true if the node carries column/toolbar aggregations
54
+ */
55
+ function isTableNode(node) {
56
+ const children = getAggregations(node);
57
+ return !!children['columns'] || !!children['toolBar'];
58
+ }
48
59
  /**
49
60
  * Resolves the table node that actually carries `columns`/`toolBar` aggregations.
50
61
  * Single-table List Reports and Object Page sections expose these directly under `table`.
@@ -59,17 +70,11 @@ export function resolvePrimaryTableNode(node) {
59
70
  if (!tableAggregation) {
60
71
  return undefined;
61
72
  }
62
- // A usable table node exposes `columns` and/or `toolBar` directly.
63
- const isTableNode = (candidate) => {
64
- const children = getAggregations(candidate);
65
- return !!children['columns'] || !!children['toolBar'];
66
- };
67
- const tableChildren = getAggregations(tableAggregation);
68
73
  if (isTableNode(tableAggregation)) {
69
74
  return tableAggregation;
70
75
  }
71
76
  // Multi-view List Report: per-tab nodes live under `views`; return the first usable one, else undefined.
72
- const views = tableChildren['views'];
77
+ const views = getAggregations(tableAggregation)['views'];
73
78
  if (!views) {
74
79
  return undefined;
75
80
  }
@@ -83,18 +88,38 @@ export function resolvePrimaryTableNode(node) {
83
88
  return undefined;
84
89
  }
85
90
  /**
86
- * Extracts table column data from a spec model node that contains a 'table' aggregation.
87
- * Covers both page-level nodes (List Report, FPM) via their root and section-level nodes
88
- * (Object Page body sections) — both are TreeAggregation nodes that expose a 'table' aggregation.
91
+ * Resolves the per-tab table nodes of a multi-view (Multiple Table Mode) List Report. Each entry pairs
92
+ * the spec-model view key with the table node carrying that tab's `columns`/`toolBar` aggregations.
89
93
  *
90
94
  * @param node - tree aggregation node that exposes a 'table' aggregation
91
- * @returns a map of column identifiers to column state objects for use with iCheckColumns()
95
+ * @returns per-view `{ key, node }` entries in model order; empty for single-table List Reports
92
96
  */
93
- export function extractTableColumnsFromNode(node) {
94
- const tableNode = resolvePrimaryTableNode(node);
95
- if (!tableNode) {
96
- return {};
97
+ export function resolveViewTableNodes(node) {
98
+ const tableAggregation = getAggregations(node)['table'];
99
+ if (!tableAggregation) {
100
+ return [];
101
+ }
102
+ const views = getAggregations(tableAggregation)['views'];
103
+ if (!views) {
104
+ return [];
105
+ }
106
+ const viewNodes = getAggregations(views);
107
+ const result = [];
108
+ for (const key of Object.keys(viewNodes)) {
109
+ const viewNode = viewNodes[key];
110
+ if (isTableNode(viewNode)) {
111
+ result.push({ key, node: viewNode });
112
+ }
97
113
  }
114
+ return result;
115
+ }
116
+ /**
117
+ * Extracts table column data from a resolved table node (one carrying a `columns` aggregation).
118
+ *
119
+ * @param tableNode - the table node holding the `columns` aggregation
120
+ * @returns a map of column identifiers to column state objects for use with iCheckColumns()
121
+ */
122
+ export function extractTableColumnsFromTableNode(tableNode) {
98
123
  const columnsAggregation = getAggregations(tableNode)['columns'];
99
124
  if (!columnsAggregation) {
100
125
  return {};
@@ -103,16 +128,27 @@ export function extractTableColumnsFromNode(node) {
103
128
  return transformTableColumns(columnItems);
104
129
  }
105
130
  /**
106
- * Extracts Contact-card columns from a spec model node that contains a 'table' aggregation.
131
+ * Extracts table column data from a spec model node that contains a 'table' aggregation.
132
+ * Covers both page-level nodes (List Report, FPM) via their root and section-level nodes
133
+ * (Object Page body sections) — both are TreeAggregation nodes that expose a 'table' aggregation.
107
134
  *
108
135
  * @param node - tree aggregation node that exposes a 'table' aggregation
109
- * @returns array of Contact-card field descriptors for use with iClickLink/iCheckLink
136
+ * @returns a map of column identifiers to column state objects for use with iCheckColumns()
110
137
  */
111
- export function extractContactCardColumnsFromNode(node) {
138
+ export function extractTableColumnsFromNode(node) {
112
139
  const tableNode = resolvePrimaryTableNode(node);
113
140
  if (!tableNode) {
114
- return [];
141
+ return {};
115
142
  }
143
+ return extractTableColumnsFromTableNode(tableNode);
144
+ }
145
+ /**
146
+ * Extracts Contact-card columns from a resolved table node (one carrying a `columns` aggregation).
147
+ *
148
+ * @param tableNode - the table node holding the `columns` aggregation
149
+ * @returns array of Contact-card field descriptors for use with iClickLink/iCheckLink
150
+ */
151
+ export function extractContactCardColumnsFromTableNode(tableNode) {
116
152
  const columnsAggregation = getAggregations(tableNode)['columns'];
117
153
  if (!columnsAggregation) {
118
154
  return [];
@@ -127,6 +163,19 @@ export function extractContactCardColumnsFromNode(node) {
127
163
  });
128
164
  return contactColumns;
129
165
  }
166
+ /**
167
+ * Extracts Contact-card columns from a spec model node that contains a 'table' aggregation.
168
+ *
169
+ * @param node - tree aggregation node that exposes a 'table' aggregation
170
+ * @returns array of Contact-card field descriptors for use with iClickLink/iCheckLink
171
+ */
172
+ export function extractContactCardColumnsFromNode(node) {
173
+ const tableNode = resolvePrimaryTableNode(node);
174
+ if (!tableNode) {
175
+ return [];
176
+ }
177
+ return extractContactCardColumnsFromTableNode(tableNode);
178
+ }
130
179
  /**
131
180
  * Extracts columns that carry a text annotation (`properties.text.artifactType === 'Annotation'`
132
181
  * with a real value) from a spec model node that contains a 'table' aggregation. The
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui5-test-writer",
3
3
  "description": "SAP UI5 tests writer",
4
- "version": "1.12.1",
4
+ "version": "1.13.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -28,11 +28,11 @@
28
28
  "@sap/ux-specification": "1.144.5",
29
29
  "@sap-ux/edmx-parser": "0.10.0",
30
30
  "@sap-ux/annotation-converter": "0.10.22",
31
- "@sap-ux/ui5-application-writer": "2.1.5",
31
+ "@sap-ux/logger": "1.0.3",
32
32
  "@sap-ux/fiori-generator-shared": "1.2.16",
33
33
  "@sap-ux/project-access": "2.2.0",
34
34
  "@sap-ux/preview-middleware": "1.2.14",
35
- "@sap-ux/logger": "1.0.3"
35
+ "@sap-ux/ui5-application-writer": "2.1.5"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@jest/globals": "30.4.1",
@@ -74,6 +74,31 @@ sap.ui.define([
74
74
  // Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
75
75
  // });
76
76
 
77
+ <%_ if (tabs && tabs.length > 0) { -%>
78
+ opaTest("Check table columns and actions per tab", function (Given, When, Then) {
79
+ <%_ tabs.forEach(function(tab) { _%>
80
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
81
+ <%_ if (tab.createButton.visible && !isALP) { _%>
82
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
83
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
84
+ <%_ } _%>
85
+ <%_ if (tab.deleteButton.visible) { _%>
86
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
87
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
88
+ <%_ } _%>
89
+ <%_ tab.toolBarActions.forEach(function(item) { _%>
90
+ <%_ if (item.visible) { _%>
91
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
92
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
93
+ <%_ } _%>
94
+ <%_ }); _%>
95
+ <%_ if (Object.keys(tab.tableColumns).length > 0) { _%>
96
+ Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
97
+ <%_ } _%>
98
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
99
+ <%_ }); -%>
100
+ });
101
+ <%_ } else { -%>
77
102
  <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
78
103
  opaTest("Check table columns and actions", function (Given, When, Then) {
79
104
  <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
@@ -122,6 +147,7 @@ sap.ui.define([
122
147
  <%_ }); -%>
123
148
  });
124
149
  <%_ } -%>
150
+ <%_ } -%>
125
151
 
126
152
  <%_ if (startLR) { -%>
127
153
  opaTest("Navigate to ObjectPage", function (Given, When, Then) {
@@ -129,21 +155,21 @@ sap.ui.define([
129
155
  <%_ if (!hideFilterBar) { -%>
130
156
  When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
131
157
  <%_ } -%>
132
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { -%>
133
- <%_ tableIdentifiers.forEach(function(tabId) { _%>
134
- When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tabId %>" });
135
- Then.onThe<%- startLR%>Generated.onTable("<%- tabId %>").iCheckRows();
136
- <%_ }); -%>
158
+ <%_ if (tabs && tabs.length > 0) { -%>
159
+ <%_ const navTabId = navigatedOPTabKey || tableIdentifiers[0]; -%>
160
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- navTabId %>" });
161
+ Then.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iCheckRows();
162
+ <%_ if (navigatedOP) { -%>
163
+ When.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iPressRow(0);
164
+ Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
165
+ <%_ } -%>
137
166
  <%_ } else { -%>
138
167
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
139
- <%_ } -%>
140
168
  <%_ if (navigatedOP) { -%>
141
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { _%>
142
- When.onThe<%- startLR%>Generated.iGoToView({ key: defaultTableId });
143
- <%_ } _%>
144
169
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressRow(0);
145
170
  Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
146
171
  <%_ } -%>
172
+ <%_ } -%>
147
173
  });
148
174
  <%_ } -%>
149
175
 
@@ -82,6 +82,31 @@ function journey() {
82
82
  // Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
83
83
  // });
84
84
 
85
+ <%_ if (tabs && tabs.length > 0) { -%>
86
+ opaTest("Check table columns and actions per tab", function (_Given: Given, When: When, Then: Then) {
87
+ <%_ tabs.forEach(function(tab) { _%>
88
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
89
+ <%_ if (tab.createButton.visible && !isALP) { _%>
90
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
91
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
92
+ <%_ } _%>
93
+ <%_ if (tab.deleteButton.visible) { _%>
94
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
95
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
96
+ <%_ } _%>
97
+ <%_ tab.toolBarActions.forEach(function(item) { _%>
98
+ <%_ if (item.visible) { _%>
99
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
100
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
101
+ <%_ } _%>
102
+ <%_ }); _%>
103
+ <%_ if (Object.keys(tab.tableColumns).length > 0) { _%>
104
+ Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
105
+ <%_ } _%>
106
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
107
+ <%_ }); -%>
108
+ });
109
+ <%_ } else { -%>
85
110
  <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
86
111
  opaTest("Check table columns and actions", function (_Given: Given, <% if (toolBarHasMenu) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
87
112
  <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
@@ -130,6 +155,7 @@ function journey() {
130
155
  <%_ }); -%>
131
156
  });
132
157
  <%_ } -%>
158
+ <%_ } -%>
133
159
 
134
160
  <%_ if (startLR) { -%>
135
161
  opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
@@ -137,21 +163,21 @@ function journey() {
137
163
  <%_ if (!hideFilterBar) { -%>
138
164
  When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
139
165
  <%_ } -%>
140
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { -%>
141
- <%_ tableIdentifiers.forEach(function(tabId) { _%>
142
- When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tabId %>" });
143
- Then.onThe<%- startLR%>Generated.onTable("<%- tabId %>").iCheckRows();
144
- <%_ }); -%>
166
+ <%_ if (tabs && tabs.length > 0) { -%>
167
+ <%_ const navTabId = navigatedOPTabKey || tableIdentifiers[0]; -%>
168
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- navTabId %>" });
169
+ Then.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iCheckRows();
170
+ <%_ if (navigatedOP) { -%>
171
+ When.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iPressRow(0);
172
+ Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
173
+ <%_ } -%>
145
174
  <%_ } else { -%>
146
175
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
147
- <%_ } -%>
148
176
  <%_ if (navigatedOP) { -%>
149
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { _%>
150
- When.onThe<%- startLR%>Generated.iGoToView({ key: defaultTableId });
151
- <%_ } _%>
152
177
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressRow(0);
153
178
  Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
154
179
  <%_ } -%>
180
+ <%_ } -%>
155
181
  });
156
182
  <%_ } -%>
157
183
 
@@ -65,6 +65,7 @@ function journey() {
65
65
  Then.onThe<%- name%>Generated.iSeeThisPage();
66
66
  });
67
67
 
68
+
68
69
  <% if (headerActions?.length > 0) { -%>
69
70
  opaTest("Check header actions of the Object Page", function (_Given: Given, <% if (headerHasMenu) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
70
71
  <% if (editButton?.visible) { -%>
@@ -74,6 +74,48 @@ sap.ui.define([
74
74
  // Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
75
75
  // });
76
76
 
77
+ <%_ if (tabs && tabs.length > 0) { -%>
78
+ opaTest("Check table columns and actions per tab", function (Given, When, Then) {
79
+ <%_ tabs.forEach(function(tab) { _%>
80
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
81
+ <%_ if (tab.createButton.visible && !isALP) { _%>
82
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
83
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
84
+ <%_ } _%>
85
+ <%_ if (tab.deleteButton.visible) { _%>
86
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
87
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
88
+ <%_ } _%>
89
+ <%_ tab.toolBarActions.forEach(function(item) { _%>
90
+ <%_ if (item.visible) { _%>
91
+ <%_ if (item.custom) { _%>
92
+ <%_ if (item.labelUnresolved) { _%>
93
+ // TODO: label is an unresolved i18n key; replace with the rendered action text
94
+ <%_ } _%>
95
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
96
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { visible: true });
97
+ <%_ } else { _%>
98
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
99
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
100
+ <%_ } _%>
101
+ <%_ } _%>
102
+ <%_ }); _%>
103
+ <%_ if (Object.keys(tab.tableColumns).length > 0) { _%>
104
+ Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
105
+ <%_ } _%>
106
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
107
+ <%_ if (tab.contactCardColumns.length > 0) { _%>
108
+ // Reveal popin details so low-priority (e.g. contact-card) columns become clickable
109
+ When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iExecuteShowHideDetails(true);
110
+ <%_ } _%>
111
+ <%_ tab.contactCardColumns.forEach(function(column) { _%>
112
+ // May fail if the mock data has no row at index 0 or that row does not render the contact link; adjust the row selector if needed.
113
+ When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iClickLink(0, "<%- column.property %>");
114
+ Then.onThe<%- startLR %>Generated.onDialog().iCheckContactDialog({ controlType: "sap.ui.mdc.link.Panel" });
115
+ <%_ }); _%>
116
+ <%_ }); -%>
117
+ });
118
+ <%_ } else { -%>
77
119
  <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
78
120
  opaTest("Check table columns and actions", function (Given, When, Then) {
79
121
  <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
@@ -151,6 +193,8 @@ sap.ui.define([
151
193
 
152
194
  <%_ if (contactCardColumns.length > 0) { -%>
153
195
  opaTest("Check contact card links", function (Given, When, Then) {
196
+ // Reveal popin details so low-priority (e.g. contact-card) columns become clickable
197
+ When.onThe<%- startLR %>Generated.onTable(defaultTableId).iExecuteShowHideDetails(true);
154
198
  <%_ contactCardColumns.forEach(function(column) { _%>
155
199
  // May fail if the mock data has no row at index 0 or that row does not render the contact link; adjust the row selector if needed.
156
200
  When.onThe<%- startLR %>Generated.onTable(defaultTableId).iClickLink(0, "<%- column.property %>");
@@ -158,27 +202,28 @@ sap.ui.define([
158
202
  <%_ }); -%>
159
203
  });
160
204
  <%_ } -%>
205
+ <%_ } -%>
161
206
  <%_ if (startLR) { -%>
162
207
  opaTest("Navigate to ObjectPage", function (Given, When, Then) {
163
208
  // Note: this test will fail if the ListReport page doesn't show any data
164
209
  <%_ if (!hideFilterBar) { -%>
165
210
  When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
166
211
  <%_ } -%>
167
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { -%>
168
- <%_ tableIdentifiers.forEach(function(tabId) { _%>
169
- When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tabId %>" });
170
- Then.onThe<%- startLR%>Generated.onTable("<%- tabId %>").iCheckRows();
171
- <%_ }); -%>
212
+ <%_ if (tabs && tabs.length > 0) { -%>
213
+ <%_ const navTabId = navigatedOPTabKey || tableIdentifiers[0]; -%>
214
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- navTabId %>" });
215
+ Then.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iCheckRows();
216
+ <%_ if (navigatedOP) { -%>
217
+ When.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iPressRow(0);
218
+ Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
219
+ <%_ } -%>
172
220
  <%_ } else { -%>
173
221
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
174
- <%_ } -%>
175
222
  <%_ if (navigatedOP) { -%>
176
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { _%>
177
- When.onThe<%- startLR%>Generated.iGoToView({ key: defaultTableId });
178
- <%_ } _%>
179
223
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressRow(0);
180
224
  Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
181
225
  <%_ } -%>
226
+ <%_ } -%>
182
227
  });
183
228
  <%_ } -%>
184
229
 
@@ -82,6 +82,48 @@ function journey() {
82
82
  // Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
83
83
  // });
84
84
 
85
+ <%_ if (tabs && tabs.length > 0) { -%>
86
+ opaTest("Check table columns and actions per tab", function (_Given: Given, When: When, Then: Then) {
87
+ <%_ tabs.forEach(function(tab) { _%>
88
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
89
+ <%_ if (tab.createButton.visible && !isALP) { _%>
90
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
91
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
92
+ <%_ } _%>
93
+ <%_ if (tab.deleteButton.visible) { _%>
94
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
95
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
96
+ <%_ } _%>
97
+ <%_ tab.toolBarActions.forEach(function(item) { _%>
98
+ <%_ if (item.visible) { _%>
99
+ <%_ if (item.custom) { _%>
100
+ <%_ if (item.labelUnresolved) { _%>
101
+ // TODO: label is an unresolved i18n key; replace with the rendered action text
102
+ <%_ } _%>
103
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
104
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { visible: true });
105
+ <%_ } else { _%>
106
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
107
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
108
+ <%_ } _%>
109
+ <%_ } _%>
110
+ <%_ }); _%>
111
+ <%_ if (Object.keys(tab.tableColumns).length > 0) { _%>
112
+ Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
113
+ <%_ } _%>
114
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
115
+ <%_ if (tab.contactCardColumns.length > 0) { _%>
116
+ // Reveal popin details so low-priority (e.g. contact-card) columns become clickable; no-op on grid/analytical tables.
117
+ When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iExecuteShowHideDetails(true);
118
+ <%_ } _%>
119
+ <%_ tab.contactCardColumns.forEach(function(column) { _%>
120
+ // May fail if the mock data has no row at index 0 or that row does not render the contact link; adjust the row selector if needed.
121
+ When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iClickLink(0, "<%- column.property %>");
122
+ Then.onThe<%- startLR %>Generated.onDialog().iCheckContactDialog({ controlType: "sap.ui.mdc.link.Panel" });
123
+ <%_ }); _%>
124
+ <%_ }); -%>
125
+ });
126
+ <%_ } else { -%>
85
127
  <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
86
128
  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) {
87
129
  <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
@@ -159,6 +201,8 @@ function journey() {
159
201
 
160
202
  <%_ if (contactCardColumns.length > 0) { -%>
161
203
  opaTest("Check contact card links", function (_Given: Given, When: When, Then: Then) {
204
+ // Reveal popin details so low-priority (e.g. contact-card) columns become clickable; no-op on grid/analytical tables.
205
+ When.onThe<%- startLR %>Generated.onTable(defaultTableId).iExecuteShowHideDetails(true);
162
206
  <%_ contactCardColumns.forEach(function(column) { _%>
163
207
  // May fail if the mock data has no row at index 0 or that row does not render the contact link; adjust the row selector if needed.
164
208
  When.onThe<%- startLR %>Generated.onTable(defaultTableId).iClickLink(0, "<%- column.property %>");
@@ -166,27 +210,28 @@ function journey() {
166
210
  <%_ }); -%>
167
211
  });
168
212
  <%_ } -%>
213
+ <%_ } -%>
169
214
  <%_ if (startLR) { -%>
170
215
  opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
171
216
  // Note: this test will fail if the ListReport page doesn't show any data
172
217
  <%_ if (!hideFilterBar) { -%>
173
218
  When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
174
219
  <%_ } -%>
175
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { -%>
176
- <%_ tableIdentifiers.forEach(function(tabId) { _%>
177
- When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tabId %>" });
178
- Then.onThe<%- startLR%>Generated.onTable("<%- tabId %>").iCheckRows();
179
- <%_ }); -%>
220
+ <%_ if (tabs && tabs.length > 0) { -%>
221
+ <%_ const navTabId = navigatedOPTabKey || tableIdentifiers[0]; -%>
222
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- navTabId %>" });
223
+ Then.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iCheckRows();
224
+ <%_ if (navigatedOP) { -%>
225
+ When.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iPressRow(0);
226
+ Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
227
+ <%_ } -%>
180
228
  <%_ } else { -%>
181
229
  Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
182
- <%_ } -%>
183
230
  <%_ if (navigatedOP) { -%>
184
- <%_ if (tableIdentifiers && tableIdentifiers.length > 0) { _%>
185
- When.onThe<%- startLR%>Generated.iGoToView({ key: defaultTableId });
186
- <%_ } _%>
187
231
  When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressRow(0);
188
232
  Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
189
233
  <%_ } -%>
234
+ <%_ } -%>
190
235
  });
191
236
  <%_ } -%>
192
237