@sap-ux/ui5-test-writer 1.15.2 → 1.15.4

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.
Files changed (27) hide show
  1. package/dist/fiori-elements-opa-writer.d.ts +3 -3
  2. package/dist/fiori-elements-opa-writer.js +6 -5
  3. package/package.json +4 -4
  4. package/templates/v4/1.148/integration/FirstJourney.js +5 -5
  5. package/templates/v4/1.152/integration/FPMJourney.js +43 -0
  6. package/templates/v4/1.152/integration/FPMJourney.ts +40 -0
  7. package/templates/v4/1.152/integration/FirstJourney.js +37 -0
  8. package/templates/v4/1.152/integration/FirstJourney.ts +34 -0
  9. package/templates/v4/1.152/integration/ListReportJourney.js +261 -0
  10. package/templates/v4/1.152/integration/ListReportJourney.ts +271 -0
  11. package/templates/v4/1.152/integration/ObjectPageJourney.js +301 -0
  12. package/templates/v4/1.152/integration/ObjectPageJourney.ts +328 -0
  13. package/templates/v4/1.152/integration/opaTests.qunit.html +28 -0
  14. package/templates/v4/1.152/integration/opaTests.qunit.js +33 -0
  15. package/templates/v4/1.152/integration/pages/FPM.js +30 -0
  16. package/templates/v4/1.152/integration/pages/FPM.ts +25 -0
  17. package/templates/v4/1.152/integration/pages/JourneyRunner.js +17 -0
  18. package/templates/v4/1.152/integration/pages/JourneyRunner.ts +36 -0
  19. package/templates/v4/1.152/integration/pages/ListReport.js +35 -0
  20. package/templates/v4/1.152/integration/pages/ListReport.ts +25 -0
  21. package/templates/v4/1.152/integration/pages/ObjectPage.js +35 -0
  22. package/templates/v4/1.152/integration/pages/ObjectPage.ts +25 -0
  23. package/templates/v4/1.152/integration/types/OpaJourneyTypes.d.ts +79 -0
  24. package/templates/v4/1.84/integration/FirstJourney.js +5 -5
  25. package/templates/v4/latest/integration/FirstJourney.js +5 -5
  26. package/templates/v4/latest/integration/ListReportJourney.js +6 -6
  27. package/templates/v4/latest/integration/ListReportJourney.ts +6 -6
@@ -5,11 +5,11 @@ import type { Logger } from '@sap-ux/logger';
5
5
  /**
6
6
  * Removes action tests the target template bucket cannot render, so journeys omit them instead of
7
7
  * emitting assertions that fail on older runtimes:
8
- * - custom (manifest-declared) actions: rendered only by the `latest` bucket.
9
- * - menu (drop-down) actions: rendered by `1.148` and `latest`; the `1.84` bucket has no menu template.
8
+ * - custom (manifest-declared) actions: rendered only by `1.152` and `latest` buckets.
9
+ * - menu (drop-down) actions: rendered by `1.148`, `1.152`, and `latest`; the `1.84` bucket has no menu template.
10
10
  *
11
11
  * @param appFeatures - the extracted app feature data (mutated in place)
12
- * @param templateUi5Version - the selected template bucket ('1.84' / '1.148' / 'latest')
12
+ * @param templateUi5Version - the selected template bucket ('1.84' / '1.148' / '1.152' / 'latest')
13
13
  */
14
14
  export declare function removeUnsupportedActions(appFeatures: AppFeatures, templateUi5Version: string): void;
15
15
  /**
@@ -20,7 +20,8 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
20
20
  const V4_TEMPLATE_LATEST = 'latest';
21
21
  const V4_TEMPLATE_1_84 = '1.84';
22
22
  const V4_TEMPLATE_BUCKETS = [
23
- { minVersion: '1.149.0', template: V4_TEMPLATE_LATEST },
23
+ { minVersion: '1.153.0', template: V4_TEMPLATE_LATEST },
24
+ { minVersion: '1.152.0', template: '1.152' },
24
25
  { minVersion: '1.148.0', template: '1.148' }
25
26
  ];
26
27
  function getTemplateUi5Version(ui5Version) {
@@ -37,14 +38,14 @@ function getTemplateUi5Version(ui5Version) {
37
38
  /**
38
39
  * Removes action tests the target template bucket cannot render, so journeys omit them instead of
39
40
  * emitting assertions that fail on older runtimes:
40
- * - custom (manifest-declared) actions: rendered only by the `latest` bucket.
41
- * - menu (drop-down) actions: rendered by `1.148` and `latest`; the `1.84` bucket has no menu template.
41
+ * - custom (manifest-declared) actions: rendered only by `1.152` and `latest` buckets.
42
+ * - menu (drop-down) actions: rendered by `1.148`, `1.152`, and `latest`; the `1.84` bucket has no menu template.
42
43
  *
43
44
  * @param appFeatures - the extracted app feature data (mutated in place)
44
- * @param templateUi5Version - the selected template bucket ('1.84' / '1.148' / 'latest')
45
+ * @param templateUi5Version - the selected template bucket ('1.84' / '1.148' / '1.152' / 'latest')
45
46
  */
46
47
  export function removeUnsupportedActions(appFeatures, templateUi5Version) {
47
- const stripCustom = templateUi5Version !== V4_TEMPLATE_LATEST;
48
+ const stripCustom = templateUi5Version !== V4_TEMPLATE_LATEST && templateUi5Version !== '1.152';
48
49
  const stripMenu = templateUi5Version === V4_TEMPLATE_1_84;
49
50
  if (!stripCustom && !stripMenu) {
50
51
  return;
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.15.2",
4
+ "version": "1.15.4",
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/fiori-generator-shared": "1.2.18",
31
+ "@sap-ux/ui5-application-writer": "2.1.5",
32
32
  "@sap-ux/logger": "1.0.3",
33
+ "@sap-ux/fiori-generator-shared": "1.2.18",
33
34
  "@sap-ux/project-access": "2.2.1",
34
- "@sap-ux/preview-middleware": "1.2.20",
35
- "@sap-ux/ui5-application-writer": "2.1.5"
35
+ "@sap-ux/preview-middleware": "1.2.21"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@jest/globals": "30.4.1",
@@ -11,19 +11,19 @@ sap.ui.define([
11
11
  Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
12
12
  Given.iResetTestData();
13
13
  Given.iStartMyApp();
14
- <% if (startLR) { %>Then.onThe<%- startLR %>.iSeeThisPage();<%} %>
14
+ <% if (startLR) { %>Then.onThe<%- startLR %>Generated.iSeeThisPage();<%} %>
15
15
  });
16
16
 
17
17
  <% if (startLR) { %>
18
18
  opaTest("Navigate to ObjectPage", function (Given, When, Then) {
19
19
  // Note: this test will fail if the ListReport page doesn't show any data
20
20
  <% if (!hideFilterBar) { %>
21
- When.onThe<%- startLR%>.onFilterBar().iExecuteSearch();
21
+ When.onThe<%- startLR %>Generated.onFilterBar().iExecuteSearch();
22
22
  <%} %>
23
- Then.onThe<%- startLR%>.onTable().iCheckRows();
23
+ Then.onThe<%- startLR %>Generated.onTable().iCheckRows();
24
24
  <% if (navigatedOP) { %>
25
- When.onThe<%- startLR%>.onTable().iPressRow(0);
26
- Then.onThe<%- navigatedOP%>.iSeeThisPage();
25
+ When.onThe<%- startLR %>Generated.onTable().iPressRow(0);
26
+ Then.onThe<%- navigatedOP %>Generated.iSeeThisPage();
27
27
  <%} %>
28
28
  });
29
29
  <%} %>
@@ -0,0 +1,43 @@
1
+ /******************************************************************************
2
+ * ╔═══════════════════════════════════════════════════════════════════════╗ *
3
+ * ║ ║ *
4
+ * ║ WARNING: AUTO-GENERATED FILE ║ *
5
+ * ║ ║ *
6
+ * ║ This file is automatically generated by SAP Fiori tools and is ║ *
7
+ * ║ overwritten when you run the OPA test generator again. ║ *
8
+ * ║ ║ *
9
+ * ║ To add your own custom tests: ║ *
10
+ * ║ - Create a new journey test file in this directory. ║ *
11
+ * ║ - Follow the same pattern as this file. ║ *
12
+ * ║ - Add the new file to the opaTests.qunit.js config file. ║ *
13
+ * ║ - Custom journey files are not overwritten. ║ *
14
+ * ║ ║ *
15
+ * ╚═══════════════════════════════════════════════════════════════════════╝ *
16
+ ******************************************************************************/
17
+
18
+ sap.ui.define([
19
+ "sap/ui/test/opaQunit",
20
+ "./pages/JourneyRunner"
21
+ ], function (opaTest, runner) {
22
+ "use strict";
23
+
24
+ function journey() {
25
+ QUnit.module("<%- name %> Journey");
26
+
27
+ opaTest("Start application", function (Given, When, Then) {
28
+ Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
29
+ Given.iResetTestData();
30
+ Given.iStartMyApp();
31
+ <%_ startPages.forEach(function(pageName) { %>
32
+ Then.onThe<%- pageName %>Generated.iSeeThisPage();
33
+ <%_ }); -%>
34
+ });
35
+
36
+ opaTest("Teardown", function (Given, When, Then) {
37
+ // Cleanup
38
+ Given.iTearDownMyApp();
39
+ });
40
+ }
41
+
42
+ runner.run([journey]);
43
+ });
@@ -0,0 +1,40 @@
1
+ /******************************************************************************
2
+ * ╔═══════════════════════════════════════════════════════════════════════╗ *
3
+ * ║ ║ *
4
+ * ║ WARNING: AUTO-GENERATED FILE ║ *
5
+ * ║ ║ *
6
+ * ║ This file is automatically generated by SAP Fiori tools and is ║ *
7
+ * ║ overwritten when you run the OPA test generator again. ║ *
8
+ * ║ ║ *
9
+ * ║ To add your own custom tests: ║ *
10
+ * ║ - Create a new journey test file in this directory. ║ *
11
+ * ║ - Follow the same pattern as this file. ║ *
12
+ * ║ - Add the new file to the opaTests.qunit.js config file. ║ *
13
+ * ║ - Custom journey files are not overwritten. ║ *
14
+ * ║ ║ *
15
+ * ╚═══════════════════════════════════════════════════════════════════════╝ *
16
+ ******************************************************************************/
17
+
18
+ import opaTest from "sap/ui/test/opaQunit";
19
+ import type { Given, When, Then } from "./types/OpaJourneyTypes.gen";
20
+ import runner from "./pages/JourneyRunner";
21
+
22
+ function journey() {
23
+ QUnit.module("<%- name %> Journey");
24
+
25
+ opaTest("Start application", function (Given: Given, _When: When, Then: Then) {
26
+ Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
27
+ Given.iResetTestData();
28
+ Given.iStartMyApp();
29
+ <%_ startPages.forEach(function(pageName) { %>
30
+ Then.onThe<%- pageName %>Generated.iSeeThisPage();
31
+ <%_ }); -%>
32
+ });
33
+
34
+ opaTest("Teardown", function (Given: Given) {
35
+ // Cleanup
36
+ Given.iTearDownMyApp();
37
+ });
38
+ }
39
+
40
+ runner.run([journey]);
@@ -0,0 +1,37 @@
1
+ sap.ui.define([
2
+ "sap/ui/test/opaQunit",
3
+ "./pages/JourneyRunner"
4
+ ], function (opaTest, runner) {
5
+ "use strict";
6
+
7
+ function journey() {
8
+ QUnit.module("First journey");
9
+
10
+ opaTest("Start application", function (Given, When, Then) {
11
+ Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
12
+ Given.iResetTestData();
13
+ Given.iStartMyApp();
14
+ <% if (startLR) { %>Then.onThe<%- startLR %>Generated.iSeeThisPage();<%} %>
15
+ });
16
+
17
+ <% if (startLR) { %>
18
+ opaTest("Navigate to ObjectPage", function (Given, When, Then) {
19
+ // Note: this test will fail if the ListReport page doesn't show any data
20
+ <% if (!hideFilterBar) { %>
21
+ When.onThe<%- startLR %>Generated.onFilterBar().iExecuteSearch();
22
+ <%} %>
23
+ Then.onThe<%- startLR %>Generated.onTable().iCheckRows();
24
+ <% if (navigatedOP) { %>
25
+ When.onThe<%- startLR %>Generated.onTable().iPressRow(0);
26
+ Then.onThe<%- navigatedOP %>Generated.iSeeThisPage();
27
+ <%} %>
28
+ });
29
+ <%} %>
30
+ opaTest("Teardown", function (Given, When, Then) {
31
+ // Cleanup
32
+ Given.iTearDownMyApp();
33
+ });
34
+ }
35
+
36
+ runner.run([journey]);
37
+ });
@@ -0,0 +1,34 @@
1
+ import opaTest from "sap/ui/test/opaQunit";
2
+ import type { Given, When, Then } from "./types/OpaJourneyTypes.gen";
3
+ import runner from "./pages/JourneyRunner";
4
+
5
+ function journey() {
6
+ QUnit.module("First journey");
7
+
8
+ opaTest("Start application", function (Given: Given, _When: When<% if (startLR) { %>, Then: Then<% } else { %>, _Then: Then<% } %>) {
9
+ Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
10
+ Given.iResetTestData();
11
+ Given.iStartMyApp();
12
+ <% if (startLR) { %>Then.onThe<%- startLR %>Generated.iSeeThisPage();<%} %>
13
+ });
14
+
15
+ <% if (startLR) { %>
16
+ opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
17
+ // Note: this test will fail if the ListReport page doesn't show any data
18
+ <% if (!hideFilterBar) { %>
19
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
20
+ <%} %>
21
+ Then.onThe<%- startLR%>Generated.onTable("").iCheckRows();
22
+ <% if (navigatedOP) { %>
23
+ When.onThe<%- startLR%>Generated.onTable("").iPressRow(0);
24
+ Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
25
+ <%} %>
26
+ });
27
+ <%} %>
28
+ opaTest("Teardown", function (Given: Given) {
29
+ // Cleanup
30
+ Given.iTearDownMyApp();
31
+ });
32
+ }
33
+
34
+ runner.run([journey]);
@@ -0,0 +1,261 @@
1
+ /******************************************************************************
2
+ * ╔═══════════════════════════════════════════════════════════════════════╗ *
3
+ * ║ ║ *
4
+ * ║ WARNING: AUTO-GENERATED FILE ║ *
5
+ * ║ ║ *
6
+ * ║ This file is automatically generated by SAP Fiori tools and is ║ *
7
+ * ║ overwritten when you run the OPA test generator again. ║ *
8
+ * ║ ║ *
9
+ * ║ To add your own custom tests: ║ *
10
+ * ║ - Create a new journey test file in this directory. ║ *
11
+ * ║ - Follow the same pattern as this file. ║ *
12
+ * ║ - Add the new file to the opaTests.qunit.js config file. ║ *
13
+ * ║ - Custom journey files are not overwritten. ║ *
14
+ * ║ ║ *
15
+ * ╚═══════════════════════════════════════════════════════════════════════╝ *
16
+ ******************************************************************************/
17
+
18
+ sap.ui.define([
19
+ "sap/ui/test/opaQunit",
20
+ "./pages/JourneyRunner"<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>,
21
+ "sap/ui/core/library"<% } %>
22
+ ], function (opaTest, runner<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>, coreLibrary<% } %>) {
23
+ "use strict";
24
+
25
+ function journey() {
26
+ QUnit.module("<%- name%>ListReport journey");
27
+
28
+ const defaultTableId = <%- tableIdentifiers && tableIdentifiers.length > 0 ? '"' + tableIdentifiers[0] + '"' : '""' %>;
29
+
30
+ opaTest("Start application", function (Given, When, Then) {
31
+ Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
32
+ Given.iResetTestData();
33
+ Given.iStartMyApp();
34
+ <%_ startPages.forEach(function(pageName) { %>
35
+ Then.onThe<%- pageName %>Generated.iSeeThisPage();
36
+ <%_ }); -%>
37
+ });
38
+
39
+ <%_ if (!hideFilterBar && filterBarItems && filterBarItems.length > 0) { -%>
40
+ opaTest("Check filter bar", function (Given, When, Then) {
41
+ <%_ filterBarItems.forEach(function(item) { _%>
42
+ <%_ if (item.custom) { _%>
43
+ Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField("<%- item.description %>");
44
+ <%_ } else { _%>
45
+ Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField({ property: "<%- item.property %>" });
46
+ <%_ } _%>
47
+ <%_ }); -%>
48
+ });
49
+ <%_ } -%>
50
+ <%_ if (semanticKey && semanticKey.missingFromFilterBar && semanticKey.missingFromFilterBar.length > 0) { %>
51
+ opaTest("Add semantic key properties to filter bar", function (Given, When, Then) {
52
+ When.onThe<%- startLR%>Generated.onFilterBar().iOpenFilterAdaptation();
53
+ <%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
54
+ When.onThe<%- startLR%>Generated.onFilterBar().iAddAdaptationFilterField({ property: "<%- property %>" });
55
+ <%_ }); -%>
56
+ When.onThe<%- startLR%>Generated.onFilterBar().iConfirmFilterAdaptation();
57
+ <%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
58
+ Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField({ property: "<%- property %>" });
59
+ <%_ }); -%>
60
+ <%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
61
+ // When.onThe<%- startLR%>Generated.onFilterBar().iChangeFilterField({ property: "<%- property %>" }, "<value to filter>", false);
62
+ <%_ }); -%>
63
+ // When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
64
+ // Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
65
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
66
+ // Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<Action Name>", { enabled: true });
67
+ });
68
+ <%_ } -%>
69
+
70
+ // Note: this test will only work if the ListReport page has a search field and shows data that matches the search term. Please ensure that the test data and search term are set up accordingly.
71
+ // opaTest("Perform a global search and check the result", function (Given, When, Then) {
72
+ // When.onThe<%- startLR%>Generated.onFilterBar().iChangeSearchField("Search Term");
73
+ // When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
74
+ // Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
75
+ // When.onThe<%- startLR%>Generated.onFilterBar().iChangeSearchField(undefined);
76
+ // Then.onThe<%- startLR%>Generated.onFilterBar().iCheckSearchField(undefined);
77
+ // });
78
+
79
+ <%_ if (tabs && tabs.length > 0) { -%>
80
+ opaTest("Check table columns and actions per tab", function (Given, When, Then) {
81
+ <%_ tabs.forEach(function(tab) { _%>
82
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
83
+ <%_ if (tab.createButton.visible && !isALP) { _%>
84
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckCreate({ visible: true });
85
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressCreate();
86
+ <%_ } _%>
87
+ <%_ if (tab.deleteButton.visible) { _%>
88
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressDelete();
89
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckDelete({ visible: true });
90
+ <%_ } _%>
91
+ <%_ tab.toolBarActions.forEach(function(item) { _%>
92
+ <%_ if (item.visible) { _%>
93
+ <%_ if (item.custom) { _%>
94
+ <%_ if (item.labelUnresolved) { _%>
95
+ // TODO: label is an unresolved i18n key; replace with the rendered action text
96
+ <%_ } _%>
97
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction("<%- item.label %>");
98
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction("<%- item.label %>", { visible: true });
99
+ <%_ } else { _%>
100
+ // When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iPressAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
101
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: <%- item.enabled === true %> });
102
+ <%_ } _%>
103
+ <%_ } _%>
104
+ <%_ }); _%>
105
+ <%_ if (Object.keys(tab.tableColumns).length > 0) { _%>
106
+ Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
107
+ <%_ } _%>
108
+ Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckRows();
109
+ <%_ if (tab.contactCardColumns.length > 0) { _%>
110
+ // Reveal popin details so low-priority (e.g. contact-card) columns become clickable
111
+ When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iExecuteShowHideDetails(true);
112
+ <%_ } _%>
113
+ <%_ tab.contactCardColumns.forEach(function(column) { _%>
114
+ // 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.
115
+ When.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iClickLink(0, "<%- column.property %>");
116
+ Then.onThe<%- startLR %>Generated.onDialog().iCheckContactDialog({ controlType: "sap.ui.mdc.link.Panel" });
117
+ <%_ }); _%>
118
+ <%_ }); -%>
119
+ });
120
+ <%_ } else { -%>
121
+ <%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
122
+ opaTest("Check table columns and actions", function (Given, When, Then) {
123
+ <%_ if (toolBarActions && toolBarActions.length > 0) { -%>
124
+ <%_ if (createButton.visible && !isALP) { _%>
125
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
126
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
127
+ <%_ } _%>
128
+ <%_ if (deleteButton.visible) { _%>
129
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
130
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
131
+ <%_ } _%>
132
+ <%_ const toolBarHasDialogAction = (toolBarActions || []).some(function(action) { return action.visible && !action.menuActions && !action.custom && action.enabled !== 'dynamic' && (action.isCritical || (action.parameterDialogFields && action.parameterDialogFields.length > 0)); }); _%>
133
+ <%_ if (!hideFilterBar && toolBarHasDialogAction) { _%>
134
+ // Populate the table so the actions below have a row to select.
135
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
136
+ <%_ } _%>
137
+ <%_ toolBarActions.forEach(function(item) { _%>
138
+ <%_ if (item.visible) { _%>
139
+ <%_ if (item.menuActions) { _%>
140
+ <%_ if (item.splitButton) { _%>
141
+ // "<%- 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:
142
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
143
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
144
+ <%_ } else { _%>
145
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>");
146
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
147
+ <%_ item.menuActions.forEach(function(menuAction) { _%>
148
+ <%_ if (menuAction.visible) { _%>
149
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckMenuAction("<%- menuAction.label %>");
150
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteMenuAction("<%- menuAction.label %>");
151
+ <%_ } _%>
152
+ <%_ }); _%>
153
+ <%_ } _%>
154
+ <%_ } else if (item.custom) { _%>
155
+ <%_ if (item.labelUnresolved) { _%>
156
+ // TODO: label is an unresolved i18n key; replace with the rendered action text
157
+ <%_ } _%>
158
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction("<%- item.label %>");
159
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { visible: true });
160
+ <%_ } else { _%>
161
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
162
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> }, { enabled: <%- item.enabled === true %> });
163
+ <%_ const hasParamDialog = item.parameterDialogFields && item.parameterDialogFields.length > 0; _%>
164
+ <%_ if ((item.isCritical || hasParamDialog) && item.enabled === 'dynamic') { _%>
165
+ // "<%- item.label %>" is conditionally enabled (Core.OperationAvailable path); it may be disabled for the selected row. Uncomment and select a row that enables it to test the <%- hasParamDialog ? 'action parameter dialog' : 'confirmation dialog' %>.
166
+ <%_ if (!hideFilterBar) { _%>
167
+ // When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
168
+ <%_ } _%>
169
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
170
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
171
+ <%_ if (hasParamDialog) { _%>
172
+ <%_ item.parameterDialogFields.forEach(function(parameter) { _%>
173
+ // Then.onThe<%- startLR%>Generated.onActionDialog().iCheckActionParameterDialogField({ property: "<%- parameter %>" }, undefined, { visible: true });
174
+ <%_ }); _%>
175
+ // When.onThe<%- startLR%>Generated.onActionDialog().iCancel();
176
+ <%_ } else { _%>
177
+ // Then.onThe<%- startLR%>Generated.onMessageDialog().iCheckState();
178
+ // When.onThe<%- startLR%>Generated.onMessageDialog().iCancel();
179
+ <%_ } _%>
180
+ // When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
181
+ <%_ } else if (item.isCritical || hasParamDialog) { _%>
182
+ <%_ if (item.enabled !== true) { _%>
183
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
184
+ <%_ } _%>
185
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iExecuteAction({ service: "<%- item.service %>", action: "<%- item.action %>", unbound: <%- item.unbound === true %> });
186
+ <%_ if (hasParamDialog) { _%>
187
+ <%_ item.parameterDialogFields.forEach(function(parameter) { _%>
188
+ Then.onThe<%- startLR%>Generated.onActionDialog().iCheckActionParameterDialogField({ property: "<%- parameter %>" }, undefined, { visible: true });
189
+ <%_ }); _%>
190
+ When.onThe<%- startLR%>Generated.onActionDialog().iCancel();
191
+ <%_ } else { _%>
192
+ Then.onThe<%- startLR%>Generated.onMessageDialog().iCheckState();
193
+ When.onThe<%- startLR%>Generated.onMessageDialog().iCancel();
194
+ <%_ } _%>
195
+ <%_ if (item.enabled !== true) { _%>
196
+ // Deselect the row so the following actions start with an empty selection.
197
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
198
+ <%_ } _%>
199
+ <%_ } _%>
200
+ <%_ } _%>
201
+ <%_ } _%>
202
+ <%_ }); -%>
203
+ <%_ } -%>
204
+ <%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
205
+ Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
206
+ <%_ } -%>
207
+ });
208
+ <%_ } -%>
209
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
210
+ opaTest("Check text annotation for columns", function (Given, When, Then) {
211
+ <%_ textAnnotationColumns.forEach(function(column) { _%>
212
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
213
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
214
+ <%_ }); -%>
215
+ });
216
+ <%_ } -%>
217
+
218
+ <%_ if (contactCardColumns.length > 0) { -%>
219
+ opaTest("Check contact card links", function (Given, When, Then) {
220
+ // Reveal popin details so low-priority (e.g. contact-card) columns become clickable
221
+ When.onThe<%- startLR %>Generated.onTable(defaultTableId).iExecuteShowHideDetails(true);
222
+ <%_ contactCardColumns.forEach(function(column) { _%>
223
+ // 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.
224
+ When.onThe<%- startLR %>Generated.onTable(defaultTableId).iClickLink(0, "<%- column.property %>");
225
+ Then.onThe<%- startLR %>Generated.onDialog(defaultTableId).iCheckContactDialog({ controlType: "sap.ui.mdc.link.Panel" });
226
+ <%_ }); -%>
227
+ });
228
+ <%_ } -%>
229
+ <%_ } -%>
230
+ <%_ if (startLR) { -%>
231
+ opaTest("Navigate to ObjectPage", function (Given, When, Then) {
232
+ // Note: this test will fail if the ListReport page doesn't show any data
233
+ <%_ if (!hideFilterBar) { -%>
234
+ When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
235
+ <%_ } -%>
236
+ <%_ if (tabs && tabs.length > 0) { -%>
237
+ <%_ const navTabId = navigatedOPTabKey || tableIdentifiers[0]; -%>
238
+ When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- navTabId %>" });
239
+ Then.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iCheckRows();
240
+ <%_ if (navigatedOP) { -%>
241
+ When.onThe<%- startLR%>Generated.onTable("<%- navTabId %>").iPressRow(0);
242
+ Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
243
+ <%_ } -%>
244
+ <%_ } else { -%>
245
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
246
+ <%_ if (navigatedOP) { -%>
247
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressRow(0);
248
+ Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
249
+ <%_ } -%>
250
+ <%_ } -%>
251
+ });
252
+ <%_ } -%>
253
+
254
+ opaTest("Teardown", function (Given, When, Then) {
255
+ // Cleanup
256
+ Given.iTearDownMyApp();
257
+ });
258
+ }
259
+
260
+ runner.run([journey]);
261
+ });