@sap-ux/ui5-test-writer 0.7.20 → 0.7.21

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.
@@ -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.20",
4
+ "version": "0.7.21",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -1,38 +1,37 @@
1
1
  sap.ui.define([
2
- "sap/ui/test/opaQunit"
3
- ], function (opaTest) {
2
+ "sap/ui/test/opaQunit",
3
+ "./pages/JourneyRunner"
4
+ ], function (opaTest, runner) {
4
5
  "use strict";
5
6
 
6
- var Journey = {
7
- run: function() {
8
- QUnit.module("First journey");
7
+ function journey() {
8
+ QUnit.module("First journey");
9
9
 
10
- opaTest("Start application", function (Given, When, Then) {
11
- Given.iStartMyApp();
10
+ opaTest("Start application", function (Given, When, Then) {
11
+ Given.iStartMyApp();
12
12
  <% startPages.forEach(function(pageName) { %>
13
- Then.onThe<%- pageName%>.iSeeThisPage();
13
+ Then.onThe<%- pageName%>.iSeeThisPage();
14
14
  <% });%>
15
- });
15
+ });
16
16
 
17
17
  <% if (startLR) { %>
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();
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
- When.onThe<%- startLR%>.onTable().iPressRow(0);
26
- Then.onThe<%- navigatedOP%>.iSeeThisPage();
25
+ When.onThe<%- startLR%>.onTable().iPressRow(0);
26
+ Then.onThe<%- navigatedOP%>.iSeeThisPage();
27
27
  <%} %>
28
- });
28
+ });
29
29
  <%} %>
30
- opaTest("Teardown", function (Given, When, Then) {
31
- // Cleanup
32
- Given.iTearDownMyApp();
33
- });
34
- }
30
+ opaTest("Teardown", function (Given, When, Then) {
31
+ // Cleanup
32
+ Given.iTearDownMyApp();
33
+ });
35
34
  }
36
35
 
37
- return Journey;
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.require(
2
- [
3
- 'sap/fe/test/JourneyRunner',
4
- '<%- appPath %>/test/integration/<%- opaJourneyFileName %>',
5
- <%- pages.map((page) => {return "\t\t'" + page.appPath + '/test/integration/pages/' + page.targetKey + "'";}).join(',\n')%>
6
- ],
7
- function(JourneyRunner, opaJourney, <%- pages.map(function(page) {return page.targetKey;}).join(', ')%>) {
8
- 'use strict';
9
- var JourneyRunner = new JourneyRunner({
10
- // start <%- htmlTarget %> in web folder
11
- launchUrl: sap.ui.require.toUrl('<%- appPath %>') + '/<%- htmlTarget %>'
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
+