@sap-ux/ui5-test-writer 1.1.13 → 1.2.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 +360 -143
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/translations/ui5-test-writer.i18n.json +10 -0
- package/dist/types.d.ts +10 -0
- package/dist/utils/fileWritingUtils.d.ts +55 -0
- package/dist/utils/fileWritingUtils.js +103 -0
- package/dist/utils/journeyRunnerUtils.d.ts +64 -0
- package/dist/utils/journeyRunnerUtils.js +251 -0
- package/dist/utils/opaJourneyTypesUtils.d.ts +27 -0
- package/dist/utils/opaJourneyTypesUtils.js +167 -0
- package/dist/utils/opaQUnitUtils.d.ts +6 -92
- package/dist/utils/opaQUnitUtils.js +20 -374
- package/dist/utils/virtualOpaUtils.d.ts +21 -0
- package/dist/utils/virtualOpaUtils.js +51 -0
- package/package.json +2 -1
- package/templates/v4/integration/FPMJourney.js +3 -3
- package/templates/v4/integration/FirstJourney.ts +5 -5
- package/templates/v4/integration/ListReportJourney.js +25 -25
- package/templates/v4/integration/ListReportJourney.ts +25 -25
- package/templates/v4/integration/ObjectPageJourney.js +37 -37
- package/templates/v4/integration/ObjectPageJourney.ts +38 -38
- package/templates/v4/integration/opaTests.qunit.js +5 -2
- package/templates/v4/integration/pages/FPM.js +17 -0
- package/templates/v4/integration/pages/JourneyRunner.js +6 -6
- package/templates/v4/integration/pages/JourneyRunner.ts +21 -12
- package/templates/v4/integration/pages/ListReport.js +17 -0
- package/templates/v4/integration/pages/ObjectPage.js +17 -0
- package/templates/v4/integration/types/OpaJourneyTypes.d.ts +5 -5
|
@@ -27,64 +27,64 @@ sap.ui.define([
|
|
|
27
27
|
opaTest("Start application", function (Given, When, Then) {
|
|
28
28
|
Given.iStartMyApp();
|
|
29
29
|
<%_ startPages.forEach(function(pageName) { %>
|
|
30
|
-
Then.onThe<%- pageName
|
|
30
|
+
Then.onThe<%- pageName %>Generated.iSeeThisPage();
|
|
31
31
|
<%_ }); -%>
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
<%_ if (!hideFilterBar && filterBarItems && filterBarItems.length > 0) { -%>
|
|
35
35
|
opaTest("Check filter bar", function (Given, When, Then) {
|
|
36
36
|
<%_ filterBarItems.forEach(function(item) { _%>
|
|
37
|
-
Then.onThe<%- startLR
|
|
37
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField("<%- item %>");
|
|
38
38
|
<%_ }); -%>
|
|
39
39
|
});
|
|
40
40
|
<%_ } -%>
|
|
41
41
|
<%_ if (semanticKey && semanticKey.missingFromFilterBar && semanticKey.missingFromFilterBar.length > 0) { %>
|
|
42
42
|
opaTest("Add semantic key properties to filter bar", function (Given, When, Then) {
|
|
43
|
-
Then.onThe<%- startLR
|
|
43
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iOpenFilterAdaptation();
|
|
44
44
|
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
45
|
-
When.onThe<%- startLR
|
|
45
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iAddAdaptationFilterField("<%- property %>");
|
|
46
46
|
<%_ }); -%>
|
|
47
|
-
Then.onThe<%- startLR
|
|
47
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iConfirmFilterAdaptation();
|
|
48
48
|
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
49
|
-
Then.onThe<%- startLR
|
|
49
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField("<%- property %>");
|
|
50
50
|
<%_ }); -%>
|
|
51
51
|
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
52
|
-
// Then.onThe<%- startLR
|
|
52
|
+
// Then.onThe<%- startLR%>Generated.onFilterBar().iChangeFilterField("<%- property %>");
|
|
53
53
|
<%_ }); -%>
|
|
54
|
-
// Then.onThe<%- startLR
|
|
55
|
-
// Then.onThe<%- startLR
|
|
56
|
-
// Then.onThe<%- startLR
|
|
57
|
-
// Then.onThe<%- startLR
|
|
54
|
+
// Then.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
55
|
+
// Then.onThe<%- startLR%>Generated.onTable().iCheckRows();
|
|
56
|
+
// Then.onThe<%- startLR%>Generated.onTable().iSelectRows(0);
|
|
57
|
+
// Then.onThe<%- startLR%>Generated.onTable().iCheckAction("<Action Name>", { enabled: true });
|
|
58
58
|
});
|
|
59
59
|
<%_ } -%>
|
|
60
60
|
|
|
61
61
|
// 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.
|
|
62
62
|
// opaTest("Perform a global search and check the result", function (Given, When, Then) {
|
|
63
|
-
// When.onThe<%- startLR
|
|
64
|
-
// When.onThe<%- startLR
|
|
65
|
-
// Then.onThe<%- startLR
|
|
63
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iChangeSearchField("Search Term");
|
|
64
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
65
|
+
// Then.onThe<%- startLR%>Generated.onTable().iCheckRows();
|
|
66
66
|
// });
|
|
67
67
|
|
|
68
68
|
<%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
|
|
69
69
|
opaTest("Check table columns and actions", function (Given, When, Then) {
|
|
70
70
|
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
71
71
|
<%_ if (createButton.visible && !isALP) { _%>
|
|
72
|
-
Then.onThe<%- startLR
|
|
73
|
-
// Then.
|
|
72
|
+
Then.onThe<%- startLR%>Generated.onTable().iCheckCreate({ visible: true });
|
|
73
|
+
// Then.onThe<%- startLR%>Generated.onTable().iPressCreate();
|
|
74
74
|
<%_ } _%>
|
|
75
75
|
<%_ if (deleteButton.visible) { _%>
|
|
76
|
-
// Then.
|
|
77
|
-
Then.onThe<%- startLR
|
|
76
|
+
// Then.onThe<%- startLR%>Generated.onTable().iPressDelete();
|
|
77
|
+
Then.onThe<%- startLR%>Generated.onTable().iCheckDelete({ visible: true });
|
|
78
78
|
<%_ } _%>
|
|
79
79
|
<%_ toolBarActions.forEach(function(item) { _%>
|
|
80
80
|
<%_ if (item.visible) { _%>
|
|
81
|
-
// Then.onThe<%- startLR
|
|
82
|
-
Then.onThe<%- startLR
|
|
81
|
+
// Then.onThe<%- startLR%>Generated.onTable().iPressAction("<%- item.label %>");
|
|
82
|
+
Then.onThe<%- startLR%>Generated.onTable().iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
83
83
|
<%_ } _%>
|
|
84
84
|
<%_ }); -%>
|
|
85
85
|
<%_ } -%>
|
|
86
86
|
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
87
|
-
Then.onThe<%- startLR
|
|
87
|
+
Then.onThe<%- startLR %>Generated.onTable().iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
88
88
|
<%_ } %>
|
|
89
89
|
});
|
|
90
90
|
<%_ } %>
|
|
@@ -93,12 +93,12 @@ sap.ui.define([
|
|
|
93
93
|
opaTest("Navigate to ObjectPage", function (Given, When, Then) {
|
|
94
94
|
// Note: this test will fail if the ListReport page doesn't show any data
|
|
95
95
|
<% if (!hideFilterBar) { %>
|
|
96
|
-
When.onThe<%- startLR
|
|
96
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
97
97
|
<%} %>
|
|
98
|
-
Then.onThe<%- startLR
|
|
98
|
+
Then.onThe<%- startLR%>Generated.onTable().iCheckRows();
|
|
99
99
|
<% if (navigatedOP) { %>
|
|
100
|
-
When.onThe<%- startLR
|
|
101
|
-
Then.onThe<%- navigatedOP
|
|
100
|
+
When.onThe<%- startLR%>Generated.onTable().iPressRow(0);
|
|
101
|
+
Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
|
|
102
102
|
<%} %>
|
|
103
103
|
});
|
|
104
104
|
<%} %>
|
|
@@ -33,64 +33,64 @@ function journey() {
|
|
|
33
33
|
opaTest("Start application", function (Given: Given, _When: When, Then: Then) {
|
|
34
34
|
Given.iStartMyApp();
|
|
35
35
|
<%_ startPages.forEach(function(pageName) { %>
|
|
36
|
-
Then.onThe<%- pageName
|
|
36
|
+
Then.onThe<%- pageName %>Generated.iSeeThisPage();
|
|
37
37
|
<%_ }); -%>
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
<%_ if (!hideFilterBar && filterBarItems && filterBarItems.length > 0) { -%>
|
|
41
41
|
opaTest("Check filter bar", function (_Given: Given, _When: When, Then: Then) {
|
|
42
42
|
<%_ filterBarItems.forEach(function(item) { _%>
|
|
43
|
-
Then.onThe<%- startLR
|
|
43
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField("<%- item %>" as unknown as FilterFieldIdentifier);
|
|
44
44
|
<%_ }); -%>
|
|
45
45
|
});
|
|
46
46
|
<%_ } -%>
|
|
47
47
|
<%_ if (semanticKey && semanticKey.missingFromFilterBar && semanticKey.missingFromFilterBar.length > 0) { %>
|
|
48
48
|
opaTest("Add semantic key properties to filter bar", function (_Given: Given, When: When, Then: Then) {
|
|
49
|
-
Then.onThe<%- startLR
|
|
49
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iOpenFilterAdaptation();
|
|
50
50
|
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
51
|
-
When.onThe<%- startLR
|
|
51
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iAddAdaptationFilterField("<%- property %>");
|
|
52
52
|
<%_ }); -%>
|
|
53
|
-
Then.onThe<%- startLR
|
|
53
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iConfirmFilterAdaptation();
|
|
54
54
|
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
55
|
-
Then.onThe<%- startLR
|
|
55
|
+
Then.onThe<%- startLR%>Generated.onFilterBar().iCheckFilterField("<%- property %>" as unknown as FilterFieldIdentifier);
|
|
56
56
|
<%_ }); -%>
|
|
57
57
|
<%_ semanticKey.missingFromFilterBar.forEach(function(property) { _%>
|
|
58
|
-
// Then.onThe<%- startLR
|
|
58
|
+
// Then.onThe<%- startLR%>Generated.onFilterBar().iChangeFilterField({ property: "<%- property %>" });
|
|
59
59
|
<%_ }); -%>
|
|
60
|
-
// Then.onThe<%- startLR
|
|
61
|
-
// Then.onThe<%- startLR
|
|
62
|
-
// Then.onThe<%- startLR
|
|
63
|
-
// Then.onThe<%- startLR
|
|
60
|
+
// Then.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
61
|
+
// Then.onThe<%- startLR%>Generated.onTable("").iCheckRows();
|
|
62
|
+
// Then.onThe<%- startLR%>Generated.onTable("").iSelectRows(0);
|
|
63
|
+
// Then.onThe<%- startLR%>Generated.onTable("").iCheckAction("<Action Name>", { enabled: true });
|
|
64
64
|
});
|
|
65
65
|
<%_ } -%>
|
|
66
66
|
|
|
67
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
68
|
// opaTest("Perform a global search and check the result", function (Given: Given, When: When, Then: Then) {
|
|
69
|
-
// When.onThe<%- startLR
|
|
70
|
-
// When.onThe<%- startLR
|
|
71
|
-
// Then.onThe<%- startLR
|
|
69
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iChangeSearchField("Search Term");
|
|
70
|
+
// When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
71
|
+
// Then.onThe<%- startLR%>Generated.onTable("").iCheckRows();
|
|
72
72
|
// });
|
|
73
73
|
|
|
74
74
|
<%_ if ((toolBarActions && toolBarActions.length > 0 ) || (tableColumns && Object.keys(tableColumns).length > 0)) { -%>
|
|
75
75
|
opaTest("Check table columns and actions", function (_Given: Given, _When: When, Then: Then) {
|
|
76
76
|
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
77
77
|
<%_ if (createButton.visible && !isALP) { _%>
|
|
78
|
-
Then.onThe<%- startLR
|
|
79
|
-
// Then.onthe<%- startLR
|
|
78
|
+
Then.onThe<%- startLR%>Generated.onTable("").iCheckCreate({ visible: true });
|
|
79
|
+
// Then.onthe<%- startLR%>Generated.onTable("").iPressCreate();
|
|
80
80
|
<%_ } _%>
|
|
81
81
|
<%_ if (deleteButton.visible) { _%>
|
|
82
|
-
// Then.onthe<%- startLR
|
|
83
|
-
Then.onThe<%- startLR
|
|
82
|
+
// Then.onthe<%- startLR%>Generated.onTable("").iPressDelete();
|
|
83
|
+
Then.onThe<%- startLR%>Generated.onTable("").iCheckDelete({ visible: true });
|
|
84
84
|
<%_ } _%>
|
|
85
85
|
<%_ toolBarActions.forEach(function(item) { _%>
|
|
86
86
|
<%_ if (item.visible) { _%>
|
|
87
|
-
// Then.onThe<%- startLR
|
|
88
|
-
Then.onThe<%- startLR
|
|
87
|
+
// Then.onThe<%- startLR%>Generated.onTable("").iPressAction("<%- item.label %>");
|
|
88
|
+
Then.onThe<%- startLR%>Generated.onTable("").iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
89
89
|
<%_ } _%>
|
|
90
90
|
<%_ }); -%>
|
|
91
91
|
<%_ } -%>
|
|
92
92
|
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
93
|
-
Then.onThe<%- startLR
|
|
93
|
+
Then.onThe<%- startLR %>Generated.onTable("").iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
94
94
|
<%_ } %>
|
|
95
95
|
});
|
|
96
96
|
<%_ } %>
|
|
@@ -99,12 +99,12 @@ function journey() {
|
|
|
99
99
|
opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
|
|
100
100
|
// Note: this test will fail if the ListReport page doesn't show any data
|
|
101
101
|
<% if (!hideFilterBar) { %>
|
|
102
|
-
When.onThe<%- startLR
|
|
102
|
+
When.onThe<%- startLR%>Generated.onFilterBar().iExecuteSearch();
|
|
103
103
|
<%} %>
|
|
104
|
-
Then.onThe<%- startLR
|
|
104
|
+
Then.onThe<%- startLR%>Generated.onTable("").iCheckRows();
|
|
105
105
|
<% if (navigatedOP) { %>
|
|
106
|
-
When.onThe<%- startLR
|
|
107
|
-
Then.onThe<%- navigatedOP
|
|
106
|
+
When.onThe<%- startLR%>Generated.onTable("").iPressRow(0);
|
|
107
|
+
Then.onThe<%- navigatedOP%>Generated.iSeeThisPage();
|
|
108
108
|
<%} %>
|
|
109
109
|
});
|
|
110
110
|
<%} %>
|
|
@@ -27,33 +27,33 @@ sap.ui.define([
|
|
|
27
27
|
opaTest("Navigate to <%- name%>ObjectPage", function (Given, When, Then) {
|
|
28
28
|
Given.iStartMyApp();
|
|
29
29
|
<% if (!hideFilterBar) { %>
|
|
30
|
-
When.onThe<%- navigationParents.parentLRName
|
|
30
|
+
When.onThe<%- navigationParents.parentLRName%>Generated.onFilterBar().iExecuteSearch();
|
|
31
31
|
<% } %>
|
|
32
|
-
Then.onThe<%- navigationParents.parentLRName
|
|
33
|
-
When.onThe<%- navigationParents.parentLRName
|
|
32
|
+
Then.onThe<%- navigationParents.parentLRName%>Generated.onTable().iCheckRows();
|
|
33
|
+
When.onThe<%- navigationParents.parentLRName%>Generated.onTable().iPressRow(0);
|
|
34
34
|
<% if(navigationParents.parentOPName) { %>
|
|
35
|
-
Then.onThe<%- navigationParents.parentOPName
|
|
36
|
-
Then.onThe<%- navigationParents.parentOPName
|
|
37
|
-
When.onThe<%- navigationParents.parentOPName
|
|
35
|
+
Then.onThe<%- navigationParents.parentOPName%>Generated.iSeeThisPage();
|
|
36
|
+
Then.onThe<%- navigationParents.parentOPName%>Generated.onTable({ property: "<%- navigationParents.parentOPTableSection %>" }).iCheckRows();
|
|
37
|
+
When.onThe<%- navigationParents.parentOPName%>Generated.onTable({ property: "<%- navigationParents.parentOPTableSection %>" }).iPressRow(0);
|
|
38
38
|
<% } %>
|
|
39
|
-
Then.onThe<%- name
|
|
39
|
+
Then.onThe<%- name%>Generated.iSeeThisPage();
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
<% if (headerActions?.length > 0
|
|
42
|
+
<% if (headerActions?.length > 0) { -%>
|
|
43
43
|
opaTest("Check header actions of the Object Page", function (Given, When, Then) {
|
|
44
44
|
<% if (editButton?.visible) { -%>
|
|
45
45
|
// Ensure the opened entity is not in Draft state before uncommenting
|
|
46
|
-
// Then.onThe<%- name
|
|
47
|
-
// When.onThe<%- name
|
|
46
|
+
// Then.onThe<%- name%>Generated.onHeader().iCheckEdit({ visible: true });
|
|
47
|
+
// When.onThe<%- name%>Generated.onHeader().iPressEdit();
|
|
48
48
|
<% } -%>
|
|
49
49
|
<% headerActions.forEach(function(action) { -%>
|
|
50
50
|
<% if (action.visible) { -%>
|
|
51
51
|
<% if (action.enabled === 'dynamic') { -%>
|
|
52
|
-
Then.onThe<%- name
|
|
52
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction("<%- action.label %>" /* , { enabled: true } */);
|
|
53
53
|
<% } else { -%>
|
|
54
|
-
Then.onThe<%- name
|
|
54
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction("<%- action.label %>", { enabled: <%- action.enabled === true %> });
|
|
55
55
|
<% } -%>
|
|
56
|
-
// When.onThe<%- name
|
|
56
|
+
// When.onThe<%- name%>Generated.onHeader().iPressAction("<%- action.label %>");
|
|
57
57
|
<% } -%>
|
|
58
58
|
<% }); -%>
|
|
59
59
|
});
|
|
@@ -63,13 +63,13 @@ sap.ui.define([
|
|
|
63
63
|
opaTest("Check header facets of the Object Page", function (Given, When, Then) {
|
|
64
64
|
<% headerSections.forEach(function(section) { -%>
|
|
65
65
|
<% if (section.microChart) { -%>
|
|
66
|
-
Then.onThe<%- name
|
|
66
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckMicroChart("<%- section.title %>");
|
|
67
67
|
<% } else { -%>
|
|
68
|
-
Then.onThe<%- name
|
|
68
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckHeaderFacet({ facetId: "<%- section.facetId %>"<% if (section.custom) { %>, custom: true<% } %> });
|
|
69
69
|
<% if (section.form) { -%>
|
|
70
70
|
<% section.fields.forEach(function(field) { -%>
|
|
71
|
-
Then.onThe<%- name
|
|
72
|
-
fieldGroup: "
|
|
71
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckFieldInFieldGroup({
|
|
72
|
+
fieldGroup: "<%- field.fieldGroupQualifier %>",
|
|
73
73
|
field: "<%- field.field %>",
|
|
74
74
|
targetAnnotation: "<%- field.targetAnnotation %>"
|
|
75
75
|
});
|
|
@@ -80,68 +80,68 @@ sap.ui.define([
|
|
|
80
80
|
});
|
|
81
81
|
<% } -%>
|
|
82
82
|
|
|
83
|
-
<% if (bodySections?.length > 0
|
|
83
|
+
<% if (bodySections?.length > 0) { -%>
|
|
84
84
|
opaTest("Check body sections of the Object Page", function (Given, When, Then) {
|
|
85
85
|
<% if (bodySections?.length > 1) { -%>
|
|
86
|
-
Then.onThe<%- name
|
|
86
|
+
Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
|
|
87
87
|
<% } -%>
|
|
88
88
|
<% bodySections.forEach(function(section) { -%>
|
|
89
89
|
<% if (bodySections.length > 1) { -%>
|
|
90
|
-
When.onThe<%- name
|
|
90
|
+
When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
|
|
91
91
|
<% } -%>
|
|
92
|
-
Then.onThe<%- name
|
|
92
|
+
Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" });
|
|
93
93
|
<% if (section.actions && section.actions.length > 0) { -%>
|
|
94
94
|
<% section.actions.forEach(function(action) { -%>
|
|
95
95
|
<% if (action.visible) { -%>
|
|
96
96
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
97
97
|
<% if (action.enabled === 'dynamic') { -%>
|
|
98
|
-
Then.onThe<%- name
|
|
98
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction("<%- action.label %>" /* , { enabled: true } */);
|
|
99
99
|
<% } else { -%>
|
|
100
|
-
Then.onThe<%- name
|
|
100
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction("<%- action.label %>", { enabled: <%- action.enabled === true %> });
|
|
101
101
|
<% } -%>
|
|
102
|
-
// When.onThe<%- name
|
|
102
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction("<%- action.label %>");
|
|
103
103
|
<% } else { -%>
|
|
104
104
|
<% if (action.enabled === 'dynamic') { -%>
|
|
105
|
-
Then.onThe<%- name
|
|
105
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction("<%- action.label %>" /* , { enabled: true } */);
|
|
106
106
|
<% } else { -%>
|
|
107
|
-
Then.onThe<%- name
|
|
107
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckAction("<%- action.label %>", { enabled: <%- action.enabled === true %> });
|
|
108
108
|
<% } -%>
|
|
109
|
-
// When.onThe<%- name
|
|
109
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iPressAction("<%- action.label %>");
|
|
110
110
|
<% } -%>
|
|
111
111
|
<% } -%>
|
|
112
112
|
<% }); -%>
|
|
113
113
|
<% } -%>
|
|
114
114
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
115
115
|
<% if (section.createButton?.visible) { -%>
|
|
116
|
-
Then.onThe<%- name
|
|
117
|
-
// When.onThe<%- name
|
|
116
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
|
|
117
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
|
|
118
118
|
<% } -%>
|
|
119
119
|
<% if (section.deleteButton?.visible) { -%>
|
|
120
|
-
Then.onThe<%- name
|
|
121
|
-
// When.onThe<%- name
|
|
120
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
|
|
121
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
|
|
122
122
|
<% } -%>
|
|
123
123
|
<% } -%>
|
|
124
124
|
<% if (section?.subSections?.length > 0) { -%>
|
|
125
125
|
<% section.subSections.forEach(function(subSection) { -%>
|
|
126
|
-
//When.onThe<%- name
|
|
127
|
-
Then.onThe<%- name
|
|
126
|
+
//When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
|
|
127
|
+
Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
|
|
128
128
|
<% if (subSection.fields && subSection.fields.length > 0) { -%>
|
|
129
129
|
<% subSection.fields.forEach(function(field) { -%>
|
|
130
|
-
Then.onThe<%- name
|
|
130
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" }).iCheckField({ property: "<%- field.property %>" });
|
|
131
131
|
<% }) -%>
|
|
132
132
|
<% } -%>
|
|
133
133
|
<% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
|
|
134
|
-
Then.onThe<%- name
|
|
134
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(<%- JSON.stringify(subSection.tableColumns) %>);
|
|
135
135
|
<% } -%>
|
|
136
136
|
<% }) -%>
|
|
137
137
|
<% } else { -%>
|
|
138
138
|
<% if (section.fields && section.fields.length > 0) { -%>
|
|
139
139
|
<% section.fields.forEach(function(field) { -%>
|
|
140
|
-
Then.onThe<%- name
|
|
140
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" }).iCheckField({ property: "<%- field.property %>" });
|
|
141
141
|
<% }) -%>
|
|
142
142
|
<% } -%>
|
|
143
143
|
<% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
|
|
144
|
-
Then.onThe<%- name
|
|
144
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(<%- JSON.stringify(section.tableColumns) %>);
|
|
145
145
|
<% } -%>
|
|
146
146
|
<% } -%>
|
|
147
147
|
<% }) -%>
|
|
@@ -21,7 +21,7 @@ import type { Given, When, Then } from "./types/OpaJourneyTypes";
|
|
|
21
21
|
const usesFieldIdentifier = (headerSections || []).some(function(section) {
|
|
22
22
|
return section.form && section.fields && section.fields.length > 0;
|
|
23
23
|
});
|
|
24
|
-
const usesFormIdentifier =
|
|
24
|
+
const usesFormIdentifier = (bodySections || []).some(function(section) {
|
|
25
25
|
const subSectionsHaveForm = (section.subSections || []).some(function(sub) {
|
|
26
26
|
return sub.fields && sub.fields.length > 0;
|
|
27
27
|
});
|
|
@@ -46,33 +46,33 @@ function journey() {
|
|
|
46
46
|
opaTest("Navigate to <%- name%>ObjectPage", function (Given: Given, When: When, Then: Then) {
|
|
47
47
|
Given.iStartMyApp();
|
|
48
48
|
<% if (!hideFilterBar) { %>
|
|
49
|
-
When.onThe<%- navigationParents.parentLRName
|
|
49
|
+
When.onThe<%- navigationParents.parentLRName%>Generated.onFilterBar().iExecuteSearch();
|
|
50
50
|
<% } %>
|
|
51
|
-
Then.onThe<%- navigationParents.parentLRName
|
|
52
|
-
When.onThe<%- navigationParents.parentLRName
|
|
51
|
+
Then.onThe<%- navigationParents.parentLRName%>Generated.onTable("").iCheckRows();
|
|
52
|
+
When.onThe<%- navigationParents.parentLRName%>Generated.onTable("").iPressRow(0);
|
|
53
53
|
<% if(navigationParents.parentOPName) { %>
|
|
54
|
-
Then.onThe<%- navigationParents.parentOPName
|
|
55
|
-
Then.onThe<%- navigationParents.parentOPName
|
|
56
|
-
When.onThe<%- navigationParents.parentOPName
|
|
54
|
+
Then.onThe<%- navigationParents.parentOPName%>Generated.iSeeThisPage();
|
|
55
|
+
Then.onThe<%- navigationParents.parentOPName%>Generated.onTable({ property: "<%- navigationParents.parentOPTableSection %>" }).iCheckRows();
|
|
56
|
+
When.onThe<%- navigationParents.parentOPName%>Generated.onTable({ property: "<%- navigationParents.parentOPTableSection %>" }).iPressRow(0);
|
|
57
57
|
<% } %>
|
|
58
|
-
Then.onThe<%- name
|
|
58
|
+
Then.onThe<%- name%>Generated.iSeeThisPage();
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
<% if (headerActions?.length > 0
|
|
61
|
+
<% if (headerActions?.length > 0) { -%>
|
|
62
62
|
opaTest("Check header actions of the Object Page", function (_Given: Given, _When: When, Then: Then) {
|
|
63
63
|
<% if (editButton?.visible) { -%>
|
|
64
64
|
// Ensure the opened entity is not in Draft state before uncommenting
|
|
65
|
-
// Then.onThe<%- name
|
|
66
|
-
// When.onThe<%- name
|
|
65
|
+
// Then.onThe<%- name%>Generated.onHeader().iCheckEdit({ visible: true });
|
|
66
|
+
// When.onThe<%- name%>Generated.onHeader().iPressEdit();
|
|
67
67
|
<% } -%>
|
|
68
68
|
<% headerActions.forEach(function(action) { -%>
|
|
69
69
|
<% if (action.visible) { -%>
|
|
70
70
|
<% if (action.enabled === 'dynamic') { -%>
|
|
71
|
-
Then.onThe<%- name
|
|
71
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction("<%- action.label %>" /* , { enabled: true } */);
|
|
72
72
|
<% } else { -%>
|
|
73
|
-
Then.onThe<%- name
|
|
73
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckAction("<%- action.label %>", { enabled: <%- action.enabled === true %> });
|
|
74
74
|
<% } -%>
|
|
75
|
-
// When.onThe<%- name
|
|
75
|
+
// When.onThe<%- name%>Generated.onHeader().iPressAction("<%- action.label %>");
|
|
76
76
|
<% } -%>
|
|
77
77
|
<% }); -%>
|
|
78
78
|
});
|
|
@@ -82,13 +82,13 @@ function journey() {
|
|
|
82
82
|
opaTest("Check header facets of the Object Page", function (_Given: Given, _When: When, Then: Then) {
|
|
83
83
|
<% headerSections.forEach(function(section) { -%>
|
|
84
84
|
<% if (section.microChart) { -%>
|
|
85
|
-
Then.onThe<%- name
|
|
85
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckMicroChart("<%- section.title %>", "");
|
|
86
86
|
<% } else { -%>
|
|
87
|
-
Then.onThe<%- name
|
|
87
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckHeaderFacet({ facetId: "<%- section.facetId %>"<% if (section.custom) { %>, custom: true<% } %> });
|
|
88
88
|
<% if (section.form) { -%>
|
|
89
89
|
<% section.fields.forEach(function(field) { -%>
|
|
90
|
-
Then.onThe<%- name
|
|
91
|
-
fieldGroup: "
|
|
90
|
+
Then.onThe<%- name%>Generated.onHeader().iCheckFieldInFieldGroup({
|
|
91
|
+
fieldGroup: "<%- field.fieldGroupQualifier %>",
|
|
92
92
|
field: "<%- field.field %>",
|
|
93
93
|
targetAnnotation: "<%- field.targetAnnotation %>"
|
|
94
94
|
} as unknown as FieldIdentifier);
|
|
@@ -99,68 +99,68 @@ function journey() {
|
|
|
99
99
|
});
|
|
100
100
|
<% } -%>
|
|
101
101
|
|
|
102
|
-
<% if (bodySections?.length > 0
|
|
102
|
+
<% if (bodySections?.length > 0) { -%>
|
|
103
103
|
opaTest("Check body sections of the Object Page", function (_Given: Given, <% if (bodySections?.length > 1) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
|
|
104
104
|
<% if (bodySections?.length > 1) { -%>
|
|
105
|
-
Then.onThe<%- name
|
|
105
|
+
Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
|
|
106
106
|
<% } -%>
|
|
107
107
|
<% bodySections.forEach(function(section) { -%>
|
|
108
108
|
<% if (bodySections.length > 1) { -%>
|
|
109
|
-
When.onThe<%- name
|
|
109
|
+
When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
|
|
110
110
|
<% } -%>
|
|
111
|
-
Then.onThe<%- name
|
|
111
|
+
Then.onThe<%- name%>Generated.iCheckSection({ section: "<%- section.id %>" }, {});
|
|
112
112
|
<% if (section.actions && section.actions.length > 0) { -%>
|
|
113
113
|
<% section.actions.forEach(function(action) { -%>
|
|
114
114
|
<% if (action.visible) { -%>
|
|
115
115
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
116
116
|
<% if (action.enabled === 'dynamic') { -%>
|
|
117
|
-
Then.onThe<%- name
|
|
117
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction("<%- action.label %>" /* , { enabled: true } */);
|
|
118
118
|
<% } else { -%>
|
|
119
|
-
Then.onThe<%- name
|
|
119
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckAction("<%- action.label %>", { enabled: <%- action.enabled === true %> });
|
|
120
120
|
<% } -%>
|
|
121
|
-
// When.onThe<%- name
|
|
121
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressAction("<%- action.label %>");
|
|
122
122
|
<% } else { -%>
|
|
123
123
|
<% if (action.enabled === 'dynamic') { -%>
|
|
124
|
-
Then.onThe<%- name
|
|
124
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction("<%- action.label %>" /* , { enabled: true } */);
|
|
125
125
|
<% } else { -%>
|
|
126
|
-
Then.onThe<%- name
|
|
126
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckAction("<%- action.label %>", { enabled: <%- action.enabled === true %> });
|
|
127
127
|
<% } -%>
|
|
128
|
-
// When.onThe<%- name
|
|
128
|
+
// When.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iPressAction("<%- action.label %>");
|
|
129
129
|
<% } -%>
|
|
130
130
|
<% } -%>
|
|
131
131
|
<% }); -%>
|
|
132
132
|
<% } -%>
|
|
133
133
|
<% if (section.isTable && section.navigationProperty) { -%>
|
|
134
134
|
<% if (section.createButton?.visible) { -%>
|
|
135
|
-
Then.onThe<%- name
|
|
136
|
-
// When.onThe<%- name
|
|
135
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckCreate({ visible: true });
|
|
136
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressCreate();
|
|
137
137
|
<% } -%>
|
|
138
138
|
<% if (section.deleteButton?.visible) { -%>
|
|
139
|
-
Then.onThe<%- name
|
|
140
|
-
// When.onThe<%- name
|
|
139
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckDelete({ visible: true });
|
|
140
|
+
// When.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iPressDelete();
|
|
141
141
|
<% } -%>
|
|
142
142
|
<% } -%>
|
|
143
143
|
<% if (section?.subSections?.length > 0) { -%>
|
|
144
144
|
<% section.subSections.forEach(function(subSection) { -%>
|
|
145
|
-
//When.onThe<%- name
|
|
146
|
-
Then.onThe<%- name
|
|
145
|
+
//When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
|
|
146
|
+
Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
|
|
147
147
|
<% if (subSection.fields && subSection.fields.length > 0) { -%>
|
|
148
148
|
<% subSection.fields.forEach(function(field) { -%>
|
|
149
|
-
Then.onThe<%- name
|
|
149
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" } as unknown as FormIdentifier).iCheckField({ property: "<%- field.property %>" });
|
|
150
150
|
<% }) -%>
|
|
151
151
|
<% } -%>
|
|
152
152
|
<% if (subSection.tableColumns && Object.keys(subSection.tableColumns).length > 0 && subSection.navigationProperty) { -%>
|
|
153
|
-
Then.onThe<%- name
|
|
153
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- subSection.navigationProperty %>" }).iCheckColumns(<%- JSON.stringify(subSection.tableColumns) %>);
|
|
154
154
|
<% } -%>
|
|
155
155
|
<% }) -%>
|
|
156
156
|
<% } else { -%>
|
|
157
157
|
<% if (section.fields && section.fields.length > 0) { -%>
|
|
158
158
|
<% section.fields.forEach(function(field) { -%>
|
|
159
|
-
Then.onThe<%- name
|
|
159
|
+
Then.onThe<%- name%>Generated.onForm({ section: "<%- section.id %>" } as unknown as FormIdentifier).iCheckField({ property: "<%- field.property %>" });
|
|
160
160
|
<% }) -%>
|
|
161
161
|
<% } -%>
|
|
162
162
|
<% if (section.tableColumns && Object.keys(section.tableColumns).length > 0 && section.navigationProperty) { -%>
|
|
163
|
-
Then.onThe<%- name
|
|
163
|
+
Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(<%- JSON.stringify(section.tableColumns) %>);
|
|
164
164
|
<% } -%>
|
|
165
165
|
<% } -%>
|
|
166
166
|
<% }) -%>
|
|
@@ -22,8 +22,11 @@ sap.ui.require(
|
|
|
22
22
|
"sap/ui/thirdparty/qunit-2",
|
|
23
23
|
"sap/ui/qunit/qunit-junit",
|
|
24
24
|
"sap/ui/qunit/qunit-coverage",
|
|
25
|
-
|
|
26
|
-
"<%- appPath %>/test/integration/<%- page %>Journey"
|
|
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
|
+
<%_ } -%>
|
|
27
30
|
], function (QUnit) {
|
|
28
31
|
"use strict";
|
|
29
32
|
QUnit.start();
|
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
sap.ui.define(['sap/fe/test/TemplatePage'], function(TemplatePage) {
|
|
2
19
|
'use strict';
|
|
3
20
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
|
-
"sap/fe/test/JourneyRunner"
|
|
3
|
-
<%- pages.map((page) => {return "\t\"" + page.appPath + '/test/integration/pages/' + page.
|
|
4
|
-
], function (JourneyRunner
|
|
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
5
|
'use strict';
|
|
6
6
|
|
|
7
7
|
var runner = new JourneyRunner({
|
|
8
8
|
launchUrl: sap.ui.require.toUrl('<%- appPath %>') + '/<%- htmlTarget %>',
|
|
9
|
-
pages: {
|
|
10
|
-
<%- pages.map((page) => {return '\t\t\tonThe' + page.targetKey + ': ' + page.targetKey}).join(',\n')%>
|
|
11
|
-
},
|
|
9
|
+
pages: {<% if (pages.length > 0) { %>
|
|
10
|
+
<%- pages.map((page) => {return '\t\t\tonThe' + page.targetKey + 'Generated: ' + page.targetKey + "Generated"}).join(',\n')%>
|
|
11
|
+
<% } %>},
|
|
12
12
|
async: true
|
|
13
13
|
});
|
|
14
14
|
|