@sap-ux/ui5-test-writer 1.19.16 → 1.19.18

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 (39) hide show
  1. package/dist/fiori-elements-opa-writer.d.ts +2 -2
  2. package/dist/fiori-elements-opa-writer.js +6 -4
  3. package/dist/types.d.ts +2 -2
  4. package/package.json +4 -4
  5. package/templates/v4/1.120/integration/FPMJourney.js +43 -0
  6. package/templates/v4/1.120/integration/FPMJourney.ts +40 -0
  7. package/templates/v4/1.120/integration/FirstJourney.js +37 -0
  8. package/templates/v4/1.120/integration/FirstJourney.ts +34 -0
  9. package/templates/v4/1.120/integration/ListReportJourney.js +138 -0
  10. package/templates/v4/1.120/integration/ListReportJourney.ts +142 -0
  11. package/templates/v4/1.120/integration/ObjectPageJourney.js +171 -0
  12. package/templates/v4/1.120/integration/ObjectPageJourney.ts +189 -0
  13. package/templates/v4/1.120/integration/opaTests.qunit.html +28 -0
  14. package/templates/v4/1.120/integration/opaTests.qunit.js +33 -0
  15. package/templates/v4/1.120/integration/pages/FPM.js +30 -0
  16. package/templates/v4/1.120/integration/pages/FPM.ts +25 -0
  17. package/templates/v4/1.120/integration/pages/JourneyRunner.js +18 -0
  18. package/templates/v4/1.120/integration/pages/JourneyRunner.ts +37 -0
  19. package/templates/v4/1.120/integration/pages/ListReport.js +35 -0
  20. package/templates/v4/1.120/integration/pages/ListReport.ts +25 -0
  21. package/templates/v4/1.120/integration/pages/ObjectPage.js +42 -0
  22. package/templates/v4/1.120/integration/pages/ObjectPage.ts +35 -0
  23. package/templates/v4/1.120/integration/types/OpaJourneyTypes.d.ts +79 -0
  24. package/templates/v4/1.148/integration/types/OpaJourneyTypes.d.ts +7 -2
  25. package/templates/v4/1.152/integration/FirstJourney.ts +2 -2
  26. package/templates/v4/1.152/integration/ListReportJourney.ts +5 -8
  27. package/templates/v4/1.152/integration/ObjectPageJourney.ts +42 -47
  28. package/templates/v4/1.152/integration/pages/JourneyRunner.ts +1 -2
  29. package/templates/v4/1.152/integration/types/OpaJourneyTypes.d.ts +7 -2
  30. package/templates/v4/1.84/integration/ListReportJourney.js +2 -18
  31. package/templates/v4/1.84/integration/ListReportJourney.ts +0 -18
  32. package/templates/v4/1.84/integration/ObjectPageJourney.js +14 -14
  33. package/templates/v4/1.84/integration/ObjectPageJourney.ts +13 -13
  34. package/templates/v4/1.84/integration/types/OpaJourneyTypes.d.ts +7 -2
  35. package/templates/v4/latest/integration/FirstJourney.ts +2 -2
  36. package/templates/v4/latest/integration/ListReportJourney.ts +5 -8
  37. package/templates/v4/latest/integration/ObjectPageJourney.ts +42 -47
  38. package/templates/v4/latest/integration/pages/JourneyRunner.ts +1 -2
  39. package/templates/v4/latest/integration/types/OpaJourneyTypes.d.ts +7 -2
@@ -0,0 +1,171 @@
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%>ObjectPage journey");
26
+
27
+ opaTest("Navigate to <%- name%>ObjectPage", function (Given, When, Then) {
28
+ Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
29
+ Given.iResetTestData();
30
+ Given.iStartMyApp();
31
+ <% if(navigationParents.parentLRName) { -%>
32
+ <% const parentTableId = navigationParents.parentLRViewKey ? '"' + navigationParents.parentLRViewKey + '"' : ''; -%>
33
+ <% if (!hideFilterBar) { -%>
34
+ When.onThe<%- navigationParents.parentLRName%>Generated.onFilterBar().iExecuteSearch();
35
+ <% } -%>
36
+ <% if (navigationParents.parentLRViewKey && !navigationParents.parentLRViewIsDefault) { -%>
37
+ When.onThe<%- navigationParents.parentLRName%>Generated.iGoToView({ key: "<%- navigationParents.parentLRViewKey %>" });
38
+ <% } -%>
39
+ Then.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- parentTableId %>).iCheckRows();
40
+ When.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- parentTableId %>).iPressRow(0);
41
+ <% } -%>
42
+ <% navigationParents.parentOPs.forEach(function(parent) { %>
43
+ Then.onThe<%- parent.name %>Generated.iSeeThisPage();
44
+ Then.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iCheckRows();
45
+ When.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iPressRow(0);
46
+ <% }); %>
47
+ Then.onThe<%- name%>Generated.iSeeThisPage();
48
+ });
49
+
50
+ <% if (headerActions?.length > 0) { -%>
51
+ opaTest("Check header actions of the Object Page", function (Given, When, Then) {
52
+ <% if (editButton?.visible) { -%>
53
+ // Ensure the opened entity is not in Draft state before uncommenting
54
+ // Then.onThe<%- name%>Generated.onHeader().iCheckEdit({ visible: true });
55
+ // When.onThe<%- name%>Generated.onHeader().iPressEdit();
56
+ <% } -%>
57
+ <% headerActions.forEach(function(action) { -%>
58
+ <% if (action.visible) { -%>
59
+ <% if (action.enabled === 'dynamic') { -%>
60
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
61
+ <% } else { -%>
62
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
63
+ <% } -%>
64
+ // When.onThe<%- name%>Generated.onHeader().iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
65
+ <% } -%>
66
+ <% }); -%>
67
+ });
68
+ <% } -%>
69
+
70
+ <% if (headerSections?.length > 0) { -%>
71
+ opaTest("Check header facets of the Object Page", function (Given, When, Then) {
72
+ <% headerSections.forEach(function(section) { -%>
73
+ <% if (section.microChart) { -%>
74
+ Then.onThe<%- name%>Generated.onHeader().iCheckMicroChart("<%- section.title %>");
75
+ <% } else { -%>
76
+ Then.onThe<%- name%>Generated.onHeader().iCheckHeaderFacet({ facetId: "<%- section.facetId %>"<% if (section.custom) { %>, custom: true<% } %> });
77
+ <% if (section.form) { -%>
78
+ <% section.fields.forEach(function(field) { -%>
79
+ Then.onThe<%- name%>Generated.onHeader().iCheckFieldInFieldGroup({
80
+ fieldGroup: "<%- field.fieldGroupQualifier %>",
81
+ field: "<%- field.field %>",
82
+ targetAnnotation: "<%- field.targetAnnotation %>"
83
+ });
84
+ <% }) -%>
85
+ <% } -%>
86
+ <% } -%>
87
+ <% }) -%>
88
+ });
89
+ <% } -%>
90
+
91
+ <% if (bodySections?.length > 1) { -%>
92
+ opaTest("Check the number of sections of the Object Page", function (_Given, _When, Then) {
93
+ Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
94
+ });
95
+
96
+ <% } -%>
97
+ <% if (bodySections?.length > 0) { -%>
98
+ <% bodySections.forEach(function(section) { -%>
99
+ opaTest("Check the <%- section.id %> section of the Object Page", function (_Given, <% if (bodySections.length > 1) { %>When<% } else { %>_When<% } %>, Then) {
100
+ <% if (bodySections.length > 1) { -%>
101
+ When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
102
+ <% } -%>
103
+ Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" });
104
+ <% if (section.actions && section.actions.length > 0) { -%>
105
+ <% section.actions.forEach(function(action) { -%>
106
+ <% if (action.visible) { -%>
107
+ <% if (section.isTable && section.navigationProperty) { -%>
108
+ <% if (action.enabled === 'dynamic') { -%>
109
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
110
+ <% } else { -%>
111
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
112
+ <% } -%>
113
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
114
+ <% } else { -%>
115
+ <% if (action.enabled === 'dynamic') { -%>
116
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
117
+ <% } else { -%>
118
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
119
+ <% } -%>
120
+ // When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
121
+ <% } -%>
122
+ <% } -%>
123
+ <% }); -%>
124
+ <% } -%>
125
+ <% if (section.isTable && section.navigationProperty) { -%>
126
+ <% if (section.createButton?.visible) { -%>
127
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
128
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
129
+ <% } -%>
130
+ <% if (section.deleteButton?.visible) { -%>
131
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
132
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
133
+ <% } -%>
134
+ <% } -%>
135
+ <% if (section?.subSections?.length > 0) { -%>
136
+ <% section.subSections.forEach(function(subSection) { -%>
137
+ <% if (section.subSections.length > 1) { -%>
138
+ //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
139
+ Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
140
+ <% } -%>
141
+ <% if (subSection.fields && subSection.fields.length > 0) { -%>
142
+ <% subSection.fields.forEach(function(field) { -%>
143
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
144
+ <% }) -%>
145
+ <% } -%>
146
+ <% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
147
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(subSection.tableColumns) %>);
148
+ <% } -%>
149
+ <% }) -%>
150
+ <% } else { -%>
151
+ <% if (section.fields && section.fields.length > 0) { -%>
152
+ <% section.fields.forEach(function(field) { -%>
153
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
154
+ <% }) -%>
155
+ <% } -%>
156
+ <% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
157
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
158
+ <% } -%>
159
+ <% } -%>
160
+ });
161
+
162
+ <% }) -%>
163
+ <% } -%>
164
+ opaTest("Teardown", function (Given, When, Then) {
165
+ // Cleanup
166
+ Given.iTearDownMyApp();
167
+ });
168
+ }
169
+
170
+ runner.run([journey]);
171
+ });
@@ -0,0 +1,189 @@
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
+ <%_
21
+ const usesFieldIdentifier = (headerSections || []).some(function(section) {
22
+ return section.form && section.fields && section.fields.length > 0;
23
+ });
24
+ const usesFormIdentifier = (bodySections || []).some(function(section) {
25
+ const subSectionsHaveForm = (section.subSections || []).some(function(sub) {
26
+ return sub.fields && sub.fields.length > 0;
27
+ });
28
+ const sectionHasFormFields = !(section.subSections && section.subSections.length > 0) && section.fields && section.fields.length > 0;
29
+ const hasFormAction = (section.actions || []).some(function(action) {
30
+ return action.visible && !(section.isTable && section.navigationProperty);
31
+ });
32
+ return subSectionsHaveForm || sectionHasFormFields || hasFormAction;
33
+ });
34
+ -%>
35
+ <% if (usesFieldIdentifier) { -%>
36
+ import type { FieldIdentifier } from "sap/fe/test/api/BaseAPI";
37
+ <% } -%>
38
+ <% if (usesFormIdentifier) { -%>
39
+ import type { FormIdentifier } from "sap/fe/test/api/FormAPI";
40
+ <% } -%>
41
+ import runner from "./pages/JourneyRunner";
42
+
43
+ function journey() {
44
+ QUnit.module("<%- name%>ObjectPage journey");
45
+
46
+ opaTest("Navigate to <%- name%>ObjectPage", function (Given: Given, When: When, Then: Then) {
47
+ Given.iResetMockData({ ServiceUri: <%- JSON.stringify(serviceUri) %> });
48
+ Given.iResetTestData();
49
+ Given.iStartMyApp();
50
+ <% if(navigationParents.parentLRName) { -%>
51
+ <% const parentTableId = navigationParents.parentLRViewKey ? '"' + navigationParents.parentLRViewKey + '"' : '""'; -%>
52
+ <% if (!hideFilterBar) { -%>
53
+ When.onThe<%- navigationParents.parentLRName%>Generated.onFilterBar().iExecuteSearch();
54
+ <% } -%>
55
+ <% if (navigationParents.parentLRViewKey && !navigationParents.parentLRViewIsDefault) { -%>
56
+ When.onThe<%- navigationParents.parentLRName%>Generated.iGoToView({ key: "<%- navigationParents.parentLRViewKey %>" });
57
+ <% } -%>
58
+ Then.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- parentTableId %>).iCheckRows();
59
+ When.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- parentTableId %>).iPressRow(0);
60
+ <% } -%>
61
+ <% navigationParents.parentOPs.forEach(function(parent) { %>
62
+ Then.onThe<%- parent.name %>Generated.iSeeThisPage();
63
+ Then.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iCheckRows();
64
+ When.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iPressRow(0);
65
+ <% }); %>
66
+ Then.onThe<%- name%>Generated.iSeeThisPage();
67
+ });
68
+
69
+ <% if (headerActions?.length > 0) { -%>
70
+ opaTest("Check header actions of the Object Page", function (_Given: Given, _When: When, Then: Then) {
71
+ <% if (editButton?.visible) { -%>
72
+ // Ensure the opened entity is not in Draft state before uncommenting
73
+ // Then.onThe<%- name%>Generated.onHeader().iCheckEdit({ visible: true });
74
+ // When.onThe<%- name%>Generated.onHeader().iPressEdit();
75
+ <% } -%>
76
+ <% headerActions.forEach(function(action) { -%>
77
+ <% if (action.visible) { -%>
78
+ <% if (action.enabled === 'dynamic') { -%>
79
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
80
+ <% } else { -%>
81
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
82
+ <% } -%>
83
+ // When.onThe<%- name%>Generated.onHeader().iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
84
+ <% } -%>
85
+ <% }); -%>
86
+ });
87
+ <% } -%>
88
+
89
+ <% if (headerSections?.length > 0) { -%>
90
+ opaTest("Check header facets of the Object Page", function (_Given: Given, _When: When, Then: Then) {
91
+ <% headerSections.forEach(function(section) { -%>
92
+ <% if (section.microChart) { -%>
93
+ Then.onThe<%- name%>Generated.onHeader().iCheckMicroChart("<%- section.title %>", "");
94
+ <% } else { -%>
95
+ Then.onThe<%- name%>Generated.onHeader().iCheckHeaderFacet({ facetId: "<%- section.facetId %>"<% if (section.custom) { %>, custom: true<% } %> });
96
+ <% if (section.form) { -%>
97
+ <% section.fields.forEach(function(field) { -%>
98
+ Then.onThe<%- name%>Generated.onHeader().iCheckFieldInFieldGroup({
99
+ fieldGroup: "<%- field.fieldGroupQualifier %>",
100
+ field: "<%- field.field %>",
101
+ targetAnnotation: "<%- field.targetAnnotation %>"
102
+ } as unknown as FieldIdentifier);
103
+ <% }) -%>
104
+ <% } -%>
105
+ <% } -%>
106
+ <% }) -%>
107
+ });
108
+ <% } -%>
109
+
110
+ <% if (bodySections?.length > 1) { -%>
111
+ opaTest("Check the number of sections of the Object Page", function (_Given: Given, _When: When, Then: Then) {
112
+ Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
113
+ });
114
+
115
+ <% } -%>
116
+ <% if (bodySections?.length > 0) { -%>
117
+ <% bodySections.forEach(function(section) { -%>
118
+ opaTest("Check the <%- section.id %> section of the Object Page", function (_Given: Given, <% if (bodySections.length > 1) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
119
+ <% if (bodySections.length > 1) { -%>
120
+ When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
121
+ <% } -%>
122
+ Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" }, {});
123
+ <% if (section.actions && section.actions.length > 0) { -%>
124
+ <% section.actions.forEach(function(action) { -%>
125
+ <% if (action.visible) { -%>
126
+ <% if (section.isTable && section.navigationProperty) { -%>
127
+ <% if (action.enabled === 'dynamic') { -%>
128
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
129
+ <% } else { -%>
130
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
131
+ <% } -%>
132
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
133
+ <% } else { -%>
134
+ <% if (action.enabled === 'dynamic') { -%>
135
+ 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 } */);
136
+ <% } else { -%>
137
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
138
+ <% } -%>
139
+ // When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
140
+ <% } -%>
141
+ <% } -%>
142
+ <% }); -%>
143
+ <% } -%>
144
+ <% if (section.isTable && section.navigationProperty) { -%>
145
+ <% if (section.createButton?.visible) { -%>
146
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
147
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
148
+ <% } -%>
149
+ <% if (section.deleteButton?.visible) { -%>
150
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
151
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
152
+ <% } -%>
153
+ <% } -%>
154
+ <% if (section?.subSections?.length > 0) { -%>
155
+ <% section.subSections.forEach(function(subSection) { -%>
156
+ <% if (section.subSections.length > 1) { -%>
157
+ //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
158
+ Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" }, {});
159
+ <% } -%>
160
+ <% if (subSection.fields && subSection.fields.length > 0) { -%>
161
+ <% subSection.fields.forEach(function(field) { -%>
162
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" } as unknown as FormIdentifier).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
163
+ <% }) -%>
164
+ <% } -%>
165
+ <% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
166
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(subSection.tableColumns) %>);
167
+ <% } -%>
168
+ <% }) -%>
169
+ <% } else { -%>
170
+ <% if (section.fields && section.fields.length > 0) { -%>
171
+ <% section.fields.forEach(function(field) { -%>
172
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
173
+ <% }) -%>
174
+ <% } -%>
175
+ <% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
176
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
177
+ <% } -%>
178
+ <% } -%>
179
+ });
180
+
181
+ <% }) -%>
182
+ <% } -%>
183
+ opaTest("Teardown", function (Given: Given) {
184
+ // Cleanup
185
+ Given.iTearDownMyApp();
186
+ });
187
+ }
188
+
189
+ runner.run([journey]);
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Integration tests</title>
5
+ <meta charset="utf-8">
6
+
7
+ <script id="sap-ui-bootstrap"
8
+ src="../../resources/sap-ui-core.js"
9
+ data-sap-ui-theme='sap_fiori_3'
10
+ data-sap-ui-resourceroots='{
11
+ "<%- appID %>": "../../",
12
+ "<%- appID %>.test": "../"
13
+ }'
14
+ data-sap-ui-animation="false"
15
+ data-sap-ui-compatVersion="edge"
16
+ data-sap-ui-async="true">
17
+ </script>
18
+
19
+ <link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css">
20
+
21
+ <script src="opaTests.qunit.js"></script>
22
+
23
+ </head>
24
+ <body>
25
+ <div id="qunit"></div>
26
+ <div id="qunit-fixture"></div>
27
+ </body>
28
+ </html>
@@ -0,0 +1,33 @@
1
+ sap.ui.loader.config({
2
+ shim: {
3
+ "sap/ui/qunit/qunit-junit": {
4
+ deps: ["sap/ui/thirdparty/qunit-2"]
5
+ },
6
+ "sap/ui/qunit/qunit-coverage": {
7
+ deps: ["sap/ui/thirdparty/qunit-2"]
8
+ },
9
+ "sap/ui/thirdparty/sinon-qunit": {
10
+ deps: ["sap/ui/thirdparty/qunit-2", "sap/ui/thirdparty/sinon"]
11
+ },
12
+ "sap/ui/qunit/sinon-qunit-bridge": {
13
+ deps: ["sap/ui/thirdparty/qunit-2", "sap/ui/thirdparty/sinon-4"]
14
+ }
15
+ }
16
+ });
17
+
18
+ window.QUnit = Object.assign({}, window.QUnit, { config: { autostart: false } });
19
+
20
+ sap.ui.require(
21
+ [
22
+ "sap/ui/thirdparty/qunit-2",
23
+ "sap/ui/qunit/qunit-junit",
24
+ "sap/ui/qunit/qunit-coverage",
25
+ <%_ if (generatedJourneys && generatedJourneys.length > 0) { -%><%_ generatedJourneys.forEach(function(page) { -%>
26
+ "<%- appPath %>/test/integration/<%- page %>Journey.gen",
27
+ <%_ }); -%><%_ } else { -%>
28
+ "<%- appPath %>/test/integration/<%- opaJourneyFileName %>",
29
+ <%_ } -%>
30
+ ], function (QUnit) {
31
+ "use strict";
32
+ QUnit.start();
33
+ });
@@ -0,0 +1,30 @@
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 pages: ║ *
10
+ * ║ - Create a new page file in this directory. ║ *
11
+ * ║ - Follow the same pattern as this file. ║ *
12
+ * ║ - Add the new file to the JourneyRunner. ║ *
13
+ * ║ - Custom page files are not overwritten. ║ *
14
+ * ║ ║ *
15
+ * ╚═══════════════════════════════════════════════════════════════════════╝ *
16
+ ******************************************************************************/
17
+
18
+ sap.ui.define(['sap/fe/test/TemplatePage'], function(TemplatePage) {
19
+ 'use strict';
20
+
21
+ const CustomPageDefinitions = {
22
+ actions: {},
23
+ assertions: {}
24
+ };
25
+
26
+ return new TemplatePage(
27
+ '<%- appID %>::<%- componentID %>',
28
+ CustomPageDefinitions
29
+ );
30
+ });
@@ -0,0 +1,25 @@
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 pages: ║ *
10
+ * ║ - Create a new page file in this directory. ║ *
11
+ * ║ - Follow the same pattern as this file. ║ *
12
+ * ║ - Add the new file to the JourneyRunner. ║ *
13
+ * ║ - Custom page files are not overwritten. ║ *
14
+ * ║ ║ *
15
+ * ╚═══════════════════════════════════════════════════════════════════════╝ *
16
+ ******************************************************************************/
17
+
18
+ export const actions = {};
19
+
20
+ export const assertions = {};
21
+
22
+ export default class FPM {
23
+ actions = actions;
24
+ assertions = assertions;
25
+ }
@@ -0,0 +1,18 @@
1
+ sap.ui.define([
2
+ "sap/fe/test/JourneyRunner"<% if (pages.length > 0) { %>,
3
+ <%- pages.map((page) => {return "\t\"" + page.appPath + '/test/integration/pages/' + page.fileName + "\"";}).join(',\n')%>
4
+ <% } %>], function (JourneyRunner<% if (pages.length > 0) { %>, <%- pages.map(function(page) {return page.targetKey + "Generated";}).join(', ') %><% } %>) {
5
+ 'use strict';
6
+
7
+ const runner = new JourneyRunner({
8
+ launchUrl: sap.ui.require.toUrl('<%- appPath %>') + '/<%- htmlTarget %>',
9
+ pages: {<% if (pages.length > 0) { %>
10
+ <%- pages.map((page) => {return '\t\t\tonThe' + page.targetKey + 'Generated: ' + page.targetKey + "Generated"}).join(',\n')%>
11
+ <% } %>},
12
+ opaConfig: { autoWait: true },
13
+ async: true
14
+ });
15
+
16
+ return runner;
17
+ });
18
+
@@ -0,0 +1,37 @@
1
+ import JourneyRunner from "sap/fe/test/JourneyRunner";
2
+ <% if (pages.some((p) => p.template === 'ListReport')) { -%>
3
+ import ListReport from "sap/fe/test/ListReport";
4
+ <% } -%>
5
+ <% if (pages.some((p) => p.template === 'ObjectPage')) { -%>
6
+ import ObjectPage from "sap/fe/test/ObjectPage";
7
+ <% } -%>
8
+ <% if (pages.some((p) => p.template === 'FPM')) { -%>
9
+ import TemplatePage from "sap/fe/test/TemplatePage";
10
+ <% } -%>
11
+ <%- pages.map((page) => 'import Custom' + page.targetKey + 'Generated from "./' + page.targetKey + '.gen";').join('\n') %>
12
+
13
+ const runner = new JourneyRunner({
14
+ launchUrl: sap.ui.require.toUrl("<%- appPath %>") + "/<%- htmlTarget %>",
15
+ pages: {
16
+ <%- pages.map((page) =>
17
+ page.template === 'FPM'
18
+ ? ' onThe' + page.targetKey + 'Generated: new (TemplatePage as unknown as new (id: string, defs: object) => object)(\n' +
19
+ ' "' + page.appID + '::' + page.componentID + '",\n' +
20
+ ' Custom' + page.targetKey + 'Generated\n' +
21
+ ' )'
22
+ : ' onThe' + page.targetKey + 'Generated: new ' + page.template + '(\n' +
23
+ ' {\n' +
24
+ ' appId: "' + page.appID + '",\n' +
25
+ ' componentId: "' + page.componentID + '",\n' +
26
+ ' entitySet: "' + (page.entitySet || '') + '",\n' +
27
+ ' contextPath: "' + (page.contextPath || '') + '"\n' +
28
+ ' },\n' +
29
+ ' Custom' + page.targetKey + 'Generated\n' +
30
+ ' )'
31
+ ).join(',\n') %>
32
+ },
33
+ opaConfig: { autoWait: true },
34
+ async: true
35
+ });
36
+
37
+ export default runner;
@@ -0,0 +1,35 @@
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 pages: ║ *
10
+ * ║ - Create a new page file in this directory. ║ *
11
+ * ║ - Follow the same pattern as this file. ║ *
12
+ * ║ - Add the new file to the JourneyRunner. ║ *
13
+ * ║ - Custom page files are not overwritten. ║ *
14
+ * ║ ║ *
15
+ * ╚═══════════════════════════════════════════════════════════════════════╝ *
16
+ ******************************************************************************/
17
+
18
+ sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) {
19
+ 'use strict';
20
+
21
+ const CustomPageDefinitions = {
22
+ actions: {},
23
+ assertions: {}
24
+ };
25
+
26
+ return new ListReport(
27
+ {
28
+ appId: '<%- appID %>',
29
+ componentId: '<%- componentID %>',<% if (locals.contextPath) { %>
30
+ contextPath: '<%- contextPath %>'<% } else if (locals.entitySet) { %>
31
+ entitySet: '<%- entitySet %>'<% } %>
32
+ },
33
+ CustomPageDefinitions
34
+ );
35
+ });
@@ -0,0 +1,25 @@
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 pages: ║ *
10
+ * ║ - Create a new page file in this directory. ║ *
11
+ * ║ - Follow the same pattern as this file. ║ *
12
+ * ║ - Add the new file to the JourneyRunner. ║ *
13
+ * ║ - Custom page files are not overwritten. ║ *
14
+ * ║ ║ *
15
+ * ╚═══════════════════════════════════════════════════════════════════════╝ *
16
+ ******************************************************************************/
17
+
18
+ export const actions = {};
19
+
20
+ export const assertions = {};
21
+
22
+ export default class ListReport {
23
+ actions = actions;
24
+ assertions = assertions;
25
+ }