@sap-ux/ui5-test-writer 1.6.1 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fiori-elements-opa-writer.js +12 -4
- package/dist/types.d.ts +2 -2
- package/package.json +4 -4
- package/templates/v4/1.148/integration/ListReportJourney.js +129 -0
- package/templates/v4/1.148/integration/ListReportJourney.ts +133 -0
- package/templates/v4/1.148/integration/ObjectPageJourney.js +163 -0
- package/templates/v4/1.148/integration/ObjectPageJourney.ts +181 -0
- package/templates/v4/1.148/integration/pages/ObjectPage.js +42 -0
- package/templates/v4/1.148/integration/pages/ObjectPage.ts +35 -0
- package/templates/v4/1.84/integration/ObjectPageJourney.js +0 -6
- package/templates/v4/1.84/integration/ObjectPageJourney.ts +1 -7
- package/templates/v4/latest/integration/FPMJourney.js +49 -0
- package/templates/v4/latest/integration/FirstJourney.js +35 -0
- package/templates/v4/latest/integration/FirstJourney.ts +32 -0
- package/templates/v4/latest/integration/opaTests.qunit.html +27 -0
- package/templates/v4/latest/integration/opaTests.qunit.js +33 -0
- package/templates/v4/latest/integration/pages/FPM.js +30 -0
- package/templates/v4/latest/integration/pages/JourneyRunner.js +17 -0
- package/templates/v4/latest/integration/pages/JourneyRunner.ts +28 -0
- package/templates/v4/latest/integration/pages/ListReport.js +35 -0
- package/templates/v4/latest/integration/pages/ListReport.ts +25 -0
- package/templates/v4/latest/integration/types/OpaJourneyTypes.d.ts +56 -0
- /package/templates/v4/{1.150 → 1.148}/integration/FPMJourney.js +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/FirstJourney.js +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/FirstJourney.ts +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/opaTests.qunit.html +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/opaTests.qunit.js +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/pages/FPM.js +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/pages/JourneyRunner.js +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/pages/JourneyRunner.ts +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/pages/ListReport.js +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/pages/ListReport.ts +0 -0
- /package/templates/v4/{1.150 → 1.148}/integration/types/OpaJourneyTypes.d.ts +0 -0
- /package/templates/v4/{1.150 → latest}/integration/ListReportJourney.js +0 -0
- /package/templates/v4/{1.150 → latest}/integration/ListReportJourney.ts +0 -0
- /package/templates/v4/{1.150 → latest}/integration/ObjectPageJourney.js +0 -0
- /package/templates/v4/{1.150 → latest}/integration/ObjectPageJourney.ts +0 -0
- /package/templates/v4/{1.150 → latest}/integration/pages/ObjectPage.js +0 -0
- /package/templates/v4/{1.150 → latest}/integration/pages/ObjectPage.ts +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
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 > 1) { -%>
|
|
105
|
+
opaTest("Check the number of sections of the Object Page", function (_Given: Given, _When: When, Then: Then) {
|
|
106
|
+
Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
<% } -%>
|
|
110
|
+
<% if (bodySections?.length > 0) { -%>
|
|
111
|
+
<% bodySections.forEach(function(section) { -%>
|
|
112
|
+
opaTest("Check the <%- section.id %> section of the Object Page", function (_Given: Given, <% if (bodySections.length > 1) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
|
|
113
|
+
<% if (bodySections.length > 1) { -%>
|
|
114
|
+
When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
|
|
115
|
+
<% } -%>
|
|
116
|
+
Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" }, {});
|
|
117
|
+
<% if (section.actions && section.actions.length > 0) { -%>
|
|
118
|
+
<% section.actions.forEach(function(action) { -%>
|
|
119
|
+
<% if (action.visible) { -%>
|
|
120
|
+
<% if (section.isTable && section.navigationProperty) { -%>
|
|
121
|
+
<% if (action.enabled === 'dynamic') { -%>
|
|
122
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
123
|
+
<% } else { -%>
|
|
124
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
|
|
125
|
+
<% } -%>
|
|
126
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
127
|
+
<% } else { -%>
|
|
128
|
+
<% if (action.enabled === 'dynamic') { -%>
|
|
129
|
+
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 } */);
|
|
130
|
+
<% } else { -%>
|
|
131
|
+
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 %> });
|
|
132
|
+
<% } -%>
|
|
133
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
134
|
+
<% } -%>
|
|
135
|
+
<% } -%>
|
|
136
|
+
<% }); -%>
|
|
137
|
+
<% } -%>
|
|
138
|
+
<% if (section.isTable && section.navigationProperty) { -%>
|
|
139
|
+
<% if (section.createButton?.visible) { -%>
|
|
140
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
|
|
141
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
|
|
142
|
+
<% } -%>
|
|
143
|
+
<% if (section.deleteButton?.visible) { -%>
|
|
144
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
|
|
145
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
|
|
146
|
+
<% } -%>
|
|
147
|
+
<% } -%>
|
|
148
|
+
<% if (section?.subSections?.length > 0) { -%>
|
|
149
|
+
<% section.subSections.forEach(function(subSection) { -%>
|
|
150
|
+
//When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
|
|
151
|
+
Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" }, {});
|
|
152
|
+
<% if (subSection.fields && subSection.fields.length > 0) { -%>
|
|
153
|
+
<% subSection.fields.forEach(function(field) { -%>
|
|
154
|
+
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 %>"<% } %> });
|
|
155
|
+
<% }) -%>
|
|
156
|
+
<% } -%>
|
|
157
|
+
<% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
|
|
158
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(subSection.tableColumns) %>);
|
|
159
|
+
<% } -%>
|
|
160
|
+
<% }) -%>
|
|
161
|
+
<% } else { -%>
|
|
162
|
+
<% if (section.fields && section.fields.length > 0) { -%>
|
|
163
|
+
<% section.fields.forEach(function(field) { -%>
|
|
164
|
+
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 %>"<% } %> });
|
|
165
|
+
<% }) -%>
|
|
166
|
+
<% } -%>
|
|
167
|
+
<% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
|
|
168
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
|
|
169
|
+
<% } -%>
|
|
170
|
+
<% } -%>
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
<% }) -%>
|
|
174
|
+
<% } -%>
|
|
175
|
+
opaTest("Teardown", function (Given: Given) {
|
|
176
|
+
// Cleanup
|
|
177
|
+
Given.iTearDownMyApp();
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
runner.run([journey]);
|
|
@@ -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
|
+
}
|
|
@@ -61,12 +61,6 @@ sap.ui.define([
|
|
|
61
61
|
});
|
|
62
62
|
<% } -%>
|
|
63
63
|
|
|
64
|
-
<% if (headerTitle) { -%>
|
|
65
|
-
opaTest("Check header title of the Object Page", function (_Given, _When, Then) {
|
|
66
|
-
Then.onThe<%- name%>Generated.onHeader().iCheckTitlePath(<%- JSON.stringify(headerTitle) %>);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
<% } -%>
|
|
70
64
|
<% if (headerSections?.length > 0) { -%>
|
|
71
65
|
opaTest("Check header facets of the Object Page", function (Given, When, Then) {
|
|
72
66
|
<% headerSections.forEach(function(section) { -%>
|
|
@@ -80,12 +80,6 @@ function journey() {
|
|
|
80
80
|
});
|
|
81
81
|
<% } -%>
|
|
82
82
|
|
|
83
|
-
<% if (headerTitle) { -%>
|
|
84
|
-
opaTest("Check header title of the Object Page", function (_Given: Given, _When: When, Then: Then) {
|
|
85
|
-
Then.onThe<%- name%>Generated.onHeader().iCheckTitlePath(<%- JSON.stringify(headerTitle) %>);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
<% } -%>
|
|
89
83
|
<% if (headerSections?.length > 0) { -%>
|
|
90
84
|
opaTest("Check header facets of the Object Page", function (_Given: Given, _When: When, Then: Then) {
|
|
91
85
|
<% headerSections.forEach(function(section) { -%>
|
|
@@ -115,7 +109,7 @@ function journey() {
|
|
|
115
109
|
<% } -%>
|
|
116
110
|
<% if (bodySections?.length > 0) { -%>
|
|
117
111
|
<% bodySections.forEach(function(section) { -%>
|
|
118
|
-
opaTest("Check the <%- section.id %> section of the Object Page", function (_Given: Given, <% if (bodySections
|
|
112
|
+
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
113
|
<% if (bodySections.length > 1) { -%>
|
|
120
114
|
When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
|
|
121
115
|
<% } -%>
|
|
@@ -0,0 +1,49 @@
|
|
|
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("FPM journey");
|
|
26
|
+
|
|
27
|
+
opaTest("Start application", function (Given, When, Then) {
|
|
28
|
+
Given.iStartMyApp();
|
|
29
|
+
<%_ startPages.forEach(function(pageName) { %>
|
|
30
|
+
Then.onThe<%- pageName %>Generated.iSeeThisPage();
|
|
31
|
+
<%_ if (filterBarItems && filterBarItems.length > 0) { -%>
|
|
32
|
+
<%_ filterBarItems.forEach(function(item) { _%>
|
|
33
|
+
Then.onThe<%- pageName%>Generated.onFilterBar().iCheckFilterField({ property: "<%- item %>" });
|
|
34
|
+
<%_ }); -%>
|
|
35
|
+
<%_ } -%>
|
|
36
|
+
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { _%>
|
|
37
|
+
Then.onThe<%- pageName %>Generated.onTable().iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
38
|
+
<%_ } %>
|
|
39
|
+
<%_ }); -%>
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
opaTest("Teardown", function (Given, When, Then) {
|
|
43
|
+
// Cleanup
|
|
44
|
+
Given.iTearDownMyApp();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
runner.run([journey]);
|
|
49
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
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.iStartMyApp();
|
|
12
|
+
<% if (startLR) { %>Then.onThe<%- startLR %>.iSeeThisPage();<%} %>
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
<% if (startLR) { %>
|
|
16
|
+
opaTest("Navigate to ObjectPage", function (Given, When, Then) {
|
|
17
|
+
// Note: this test will fail if the ListReport page doesn't show any data
|
|
18
|
+
<% if (!hideFilterBar) { %>
|
|
19
|
+
When.onThe<%- startLR%>.onFilterBar().iExecuteSearch();
|
|
20
|
+
<%} %>
|
|
21
|
+
Then.onThe<%- startLR%>.onTable().iCheckRows();
|
|
22
|
+
<% if (navigatedOP) { %>
|
|
23
|
+
When.onThe<%- startLR%>.onTable().iPressRow(0);
|
|
24
|
+
Then.onThe<%- navigatedOP%>.iSeeThisPage();
|
|
25
|
+
<%} %>
|
|
26
|
+
});
|
|
27
|
+
<%} %>
|
|
28
|
+
opaTest("Teardown", function (Given, When, Then) {
|
|
29
|
+
// Cleanup
|
|
30
|
+
Given.iTearDownMyApp();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
runner.run([journey]);
|
|
35
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
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.iStartMyApp();
|
|
10
|
+
<% if (startLR) { %>Then.onThe<%- startLR %>Generated.iSeeThisPage();<%} %>
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
<% if (startLR) { %>
|
|
14
|
+
opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
|
|
15
|
+
// Note: this test will fail if the ListReport page doesn't show any data
|
|
16
|
+
<% if (!hideFilterBar) { %>
|
|
17
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
18
|
+
<%} %>
|
|
19
|
+
Then.onThe<%- startLR%>Generated.onTable("").iCheckRows();
|
|
20
|
+
<% if (navigatedOP) { %>
|
|
21
|
+
When.onThe<%- startLR%>Generated.onTable("").iPressRow(0);
|
|
22
|
+
Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
|
|
23
|
+
<%} %>
|
|
24
|
+
});
|
|
25
|
+
<%} %>
|
|
26
|
+
opaTest("Teardown", function (Given: Given) {
|
|
27
|
+
// Cleanup
|
|
28
|
+
Given.iTearDownMyApp();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
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
|
+
}
|