@sap-ux/ui5-test-writer 1.6.1 → 1.7.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.
- package/dist/fiori-elements-opa-writer.js +12 -4
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- 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
|
@@ -15,12 +15,20 @@ import { getPackageScripts } from '@sap-ux/fiori-generator-shared';
|
|
|
15
15
|
import { readHashFromFlpSandbox } from './utils/flpSandboxUtils.js';
|
|
16
16
|
import { compareUI5VersionGte } from '@sap-ux/ui5-application-writer';
|
|
17
17
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
18
|
-
const
|
|
18
|
+
const V4_TEMPLATE_LATEST = 'latest';
|
|
19
19
|
const V4_TEMPLATE_1_84 = '1.84';
|
|
20
|
-
const
|
|
20
|
+
const V4_TEMPLATE_BUCKETS = [
|
|
21
|
+
{ minVersion: '1.149.0', template: V4_TEMPLATE_LATEST },
|
|
22
|
+
{ minVersion: '1.148.0', template: '1.148' }
|
|
23
|
+
];
|
|
21
24
|
function getTemplateUi5Version(ui5Version) {
|
|
22
|
-
if (!ui5Version
|
|
23
|
-
return
|
|
25
|
+
if (!ui5Version) {
|
|
26
|
+
return V4_TEMPLATE_LATEST;
|
|
27
|
+
}
|
|
28
|
+
for (const bucket of V4_TEMPLATE_BUCKETS) {
|
|
29
|
+
if (compareUI5VersionGte(ui5Version, bucket.minVersion)) {
|
|
30
|
+
return bucket.template;
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
return V4_TEMPLATE_1_84;
|
|
26
34
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type OPAGenerationOptions = {
|
|
|
19
19
|
useVirtualPreviewEndpoints?: boolean;
|
|
20
20
|
/** If true, generate TypeScript files instead of JavaScript. */
|
|
21
21
|
enableTypeScript?: boolean;
|
|
22
|
-
/** Minimum UI5 version of the target app — selects template bucket ('1.84' / '1.
|
|
22
|
+
/** Minimum UI5 version of the target app — selects template bucket ('1.84' / '1.148' / 'latest'). */
|
|
23
23
|
ui5Version?: string;
|
|
24
24
|
};
|
|
25
25
|
export declare const SupportedPageTypes: {
|
|
@@ -254,7 +254,7 @@ export type WriteContext = {
|
|
|
254
254
|
hasPreexistingTests?: boolean;
|
|
255
255
|
incompatibleTestSetup?: boolean;
|
|
256
256
|
dotFileExtension: DotFileExtension;
|
|
257
|
-
/** Resolved template bucket folder name: '1.84'
|
|
257
|
+
/** Resolved template bucket folder name: '1.84', '1.148' or 'latest'. */
|
|
258
258
|
templateUi5Version: string;
|
|
259
259
|
/**
|
|
260
260
|
* When true, ux-specification-derived journeys (ListReport, ObjectPage, FPM) are generated.
|
package/package.json
CHANGED
|
@@ -0,0 +1,129 @@
|
|
|
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%>ListReport journey");
|
|
26
|
+
|
|
27
|
+
const defaultTableId = <%- tableIdentifiers && tableIdentifiers.length > 0 ? '"' + tableIdentifiers[0] + '"' : '""' %>;
|
|
28
|
+
|
|
29
|
+
opaTest("Start application", function (Given, When, Then) {
|
|
30
|
+
Given.iStartMyApp();
|
|
31
|
+
<%_ startPages.forEach(function(pageName) { %>
|
|
32
|
+
Then.onThe<%- pageName %>Generated.iSeeThisPage();
|
|
33
|
+
<%_ }); -%>
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
<%_ if (!hideFilterBar && filterBarItems && filterBarItems.length > 0) { -%>
|
|
37
|
+
opaTest("Check filter bar", function (Given, When, Then) {
|
|
38
|
+
<%_ filterBarItems.forEach(function(item) { _%>
|
|
39
|
+
<%_ if (item.custom) { _%>
|
|
40
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField("<%- item.description %>");
|
|
41
|
+
<%_ } else { _%>
|
|
42
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField({ property: "<%- item.property %>" });
|
|
43
|
+
<%_ } _%>
|
|
44
|
+
<%_ }); -%>
|
|
45
|
+
});
|
|
46
|
+
<%_ } -%>
|
|
47
|
+
<%_ if (semanticKey && semanticKey.missingFromFilterBar && semanticKey.missingFromFilterBar.length > 0) { %>
|
|
48
|
+
opaTest("Add semantic key properties to filter bar", function (Given, When, Then) {
|
|
49
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iOpenFilterAdaptation();
|
|
50
|
+
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
51
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iAddAdaptationFilterField({ property: "<%- property %>" });
|
|
52
|
+
<%_ }); -%>
|
|
53
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iConfirmFilterAdaptation();
|
|
54
|
+
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
55
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField({ property: "<%- property %>" });
|
|
56
|
+
<%_ }); -%>
|
|
57
|
+
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
58
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iChangeFilterField({ property: "<%- property %>" }, "<value to filter>", false);
|
|
59
|
+
<%_ }); -%>
|
|
60
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
61
|
+
// Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
|
|
62
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
63
|
+
// Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<Action Name>", { enabled: true });
|
|
64
|
+
});
|
|
65
|
+
<%_ } -%>
|
|
66
|
+
|
|
67
|
+
// Note: this test will only work if the ListReport page has a search field and shows data that matches the search term. Please ensure that the test data and search term are set up accordingly.
|
|
68
|
+
// opaTest("Perform a global search and check the result", function (Given, When, Then) {
|
|
69
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iChangeSearchField("Search Term");
|
|
70
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
71
|
+
// Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
|
|
72
|
+
// });
|
|
73
|
+
|
|
74
|
+
<%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
|
|
75
|
+
opaTest("Check table columns and actions", function (Given, When, Then) {
|
|
76
|
+
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
77
|
+
<%_ if (createButton.visible && !isALP) { _%>
|
|
78
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
79
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
|
|
80
|
+
<%_ } _%>
|
|
81
|
+
<%_ if (deleteButton.visible) { _%>
|
|
82
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
|
|
83
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
|
|
84
|
+
<%_ } _%>
|
|
85
|
+
<%_ toolBarActions.forEach(function(item) { _%>
|
|
86
|
+
<%_ if (item.visible) { _%>
|
|
87
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
88
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
89
|
+
<%_ } _%>
|
|
90
|
+
<%_ }); -%>
|
|
91
|
+
<%_ } -%>
|
|
92
|
+
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
93
|
+
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
94
|
+
<%_ } -%>
|
|
95
|
+
});
|
|
96
|
+
<%_ } -%>
|
|
97
|
+
|
|
98
|
+
<%_ if (startLR) { -%>
|
|
99
|
+
opaTest("Navigate to ObjectPage", function (Given, When, Then) {
|
|
100
|
+
// Note: this test will fail if the ListReport page doesn't show any data
|
|
101
|
+
<%_ if (!hideFilterBar) { -%>
|
|
102
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
103
|
+
<%_ } -%>
|
|
104
|
+
<%_ if (tableIdentifiers && tableIdentifiers.length > 0) { -%>
|
|
105
|
+
<%_ tableIdentifiers.forEach(function(tabId) { _%>
|
|
106
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tabId %>" });
|
|
107
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tabId %>").iCheckRows();
|
|
108
|
+
<%_ }); -%>
|
|
109
|
+
<%_ } else { -%>
|
|
110
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
|
|
111
|
+
<%_ } -%>
|
|
112
|
+
<%_ if (navigatedOP) { -%>
|
|
113
|
+
<%_ if (tableIdentifiers && tableIdentifiers.length > 0) { _%>
|
|
114
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: defaultTableId });
|
|
115
|
+
<%_ } _%>
|
|
116
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressRow(0);
|
|
117
|
+
Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
|
|
118
|
+
<%_ } -%>
|
|
119
|
+
});
|
|
120
|
+
<%_ } -%>
|
|
121
|
+
|
|
122
|
+
opaTest("Teardown", function (Given, When, Then) {
|
|
123
|
+
// Cleanup
|
|
124
|
+
Given.iTearDownMyApp();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
runner.run([journey]);
|
|
129
|
+
});
|
|
@@ -0,0 +1,133 @@
|
|
|
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 usesFilterFieldIdentifier =
|
|
22
|
+
!hideFilterBar && filterBarItems && filterBarItems.some(function(item) { return item.custom; });
|
|
23
|
+
-%>
|
|
24
|
+
<% if (usesFilterFieldIdentifier) { -%>
|
|
25
|
+
import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
|
|
26
|
+
<% } -%>
|
|
27
|
+
import runner from "./pages/JourneyRunner";
|
|
28
|
+
|
|
29
|
+
function journey() {
|
|
30
|
+
QUnit.module("<%- name%>ListReport journey");
|
|
31
|
+
|
|
32
|
+
const defaultTableId = <%- tableIdentifiers && tableIdentifiers.length > 0 ? '"' + tableIdentifiers[0] + '"' : '""' %>;
|
|
33
|
+
|
|
34
|
+
opaTest("Start application", function (Given: Given, _When: When, Then: Then) {
|
|
35
|
+
Given.iStartMyApp();
|
|
36
|
+
<%_ startPages.forEach(function(pageName) { %>
|
|
37
|
+
Then.onThe<%- pageName %>Generated.iSeeThisPage();
|
|
38
|
+
<%_ }); -%>
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
<%_ if (!hideFilterBar && filterBarItems && filterBarItems.length > 0) { -%>
|
|
42
|
+
opaTest("Check filter bar", function (_Given: Given, _When: When, Then: Then) {
|
|
43
|
+
<%_ filterBarItems.forEach(function(item) { _%>
|
|
44
|
+
<%_ if (item.custom) { _%>
|
|
45
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField("<%- item.description %>" as unknown as FilterFieldIdentifier);
|
|
46
|
+
<%_ } else { _%>
|
|
47
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField({ property: "<%- item.property %>" });
|
|
48
|
+
<%_ } _%>
|
|
49
|
+
<%_ }); -%>
|
|
50
|
+
});
|
|
51
|
+
<%_ } -%>
|
|
52
|
+
<%_ if (semanticKey && semanticKey.missingFromFilterBar && semanticKey.missingFromFilterBar.length > 0) { %>
|
|
53
|
+
opaTest("Add semantic key properties to filter bar", function (_Given: Given, When: When, Then: Then) {
|
|
54
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iOpenFilterAdaptation();
|
|
55
|
+
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
56
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iAddAdaptationFilterField({ property: "<%- property %>" });
|
|
57
|
+
<%_ }); -%>
|
|
58
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iConfirmFilterAdaptation();
|
|
59
|
+
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
60
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField({ property: "<%- property %>" });
|
|
61
|
+
<%_ }); -%>
|
|
62
|
+
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
63
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iChangeFilterField({ property: "<%- property %>" }, "<value to filter>", false);
|
|
64
|
+
<%_ }); -%>
|
|
65
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
66
|
+
// Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
|
|
67
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iSelectRows(0);
|
|
68
|
+
// Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<Action Name>", { enabled: true });
|
|
69
|
+
});
|
|
70
|
+
<%_ } -%>
|
|
71
|
+
|
|
72
|
+
// Note: this test will only work if the ListReport page has a search field and shows data that matches the search term. Please ensure that the test data and search term are set up accordingly.
|
|
73
|
+
// opaTest("Perform a global search and check the result", function (Given: Given, When: When, Then: Then) {
|
|
74
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iChangeSearchField("Search Term");
|
|
75
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
76
|
+
// Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
|
|
77
|
+
// });
|
|
78
|
+
|
|
79
|
+
<%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
|
|
80
|
+
opaTest("Check table columns and actions", function (_Given: Given, _When: When, Then: Then) {
|
|
81
|
+
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
82
|
+
<%_ if (createButton.visible && !isALP) { _%>
|
|
83
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckCreate({ visible: true });
|
|
84
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressCreate();
|
|
85
|
+
<%_ } _%>
|
|
86
|
+
<%_ if (deleteButton.visible) { _%>
|
|
87
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressDelete();
|
|
88
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckDelete({ visible: true });
|
|
89
|
+
<%_ } _%>
|
|
90
|
+
<%_ toolBarActions.forEach(function(item) { _%>
|
|
91
|
+
<%_ if (item.visible) { _%>
|
|
92
|
+
// When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressAction("<%- item.label %>");
|
|
93
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
94
|
+
<%_ } _%>
|
|
95
|
+
<%_ }); -%>
|
|
96
|
+
<%_ } -%>
|
|
97
|
+
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
98
|
+
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
99
|
+
<%_ } -%>
|
|
100
|
+
});
|
|
101
|
+
<%_ } -%>
|
|
102
|
+
|
|
103
|
+
<%_ if (startLR) { -%>
|
|
104
|
+
opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
|
|
105
|
+
// Note: this test will fail if the ListReport page doesn't show any data
|
|
106
|
+
<%_ if (!hideFilterBar) { -%>
|
|
107
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
108
|
+
<%_ } -%>
|
|
109
|
+
<%_ if (tableIdentifiers && tableIdentifiers.length > 0) { -%>
|
|
110
|
+
<%_ tableIdentifiers.forEach(function(tabId) { _%>
|
|
111
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tabId %>" });
|
|
112
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tabId %>").iCheckRows();
|
|
113
|
+
<%_ }); -%>
|
|
114
|
+
<%_ } else { -%>
|
|
115
|
+
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckRows();
|
|
116
|
+
<%_ } -%>
|
|
117
|
+
<%_ if (navigatedOP) { -%>
|
|
118
|
+
<%_ if (tableIdentifiers && tableIdentifiers.length > 0) { _%>
|
|
119
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: defaultTableId });
|
|
120
|
+
<%_ } _%>
|
|
121
|
+
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iPressRow(0);
|
|
122
|
+
Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
|
|
123
|
+
<%_ } -%>
|
|
124
|
+
});
|
|
125
|
+
<%_ } -%>
|
|
126
|
+
|
|
127
|
+
opaTest("Teardown", function (Given: Given) {
|
|
128
|
+
// Cleanup
|
|
129
|
+
Given.iTearDownMyApp();
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
runner.run([journey]);
|
|
@@ -0,0 +1,163 @@
|
|
|
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 > 1) { -%>
|
|
86
|
+
opaTest("Check the number of sections of the Object Page", function (_Given, _When, Then) {
|
|
87
|
+
Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
<% } -%>
|
|
91
|
+
<% if (bodySections?.length > 0) { -%>
|
|
92
|
+
<% bodySections.forEach(function(section) { -%>
|
|
93
|
+
opaTest("Check the <%- section.id %> section of the Object Page", function (_Given, <% if (bodySections.length > 1) { %>When<% } else { %>_When<% } %>, Then) {
|
|
94
|
+
<% if (bodySections.length > 1) { -%>
|
|
95
|
+
When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
|
|
96
|
+
<% } -%>
|
|
97
|
+
Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" });
|
|
98
|
+
<% if (section.actions && section.actions.length > 0) { -%>
|
|
99
|
+
<% section.actions.forEach(function(action) { -%>
|
|
100
|
+
<% if (action.visible) { -%>
|
|
101
|
+
<% if (section.isTable && section.navigationProperty) { -%>
|
|
102
|
+
<% if (action.enabled === 'dynamic') { -%>
|
|
103
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
104
|
+
<% } else { -%>
|
|
105
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
|
|
106
|
+
<% } -%>
|
|
107
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
108
|
+
<% } else { -%>
|
|
109
|
+
<% if (action.enabled === 'dynamic') { -%>
|
|
110
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> } /* , { enabled: true } */);
|
|
111
|
+
<% } else { -%>
|
|
112
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> }, { enabled: <%- action.enabled === true %> });
|
|
113
|
+
<% } -%>
|
|
114
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iPressAction({ service: "<%- action.service %>", action: "<%- action.action %>", unbound: <%- action.unbound === true %> });
|
|
115
|
+
<% } -%>
|
|
116
|
+
<% } -%>
|
|
117
|
+
<% }); -%>
|
|
118
|
+
<% } -%>
|
|
119
|
+
<% if (section.isTable && section.navigationProperty) { -%>
|
|
120
|
+
<% if (section.createButton?.visible) { -%>
|
|
121
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
|
|
122
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
|
|
123
|
+
<% } -%>
|
|
124
|
+
<% if (section.deleteButton?.visible) { -%>
|
|
125
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
|
|
126
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
|
|
127
|
+
<% } -%>
|
|
128
|
+
<% } -%>
|
|
129
|
+
<% if (section?.subSections?.length > 0) { -%>
|
|
130
|
+
<% section.subSections.forEach(function(subSection) { -%>
|
|
131
|
+
//When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
|
|
132
|
+
Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
|
|
133
|
+
<% if (subSection.fields && subSection.fields.length > 0) { -%>
|
|
134
|
+
<% subSection.fields.forEach(function(field) { -%>
|
|
135
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
|
|
136
|
+
<% }) -%>
|
|
137
|
+
<% } -%>
|
|
138
|
+
<% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
|
|
139
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(subSection.tableColumns) %>);
|
|
140
|
+
<% } -%>
|
|
141
|
+
<% }) -%>
|
|
142
|
+
<% } else { -%>
|
|
143
|
+
<% if (section.fields && section.fields.length > 0) { -%>
|
|
144
|
+
<% section.fields.forEach(function(field) { -%>
|
|
145
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
|
|
146
|
+
<% }) -%>
|
|
147
|
+
<% } -%>
|
|
148
|
+
<% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
|
|
149
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
|
|
150
|
+
<% } -%>
|
|
151
|
+
<% } -%>
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
<% }) -%>
|
|
155
|
+
<% } -%>
|
|
156
|
+
opaTest("Teardown", function (Given, When, Then) {
|
|
157
|
+
// Cleanup
|
|
158
|
+
Given.iTearDownMyApp();
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
runner.run([journey]);
|
|
163
|
+
});
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
* ║ Do not edit this file directly. Any changes will be lost. ║ *
|
|
10
|
+
* ║ ║ *
|
|
11
|
+
* ╚═══════════════════════════════════════════════════════════════════════╝ *
|
|
12
|
+
******************************************************************************/
|
|
13
|
+
|
|
14
|
+
import type Opa5 from "sap/ui/test/Opa5";
|
|
15
|
+
<% if (pages.some(p => p.template === 'ListReport')) { -%>
|
|
16
|
+
import type { actions as ListReportActions, assertions as ListReportAssertions } from "sap/fe/test/ListReport";
|
|
17
|
+
<% } -%>
|
|
18
|
+
<% if (pages.some(p => p.template === 'ObjectPage')) { -%>
|
|
19
|
+
import type { actions as ObjectPageActions, assertions as ObjectPageAssertions } from "sap/fe/test/ObjectPage";
|
|
20
|
+
<% } -%>
|
|
21
|
+
<% if (pages.some(p => p.template === 'ListReport' || p.template === 'ObjectPage')) { -%>
|
|
22
|
+
import type { actions as TemplatePageActions, assertions as TemplatePageAssertions } from "sap/fe/test/TemplatePage";
|
|
23
|
+
<% } -%>
|
|
24
|
+
import type Shell from "sap/fe/test/Shell";
|
|
25
|
+
import type BaseArrangements from "sap/fe/test/BaseArrangements";
|
|
26
|
+
<% pages.filter((p) => p.template === 'ListReport' || p.template === 'ObjectPage').forEach(function(page) { -%>
|
|
27
|
+
import type { actions as <%- page.targetKey %>GeneratedCustomActions, assertions as <%- page.targetKey %>GeneratedCustomAssertions } from "../pages/<%- page.targetKey %>.gen";
|
|
28
|
+
<% }); -%>
|
|
29
|
+
|
|
30
|
+
export type Given = Opa5 & BaseArrangements & {
|
|
31
|
+
iTearDownMyApp: () => Given;
|
|
32
|
+
iStartMyApp: (sAppHash?: string, mInUrlParameters?: object) => Given;
|
|
33
|
+
and: Given;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type When = Opa5 & BaseArrangements & {
|
|
37
|
+
<% pages.forEach(function(page) { -%>
|
|
38
|
+
<% if (page.template === 'ListReport') { -%>
|
|
39
|
+
onThe<%- page.targetKey %>Generated: Opa5 & ListReportActions & TemplatePageActions & typeof <%- page.targetKey %>GeneratedCustomActions;
|
|
40
|
+
<% } else if (page.template === 'ObjectPage') { -%>
|
|
41
|
+
onThe<%- page.targetKey %>Generated: Opa5 & ObjectPageActions & TemplatePageActions & typeof <%- page.targetKey %>GeneratedCustomActions;
|
|
42
|
+
<% } -%>
|
|
43
|
+
<% }); -%>
|
|
44
|
+
onTheShell: Shell;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type Then = Opa5 & BaseArrangements & {
|
|
48
|
+
<% pages.forEach(function(page) { -%>
|
|
49
|
+
<% if (page.template === 'ListReport') { -%>
|
|
50
|
+
onThe<%- page.targetKey %>Generated: Opa5 & ListReportAssertions & TemplatePageAssertions & typeof <%- page.targetKey %>GeneratedCustomAssertions;
|
|
51
|
+
<% } else if (page.template === 'ObjectPage') { -%>
|
|
52
|
+
onThe<%- page.targetKey %>Generated: Opa5 & ObjectPageAssertions & TemplatePageAssertions & typeof <%- page.targetKey %>GeneratedCustomAssertions;
|
|
53
|
+
<% } -%>
|
|
54
|
+
<% }); -%>
|
|
55
|
+
onTheShell: Shell;
|
|
56
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|