@sap-ux/ui5-test-writer 0.1.8 → 0.1.10
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/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { Editor } from 'mem-fs-editor';
|
|
|
6
6
|
* @param basePath - the absolute target path where the application will be generated
|
|
7
7
|
* @param opaConfig - parameters for the generation
|
|
8
8
|
* @param opaConfig.scriptName - the name of the OPA journey file. If not specified, 'FirstJourney' will be used
|
|
9
|
+
* @param opaConfig.htmlTarget - the name of the html that will be used in OPA journey file. If not specified, 'index.html' will be used
|
|
9
10
|
* @param opaConfig.appID - the appID. If not specified, will be read from the manifest in sap.app/id
|
|
10
11
|
* @param fs - an optional reference to a mem-fs editor
|
|
11
12
|
* @returns Reference to a mem-fs-editor
|
|
@@ -13,6 +14,7 @@ import type { Editor } from 'mem-fs-editor';
|
|
|
13
14
|
export declare function generateOPAFiles(basePath: string, opaConfig: {
|
|
14
15
|
scriptName?: string;
|
|
15
16
|
appID?: string;
|
|
17
|
+
htmlTarget?: string;
|
|
16
18
|
}, fs?: Editor): Editor;
|
|
17
19
|
/**
|
|
18
20
|
* Generate a page object file for a Fiori elements for OData V4 application.
|
package/dist/index.js
CHANGED
|
@@ -97,31 +97,33 @@ function createPageConfig(manifest, targetKey, forcedAppID) {
|
|
|
97
97
|
* @param manifest - the app descriptor of the target app
|
|
98
98
|
* @param opaConfig - parameters for the generation
|
|
99
99
|
* @param opaConfig.scriptName - the name of the OPA journey file. If not specified, 'FirstJourney' will be used
|
|
100
|
+
* @param opaConfig.htmlTarget - the name of the html file that will be used in the OPA journey file. If not specified, 'index.html' will be used
|
|
100
101
|
* @param opaConfig.appID - the appID. If not specified, will be read from the manifest in sap.app/id
|
|
101
102
|
* @returns OPA test configuration object
|
|
102
103
|
*/
|
|
103
104
|
function createConfig(manifest, opaConfig) {
|
|
104
|
-
var _a, _b, _c, _d, _e, _f;
|
|
105
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
105
106
|
// General application info
|
|
106
107
|
const { appID, appPath } = getAppFromManifest(manifest, opaConfig.appID);
|
|
107
108
|
const config = {
|
|
108
109
|
appID,
|
|
109
110
|
appPath,
|
|
110
111
|
pages: [],
|
|
111
|
-
opaJourneyFileName: opaConfig.scriptName
|
|
112
|
+
opaJourneyFileName: (_a = opaConfig.scriptName) !== null && _a !== void 0 ? _a : 'FirstJourney',
|
|
113
|
+
htmlTarget: (_b = opaConfig.htmlTarget) !== null && _b !== void 0 ? _b : 'index.html'
|
|
112
114
|
};
|
|
113
115
|
// Identify startup targets from the routes
|
|
114
|
-
const appRoutes = ((
|
|
116
|
+
const appRoutes = ((_e = (_d = (_c = manifest['sap.ui5']) === null || _c === void 0 ? void 0 : _c.routing) === null || _d === void 0 ? void 0 : _d.routes) !== null && _e !== void 0 ? _e : []);
|
|
115
117
|
// Find the route with an empty pattern (except for the trailing query part)
|
|
116
118
|
const startupRoute = appRoutes.find((route) => {
|
|
117
119
|
return route.pattern.replace(':?query:', '') === '';
|
|
118
120
|
});
|
|
119
|
-
let startupTargets = (
|
|
121
|
+
let startupTargets = (_f = startupRoute === null || startupRoute === void 0 ? void 0 : startupRoute.target) !== null && _f !== void 0 ? _f : [];
|
|
120
122
|
if (!Array.isArray(startupTargets)) {
|
|
121
123
|
startupTargets = [startupTargets];
|
|
122
124
|
}
|
|
123
125
|
// Create page configurations in supported cases
|
|
124
|
-
const appTargets = (
|
|
126
|
+
const appTargets = (_h = (_g = manifest['sap.ui5']) === null || _g === void 0 ? void 0 : _g.routing) === null || _h === void 0 ? void 0 : _h.targets;
|
|
125
127
|
for (const targetKey in appTargets) {
|
|
126
128
|
const pageConfig = createPageConfig(manifest, targetKey, opaConfig.appID);
|
|
127
129
|
if (pageConfig) {
|
|
@@ -200,6 +202,7 @@ function writePageObject(pageConfig, rootTemplateDirPath, testOutDirPath, fs) {
|
|
|
200
202
|
* @param basePath - the absolute target path where the application will be generated
|
|
201
203
|
* @param opaConfig - parameters for the generation
|
|
202
204
|
* @param opaConfig.scriptName - the name of the OPA journey file. If not specified, 'FirstJourney' will be used
|
|
205
|
+
* @param opaConfig.htmlTarget - the name of the html that will be used in OPA journey file. If not specified, 'index.html' will be used
|
|
203
206
|
* @param opaConfig.appID - the appID. If not specified, will be read from the manifest in sap.app/id
|
|
204
207
|
* @param fs - an optional reference to a mem-fs editor
|
|
205
208
|
* @returns Reference to a mem-fs-editor
|
package/dist/types.d.ts
CHANGED
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.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/mem-fs": "1.1.2",
|
|
32
32
|
"@types/mem-fs-editor": "7.0.1",
|
|
33
33
|
"fs-extra": "10.0.0",
|
|
34
|
-
"@sap-ux/project-access": "1.8.
|
|
34
|
+
"@sap-ux/project-access": "1.8.4"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"pnpm": ">=6.26.1 < 7.0.0 || >=7.1.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc --build",
|
|
42
42
|
"watch": "tsc --watch",
|
|
43
|
-
"clean": "rimraf dist test/test-output coverage *.tsbuildinfo",
|
|
43
|
+
"clean": "rimraf --glob dist test/test-output coverage *.tsbuildinfo",
|
|
44
44
|
"format": "prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",
|
|
45
45
|
"lint": "eslint . --ext .ts",
|
|
46
46
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
@@ -7,8 +7,8 @@ sap.ui.require(
|
|
|
7
7
|
function(JourneyRunner, opaJourney, <%- pages.map(function(page) {return page.targetKey;}).join(', ')%>) {
|
|
8
8
|
'use strict';
|
|
9
9
|
var JourneyRunner = new JourneyRunner({
|
|
10
|
-
// start
|
|
11
|
-
launchUrl: sap.ui.require.toUrl('<%- appPath %>') + '
|
|
10
|
+
// start <%- htmlTarget %> in web folder
|
|
11
|
+
launchUrl: sap.ui.require.toUrl('<%- appPath %>') + '/<%- htmlTarget %>'
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
|