@sap-ux/ui5-test-writer 1.2.34 → 1.3.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.
Files changed (37) hide show
  1. package/dist/fiori-elements-opa-writer.js +46 -9
  2. package/dist/types.d.ts +10 -0
  3. package/package.json +3 -3
  4. package/templates/v4/1.84/integration/FPMJourney.js +49 -0
  5. package/templates/v4/1.84/integration/FirstJourney.js +35 -0
  6. package/templates/v4/1.84/integration/FirstJourney.ts +32 -0
  7. package/templates/v4/1.84/integration/ListReportJourney.js +129 -0
  8. package/templates/v4/1.84/integration/ListReportJourney.ts +133 -0
  9. package/templates/v4/1.84/integration/ObjectPageJourney.js +160 -0
  10. package/templates/v4/1.84/integration/ObjectPageJourney.ts +178 -0
  11. package/templates/v4/1.84/integration/opaTests.qunit.html +27 -0
  12. package/templates/v4/1.84/integration/opaTests.qunit.js +33 -0
  13. package/templates/v4/1.84/integration/pages/FPM.js +30 -0
  14. package/templates/v4/1.84/integration/pages/JourneyRunner.js +17 -0
  15. package/templates/v4/1.84/integration/pages/JourneyRunner.ts +28 -0
  16. package/templates/v4/1.84/integration/pages/ListReport.js +35 -0
  17. package/templates/v4/1.84/integration/pages/ListReport.ts +25 -0
  18. package/templates/v4/1.84/integration/pages/ObjectPage.js +42 -0
  19. package/templates/v4/1.84/integration/pages/ObjectPage.ts +35 -0
  20. package/templates/v4/1.84/integration/types/OpaJourneyTypes.d.ts +56 -0
  21. /package/templates/v4/{integration → 1.150/integration}/FPMJourney.js +0 -0
  22. /package/templates/v4/{integration → 1.150/integration}/FirstJourney.js +0 -0
  23. /package/templates/v4/{integration → 1.150/integration}/FirstJourney.ts +0 -0
  24. /package/templates/v4/{integration → 1.150/integration}/ListReportJourney.js +0 -0
  25. /package/templates/v4/{integration → 1.150/integration}/ListReportJourney.ts +0 -0
  26. /package/templates/v4/{integration → 1.150/integration}/ObjectPageJourney.js +0 -0
  27. /package/templates/v4/{integration → 1.150/integration}/ObjectPageJourney.ts +0 -0
  28. /package/templates/v4/{integration → 1.150/integration}/opaTests.qunit.html +0 -0
  29. /package/templates/v4/{integration → 1.150/integration}/opaTests.qunit.js +0 -0
  30. /package/templates/v4/{integration → 1.150/integration}/pages/FPM.js +0 -0
  31. /package/templates/v4/{integration → 1.150/integration}/pages/JourneyRunner.js +0 -0
  32. /package/templates/v4/{integration → 1.150/integration}/pages/JourneyRunner.ts +0 -0
  33. /package/templates/v4/{integration → 1.150/integration}/pages/ListReport.js +0 -0
  34. /package/templates/v4/{integration → 1.150/integration}/pages/ListReport.ts +0 -0
  35. /package/templates/v4/{integration → 1.150/integration}/pages/ObjectPage.js +0 -0
  36. /package/templates/v4/{integration → 1.150/integration}/pages/ObjectPage.ts +0 -0
  37. /package/templates/v4/{integration → 1.150/integration}/types/OpaJourneyTypes.d.ts +0 -0
@@ -0,0 +1,160 @@
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.iStartMyApp();
29
+ <% if(navigationParents.parentLRName) { -%>
30
+ <% if (!hideFilterBar) { -%>
31
+ When.onThe<%- navigationParents.parentLRName%>Generated.onFilterBar().iExecuteSearch();
32
+ <% } -%>
33
+ Then.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- navigationParents.parentLRTableIdentifier ? '"' + navigationParents.parentLRTableIdentifier + '"' : '' %>).iCheckRows();
34
+ When.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- navigationParents.parentLRTableIdentifier ? '"' + navigationParents.parentLRTableIdentifier + '"' : '' %>).iPressRow(0);
35
+ <% } -%>
36
+ <% navigationParents.parentOPs.forEach(function(parent) { %>
37
+ Then.onThe<%- parent.name %>Generated.iSeeThisPage();
38
+ Then.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iCheckRows();
39
+ When.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iPressRow(0);
40
+ <% }); %>
41
+ Then.onThe<%- name%>Generated.iSeeThisPage();
42
+ });
43
+
44
+ <% if (headerActions?.length > 0) { -%>
45
+ opaTest("Check header actions of the Object Page", function (Given, When, Then) {
46
+ <% if (editButton?.visible) { -%>
47
+ // Ensure the opened entity is not in Draft state before uncommenting
48
+ // Then.onThe<%- name%>Generated.onHeader().iCheckEdit({ visible: true });
49
+ // When.onThe<%- name%>Generated.onHeader().iPressEdit();
50
+ <% } -%>
51
+ <% headerActions.forEach(function(action) { -%>
52
+ <% if (action.visible) { -%>
53
+ <% if (action.enabled === 'dynamic') { -%>
54
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
55
+ <% } else { -%>
56
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
57
+ <% } -%>
58
+ // When.onThe<%- name%>Generated.onHeader().iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
59
+ <% } -%>
60
+ <% }); -%>
61
+ });
62
+ <% } -%>
63
+
64
+ <% if (headerSections?.length > 0) { -%>
65
+ opaTest("Check header facets of the Object Page", function (Given, When, Then) {
66
+ <% headerSections.forEach(function(section) { -%>
67
+ <% if (section.microChart) { -%>
68
+ Then.onThe<%- name%>Generated.onHeader().iCheckMicroChart("<%- section.title %>");
69
+ <% } else { -%>
70
+ Then.onThe<%- name%>Generated.onHeader().iCheckHeaderFacet({ facetId: "<%- section.facetId %>"<% if (section.custom) { %>, custom: true<% } %> });
71
+ <% if (section.form) { -%>
72
+ <% section.fields.forEach(function(field) { -%>
73
+ Then.onThe<%- name%>Generated.onHeader().iCheckFieldInFieldGroup({
74
+ fieldGroup: "<%- field.fieldGroupQualifier %>",
75
+ field: "<%- field.field %>",
76
+ targetAnnotation: "<%- field.targetAnnotation %>"
77
+ });
78
+ <% }) -%>
79
+ <% } -%>
80
+ <% } -%>
81
+ <% }) -%>
82
+ });
83
+ <% } -%>
84
+
85
+ <% if (bodySections?.length > 0) { -%>
86
+ opaTest("Check body sections of the Object Page", function (Given, When, Then) {
87
+ <% if (bodySections?.length > 1) { -%>
88
+ Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
89
+ <% } -%>
90
+ <% bodySections.forEach(function(section) { -%>
91
+ <% if (bodySections.length > 1) { -%>
92
+ When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
93
+ <% } -%>
94
+ Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" });
95
+ <% if (section.actions && section.actions.length > 0) { -%>
96
+ <% section.actions.forEach(function(action) { -%>
97
+ <% if (action.visible) { -%>
98
+ <% if (section.isTable && section.navigationProperty) { -%>
99
+ <% if (action.enabled === 'dynamic') { -%>
100
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
101
+ <% } else { -%>
102
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
103
+ <% } -%>
104
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
105
+ <% } else { -%>
106
+ <% if (action.enabled === 'dynamic') { -%>
107
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
108
+ <% } else { -%>
109
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
110
+ <% } -%>
111
+ // When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
112
+ <% } -%>
113
+ <% } -%>
114
+ <% }); -%>
115
+ <% } -%>
116
+ <% if (section.isTable && section.navigationProperty) { -%>
117
+ <% if (section.createButton?.visible) { -%>
118
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
119
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
120
+ <% } -%>
121
+ <% if (section.deleteButton?.visible) { -%>
122
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
123
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
124
+ <% } -%>
125
+ <% } -%>
126
+ <% if (section?.subSections?.length > 0) { -%>
127
+ <% section.subSections.forEach(function(subSection) { -%>
128
+ //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
129
+ Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
130
+ <% if (subSection.fields && subSection.fields.length > 0) { -%>
131
+ <% subSection.fields.forEach(function(field) { -%>
132
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
133
+ <% }) -%>
134
+ <% } -%>
135
+ <% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
136
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(subSection.tableColumns) %>);
137
+ <% } -%>
138
+ <% }) -%>
139
+ <% } else { -%>
140
+ <% if (section.fields && section.fields.length > 0) { -%>
141
+ <% section.fields.forEach(function(field) { -%>
142
+ Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
143
+ <% }) -%>
144
+ <% } -%>
145
+ <% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
146
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
147
+ <% } -%>
148
+ <% } -%>
149
+ <% }) -%>
150
+ });
151
+ <% } -%>
152
+
153
+ opaTest("Teardown", function (Given, When, Then) {
154
+ // Cleanup
155
+ Given.iTearDownMyApp();
156
+ });
157
+ }
158
+
159
+ runner.run([journey]);
160
+ });
@@ -0,0 +1,178 @@
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.iStartMyApp();
48
+ <% if(navigationParents.parentLRName) { -%>
49
+ <% if (!hideFilterBar) { -%>
50
+ When.onThe<%- navigationParents.parentLRName%>Generated.onFilterBar().iExecuteSearch();
51
+ <% } -%>
52
+ Then.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- navigationParents.parentLRTableIdentifier ? '"' + navigationParents.parentLRTableIdentifier + '"' : '""' %>).iCheckRows();
53
+ When.onThe<%- navigationParents.parentLRName%>Generated.onTable(<%- navigationParents.parentLRTableIdentifier ? '"' + navigationParents.parentLRTableIdentifier + '"' : '""' %>).iPressRow(0);
54
+ <% } -%>
55
+ <% navigationParents.parentOPs.forEach(function(parent) { %>
56
+ Then.onThe<%- parent.name %>Generated.iSeeThisPage();
57
+ Then.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iCheckRows();
58
+ When.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iPressRow(0);
59
+ <% }); %>
60
+ Then.onThe<%- name%>Generated.iSeeThisPage();
61
+ });
62
+
63
+ <% if (headerActions?.length > 0) { -%>
64
+ opaTest("Check header actions of the Object Page", function (_Given: Given, _When: When, Then: Then) {
65
+ <% if (editButton?.visible) { -%>
66
+ // Ensure the opened entity is not in Draft state before uncommenting
67
+ // Then.onThe<%- name%>Generated.onHeader().iCheckEdit({ visible: true });
68
+ // When.onThe<%- name%>Generated.onHeader().iPressEdit();
69
+ <% } -%>
70
+ <% headerActions.forEach(function(action) { -%>
71
+ <% if (action.visible) { -%>
72
+ <% if (action.enabled === 'dynamic') { -%>
73
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
74
+ <% } else { -%>
75
+ Then.onThe<%- name%>Generated.onHeader().iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
76
+ <% } -%>
77
+ // When.onThe<%- name%>Generated.onHeader().iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
78
+ <% } -%>
79
+ <% }); -%>
80
+ });
81
+ <% } -%>
82
+
83
+ <% if (headerSections?.length > 0) { -%>
84
+ opaTest("Check header facets of the Object Page", function (_Given: Given, _When: When, Then: Then) {
85
+ <% headerSections.forEach(function(section) { -%>
86
+ <% if (section.microChart) { -%>
87
+ Then.onThe<%- name%>Generated.onHeader().iCheckMicroChart("<%- section.title %>", "");
88
+ <% } else { -%>
89
+ Then.onThe<%- name%>Generated.onHeader().iCheckHeaderFacet({ facetId: "<%- section.facetId %>"<% if (section.custom) { %>, custom: true<% } %> });
90
+ <% if (section.form) { -%>
91
+ <% section.fields.forEach(function(field) { -%>
92
+ Then.onThe<%- name%>Generated.onHeader().iCheckFieldInFieldGroup({
93
+ fieldGroup: "<%- field.fieldGroupQualifier %>",
94
+ field: "<%- field.field %>",
95
+ targetAnnotation: "<%- field.targetAnnotation %>"
96
+ } as unknown as FieldIdentifier);
97
+ <% }) -%>
98
+ <% } -%>
99
+ <% } -%>
100
+ <% }) -%>
101
+ });
102
+ <% } -%>
103
+
104
+ <% if (bodySections?.length > 0) { -%>
105
+ opaTest("Check body sections of the Object Page", function (_Given: Given, <% if (bodySections?.length > 1) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
106
+ <% if (bodySections?.length > 1) { -%>
107
+ Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
108
+ <% } -%>
109
+ <% bodySections.forEach(function(section) { -%>
110
+ <% if (bodySections.length > 1) { -%>
111
+ When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
112
+ <% } -%>
113
+ Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" }, {});
114
+ <% if (section.actions && section.actions.length > 0) { -%>
115
+ <% section.actions.forEach(function(action) { -%>
116
+ <% if (action.visible) { -%>
117
+ <% if (section.isTable && section.navigationProperty) { -%>
118
+ <% if (action.enabled === 'dynamic') { -%>
119
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
120
+ <% } else { -%>
121
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
122
+ <% } -%>
123
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
124
+ <% } else { -%>
125
+ <% if (action.enabled === 'dynamic') { -%>
126
+ 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 } */);
127
+ <% } else { -%>
128
+ 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 %> });
129
+ <% } -%>
130
+ // When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
131
+ <% } -%>
132
+ <% } -%>
133
+ <% }); -%>
134
+ <% } -%>
135
+ <% if (section.isTable && section.navigationProperty) { -%>
136
+ <% if (section.createButton?.visible) { -%>
137
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
138
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
139
+ <% } -%>
140
+ <% if (section.deleteButton?.visible) { -%>
141
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
142
+ // When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
143
+ <% } -%>
144
+ <% } -%>
145
+ <% if (section?.subSections?.length > 0) { -%>
146
+ <% section.subSections.forEach(function(subSection) { -%>
147
+ //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
148
+ Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" }, {});
149
+ <% if (subSection.fields && subSection.fields.length > 0) { -%>
150
+ <% subSection.fields.forEach(function(field) { -%>
151
+ 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 %>"<% } %> });
152
+ <% }) -%>
153
+ <% } -%>
154
+ <% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
155
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(subSection.tableColumns) %>);
156
+ <% } -%>
157
+ <% }) -%>
158
+ <% } else { -%>
159
+ <% if (section.fields && section.fields.length > 0) { -%>
160
+ <% section.fields.forEach(function(field) { -%>
161
+ 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 %>"<% } %> });
162
+ <% }) -%>
163
+ <% } -%>
164
+ <% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
165
+ Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
166
+ <% } -%>
167
+ <% } -%>
168
+ <% }) -%>
169
+ });
170
+ <% } -%>
171
+
172
+ opaTest("Teardown", function (Given: Given) {
173
+ // Cleanup
174
+ Given.iTearDownMyApp();
175
+ });
176
+ }
177
+
178
+ runner.run([journey]);
@@ -0,0 +1,27 @@
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
+ }'
13
+ data-sap-ui-animation="false"
14
+ data-sap-ui-compatVersion="edge"
15
+ data-sap-ui-async="true">
16
+ </script>
17
+
18
+ <link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css">
19
+
20
+ <script src="opaTests.qunit.js"></script>
21
+
22
+ </head>
23
+ <body>
24
+ <div id="qunit"></div>
25
+ <div id="qunit-fixture"></div>
26
+ </body>
27
+ </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,17 @@
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
+ async: true
13
+ });
14
+
15
+ return runner;
16
+ });
17
+
@@ -0,0 +1,28 @@
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
+ <%- pages.map((page) => 'import Custom' + page.targetKey + 'Generated from "./' + page.targetKey + '.gen";').join('\n') %>
9
+
10
+ const runner = new JourneyRunner({
11
+ launchUrl: sap.ui.require.toUrl("<%- appPath %>") + "/<%- htmlTarget %>",
12
+ pages: {
13
+ <%- pages.map((page) =>
14
+ ' onThe' + page.targetKey + 'Generated: new ' + page.template + '(\n' +
15
+ ' {\n' +
16
+ ' appId: "' + page.appID + '",\n' +
17
+ ' componentId: "' + page.componentID + '",\n' +
18
+ ' entitySet: "' + (page.entitySet || '') + '",\n' +
19
+ ' contextPath: "' + (page.contextPath || '') + '"\n' +
20
+ ' },\n' +
21
+ ' Custom' + page.targetKey + 'Generated\n' +
22
+ ' )'
23
+ ).join(',\n') %>
24
+ },
25
+ async: true
26
+ });
27
+
28
+ 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
+ }
@@ -0,0 +1,42 @@
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/ObjectPage', 'sap/ui/test/actions/Press'], function(ObjectPage, Press) {
19
+ 'use strict';
20
+
21
+ const CustomPageDefinitions = {
22
+ actions: {
23
+ iPressSectionIconTabFilterButton: function (section) {
24
+ return this.waitFor({
25
+ id: new RegExp(`.*--fe::FacetSection::${section}-anchor$`),
26
+ actions: new Press()
27
+ });
28
+ }
29
+ },
30
+ assertions: {}
31
+ };
32
+
33
+ return new ObjectPage(
34
+ {
35
+ appId: '<%- appID %>',
36
+ componentId: '<%- componentID %>',<% if (locals.contextPath) { %>
37
+ contextPath: '<%- contextPath %>'<% } else if (locals.entitySet) { %>
38
+ entitySet: '<%- entitySet %>'<% } %>
39
+ },
40
+ CustomPageDefinitions
41
+ );
42
+ });
@@ -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
+ import type Opa5 from "sap/ui/test/Opa5";
19
+ import Press from "sap/ui/test/actions/Press";
20
+
21
+ export const actions = {
22
+ iPressSectionIconTabFilterButton(this: Opa5, section: string) {
23
+ return this.waitFor({
24
+ id: new RegExp(`.*--fe::FacetSection::${section}-anchor$`),
25
+ actions: new Press()
26
+ });
27
+ }
28
+ };
29
+
30
+ export const assertions = {};
31
+
32
+ export default class ObjectPage {
33
+ actions = actions;
34
+ assertions = assertions;
35
+ }