@sap-ux/ui5-test-writer 0.7.89 → 0.7.91
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.d.ts +2 -1
- package/dist/fiori-elements-opa-writer.js +38 -9
- package/dist/types.d.ts +102 -1
- package/dist/utils/listReportUtils.d.ts +94 -0
- package/dist/utils/listReportUtils.js +389 -0
- package/dist/utils/modelUtils.d.ts +60 -9
- package/dist/utils/modelUtils.js +69 -41
- package/dist/utils/objectPageUtils.d.ts +21 -0
- package/dist/utils/objectPageUtils.js +218 -0
- package/package.json +7 -4
- package/templates/v4/integration/FPMJourney.js +49 -0
- package/templates/v4/integration/FirstJourney.js +1 -11
- package/templates/v4/integration/ListReportJourney.js +84 -0
- package/templates/v4/integration/ObjectPageJourney.js +69 -0
- package/templates/v4/integration/opaTests.qunit.js +3 -2
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
opaTest("Start application", function (Given, When, Then) {
|
|
28
|
+
Given.iStartMyApp();
|
|
29
|
+
<%_ startPages.forEach(function(pageName) { %>
|
|
30
|
+
Then.onThe<%- pageName %>.iSeeThisPage();
|
|
31
|
+
<%_ }); -%>
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
<%_ if (!hideFilterBar && filterBarItems && filterBarItems.length > 0) { -%>
|
|
35
|
+
opaTest("Check filter bar", function (Given, When, Then) {
|
|
36
|
+
<%_ filterBarItems.forEach(function(item) { _%>
|
|
37
|
+
Then.onThe<%- startLR%>.onFilterBar().iCheckFilterField("<%- item %>");
|
|
38
|
+
<%_ }); -%>
|
|
39
|
+
});
|
|
40
|
+
<%_ } -%>
|
|
41
|
+
|
|
42
|
+
opaTest("Check table columns and actions", function (Given, When, Then) {
|
|
43
|
+
<%_ if (toolBarActions && toolBarActions.length > 0) { -%>
|
|
44
|
+
<%_ if (createButton.visible) { _%>
|
|
45
|
+
Then.onThe<%- startLR%>.onTable().iCheckCreate({ visible: true });
|
|
46
|
+
// Then.onthe<%- startLR%>.onTable().iPressCreate();
|
|
47
|
+
<%_ } _%>
|
|
48
|
+
<%_ if (deleteButton.visible) { _%>
|
|
49
|
+
// Then.onthe<%- startLR%>.onTable().iPressDelete();
|
|
50
|
+
Then.onThe<%- startLR%>.onTable().iCheckDelete({ visible: true });
|
|
51
|
+
<%_ } _%>
|
|
52
|
+
<%_ toolBarActions.forEach(function(item) { _%>
|
|
53
|
+
<%_ if (item.visible) { _%>
|
|
54
|
+
// Then.onThe<%- startLR%>.onTable().iPressAction("<%- item.label %>");
|
|
55
|
+
Then.onThe<%- startLR%>.onTable().iCheckAction("<%- item.label %>", { enabled: <%- item.enabled === true %> });
|
|
56
|
+
<%_ } _%>
|
|
57
|
+
<%_ }); -%>
|
|
58
|
+
<%_ } -%>
|
|
59
|
+
<%_ if (tableColumns && Object.keys(tableColumns).length > 0) { -%>
|
|
60
|
+
Then.onThe<%- startLR %>.onTable().iCheckColumns(<%- Object.keys(tableColumns).length %>, <%- JSON.stringify(tableColumns) %>);
|
|
61
|
+
<%_ } %>
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
<% if (startLR) { %>
|
|
65
|
+
opaTest("Navigate to ObjectPage", function (Given, When, Then) {
|
|
66
|
+
// Note: this test will fail if the ListReport page doesn't show any data
|
|
67
|
+
<% if (!hideFilterBar) { %>
|
|
68
|
+
When.onThe<%- startLR%>.onFilterBar().iExecuteSearch();
|
|
69
|
+
<%} %>
|
|
70
|
+
Then.onThe<%- startLR%>.onTable().iCheckRows();
|
|
71
|
+
<% if (navigatedOP) { %>
|
|
72
|
+
When.onThe<%- startLR%>.onTable().iPressRow(0);
|
|
73
|
+
Then.onThe<%- navigatedOP%>.iSeeThisPage();
|
|
74
|
+
<%} %>
|
|
75
|
+
});
|
|
76
|
+
<%} %>
|
|
77
|
+
opaTest("Teardown", function (Given, When, Then) {
|
|
78
|
+
// Cleanup
|
|
79
|
+
Given.iTearDownMyApp();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
runner.run([journey]);
|
|
84
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
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 (!hideFilterBar) { %>
|
|
30
|
+
When.onThe<%- navigationParents.parentLRName%>.onFilterBar().iExecuteSearch();
|
|
31
|
+
<% } %>
|
|
32
|
+
Then.onThe<%- navigationParents.parentLRName%>.onTable().iCheckRows();
|
|
33
|
+
When.onThe<%- navigationParents.parentLRName%>.onTable().iPressRow(0);
|
|
34
|
+
<% if(navigationParents.parentOPName) { %>
|
|
35
|
+
Then.onThe<%- navigationParents.parentOPName%>.iSeeThisPage();
|
|
36
|
+
Then.onThe<%- navigationParents.parentOPName%>.onTable({ property: "<%- navigationParents.parentOPTableSection %>" }).iCheckRows();
|
|
37
|
+
When.onThe<%- navigationParents.parentOPName%>.onTable({ property: "<%- navigationParents.parentOPTableSection %>" }).iPressRow(0);
|
|
38
|
+
<% } %>
|
|
39
|
+
Then.onThe<%- name%>.iSeeThisPage();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
<% if (headerSections?.length > 0) { -%>
|
|
43
|
+
opaTest("Check header facets of the Object Page", function (Given, When, Then) {
|
|
44
|
+
<% headerSections.forEach(function(section) { -%>
|
|
45
|
+
<% if (section.microChart) { -%>
|
|
46
|
+
Then.onThe<%- name%>.onHeader().iCheckMicroChart("<%- section.title %>");
|
|
47
|
+
<% } else { -%>
|
|
48
|
+
Then.onThe<%- name%>.onHeader().iCheckHeaderFacet({ facetId: "<%- section.facetId %>" });
|
|
49
|
+
<% if (section.form) { -%>
|
|
50
|
+
<% section.fields.forEach(function(field) { -%>
|
|
51
|
+
Then.onThe<%- name%>.onHeader().iCheckFieldInFieldGroup({
|
|
52
|
+
fieldGroup: "FieldGroup::<%- field.fieldGroupQualifier %>",
|
|
53
|
+
field: "<%- field.field %>",
|
|
54
|
+
});
|
|
55
|
+
<% }) -%>
|
|
56
|
+
<% } -%>
|
|
57
|
+
<% } -%>
|
|
58
|
+
<% }) -%>
|
|
59
|
+
});
|
|
60
|
+
<% } -%>
|
|
61
|
+
|
|
62
|
+
opaTest("Teardown", function (Given, When, Then) {
|
|
63
|
+
// Cleanup
|
|
64
|
+
Given.iTearDownMyApp();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
runner.run([journey]);
|
|
69
|
+
});
|
|
@@ -22,8 +22,9 @@ 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
|
-
|
|
25
|
+
"<%- appPath %>/test/integration/<%- opaJourneyFileName %>",<%_ if (generatedJourneyPages && generatedJourneyPages.length > 0) { -%><%_ generatedJourneyPages.forEach(function(page) { %>
|
|
26
|
+
"<%- appPath %>/test/integration/<%- page %>Journey",<%_ }); %><%_ }; %>
|
|
27
|
+
], function (QUnit) {
|
|
27
28
|
"use strict";
|
|
28
29
|
QUnit.start();
|
|
29
30
|
});
|