@sap-ux/ui5-test-writer 0.7.20 → 0.7.22
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 +4 -0
- package/package.json +3 -3
- package/templates/v4/integration/FirstJourney.js +23 -24
- package/templates/v4/integration/opaTests.qunit.html +0 -3
- package/templates/v4/integration/opaTests.qunit.js +28 -23
- package/templates/v4/integration/pages/JourneyRunner.js +17 -0
|
@@ -250,6 +250,10 @@ function generateOPAFiles(basePath, opaConfig, fs) {
|
|
|
250
250
|
editor.copyTpl((0, path_1.join)(rootV4TemplateDirPath, 'integration/FirstJourney.js'), (0, path_1.join)(testOutDirPath, `integration/${config.opaJourneyFileName}.js`), journeyParams, undefined, {
|
|
251
251
|
globOptions: { dot: true }
|
|
252
252
|
});
|
|
253
|
+
// Journey Runner
|
|
254
|
+
editor.copyTpl((0, path_1.join)(rootV4TemplateDirPath, 'integration', 'pages', 'JourneyRunner.js'), (0, path_1.join)(testOutDirPath, 'integration', 'pages', 'JourneyRunner.js'), config, undefined, {
|
|
255
|
+
globOptions: { dot: true }
|
|
256
|
+
});
|
|
253
257
|
return editor;
|
|
254
258
|
}
|
|
255
259
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/ui5-test-writer",
|
|
3
3
|
"description": "SAP UI5 tests writer",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.22",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"i18next": "25.3.0",
|
|
25
25
|
"mem-fs": "2.1.0",
|
|
26
26
|
"mem-fs-editor": "9.4.0",
|
|
27
|
-
"@sap-ux/ui5-application-writer": "1.5.
|
|
27
|
+
"@sap-ux/ui5-application-writer": "1.5.14",
|
|
28
28
|
"@sap-ux/logger": "0.7.0",
|
|
29
|
-
"@sap-ux/project-access": "1.30.
|
|
29
|
+
"@sap-ux/project-access": "1.30.13"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/ejs": "3.1.2",
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
|
-
"sap/ui/test/opaQunit"
|
|
3
|
-
|
|
2
|
+
"sap/ui/test/opaQunit",
|
|
3
|
+
"./pages/JourneyRunner"
|
|
4
|
+
], function (opaTest, runner) {
|
|
4
5
|
"use strict";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
QUnit.module("First journey");
|
|
7
|
+
function journey() {
|
|
8
|
+
QUnit.module("First journey");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
opaTest("Start application", function (Given, When, Then) {
|
|
11
|
+
Given.iStartMyApp();
|
|
12
12
|
<% startPages.forEach(function(pageName) { %>
|
|
13
|
-
|
|
13
|
+
Then.onThe<%- pageName%>.iSeeThisPage();
|
|
14
14
|
<% });%>
|
|
15
|
-
|
|
15
|
+
});
|
|
16
16
|
|
|
17
17
|
<% if (startLR) { %>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
opaTest("Navigate to ObjectPage", function (Given, When, Then) {
|
|
19
|
+
// Note: this test will fail if the ListReport page doesn't show any data
|
|
20
|
+
<% if (!hideFilterBar) { %>
|
|
21
|
+
When.onThe<%- startLR%>.onFilterBar().iExecuteSearch();
|
|
22
|
+
<%} %>
|
|
23
|
+
Then.onThe<%- startLR%>.onTable().iCheckRows();
|
|
24
24
|
<% if (navigatedOP) { %>
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
When.onThe<%- startLR%>.onTable().iPressRow(0);
|
|
26
|
+
Then.onThe<%- navigatedOP%>.iSeeThisPage();
|
|
27
27
|
<%} %>
|
|
28
|
-
|
|
28
|
+
});
|
|
29
29
|
<%} %>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
30
|
+
opaTest("Teardown", function (Given, When, Then) {
|
|
31
|
+
// Cleanup
|
|
32
|
+
Given.iTearDownMyApp();
|
|
33
|
+
});
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
runner.run([journey]);
|
|
38
37
|
});
|
|
@@ -17,9 +17,6 @@
|
|
|
17
17
|
|
|
18
18
|
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css">
|
|
19
19
|
|
|
20
|
-
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>
|
|
21
|
-
<script src="../../resources/sap/ui/qunit/qunit-junit.js"></script>
|
|
22
|
-
|
|
23
20
|
<script src="opaTests.qunit.js"></script>
|
|
24
21
|
|
|
25
22
|
</head>
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
sap.ui.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
JourneyRunner.run(
|
|
16
|
-
{
|
|
17
|
-
pages: {
|
|
18
|
-
<%- pages.map((page) => {return '\t\t\t\t\tonThe' + page.targetKey + ': ' + page.targetKey}).join(',\n')%>
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
opaJourney.run
|
|
22
|
-
);
|
|
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
|
+
}
|
|
23
15
|
}
|
|
24
|
-
);
|
|
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
|
+
'<%- appPath %>/test/integration/<%- opaJourneyFileName %>'
|
|
26
|
+
], function (QUnit) {
|
|
27
|
+
"use strict";
|
|
28
|
+
QUnit.start();
|
|
29
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/fe/test/JourneyRunner",
|
|
3
|
+
<%- pages.map((page) => {return "\t\"" + page.appPath + '/test/integration/pages/' + page.targetKey + "\"";}).join(',\n')%>
|
|
4
|
+
], function (JourneyRunner, <%- pages.map(function(page) {return page.targetKey;}).join(', ')%>) {
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
var runner = new JourneyRunner({
|
|
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
|
+
},
|
|
12
|
+
async: true
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return runner;
|
|
16
|
+
});
|
|
17
|
+
|