@sap_oss/wdio-qmate-service 1.2.3 → 1.3.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.
Files changed (37) hide show
  1. package/docs/doc.md +189 -51
  2. package/lib/reuse/index.js +3 -4
  3. package/lib/reuse/index.js.map +1 -1
  4. package/lib/reuse/modules/runtime/Runtime.d.ts +5 -0
  5. package/lib/reuse/modules/runtime/Runtime.js +11 -0
  6. package/lib/reuse/modules/runtime/Runtime.js.map +1 -0
  7. package/lib/reuse/modules/ui5/control.d.ts +18 -17
  8. package/lib/reuse/modules/ui5/control.js +21 -21
  9. package/lib/reuse/modules/ui5/control.js.map +1 -1
  10. package/lib/reuse/modules/ui5/types/ui5.types.d.ts +16 -0
  11. package/lib/reuse/modules/ui5/types/ui5.types.js +3 -0
  12. package/lib/reuse/modules/ui5/types/ui5.types.js.map +1 -0
  13. package/lib/reuse/modules/util/Util.d.ts +9 -7
  14. package/lib/reuse/modules/util/Util.js +2 -0
  15. package/lib/reuse/modules/util/Util.js.map +1 -1
  16. package/lib/reuse/modules/util/component.d.ts +25 -0
  17. package/lib/reuse/modules/util/component.js +67 -0
  18. package/lib/reuse/modules/util/component.js.map +1 -0
  19. package/lib/reuse/modules/util/data.d.ts +25 -5
  20. package/lib/reuse/modules/util/data.js +86 -15
  21. package/lib/reuse/modules/util/data.js.map +1 -1
  22. package/lib/scripts/hooks/beforeSession.js +4 -1
  23. package/lib/scripts/hooks/beforeSession.js.map +1 -1
  24. package/lib/scripts/hooks/utils/cycle.js +7 -1
  25. package/lib/scripts/hooks/utils/cycle.js.map +1 -1
  26. package/package.json +1 -1
  27. package/test/reuse/ui5/control/execute.spec.js +53 -1
  28. package/test/reuse/ui5/control/getAggregationProperty.spec.js +7 -2
  29. package/test/reuse/ui5/control/getAssociationProperty.spec.js +67 -1
  30. package/test/reuse/ui5/control/getBindingContextPathProperty.spec.js +8 -4
  31. package/test/reuse/ui5/control/getProperty.spec.js +6 -2
  32. package/test/reuse/ui5/control/getPropertyBinding.spec.js +8 -4
  33. package/test/reuse/util/data/customSourceData/test.json +3 -0
  34. package/test/reuse/util/data/customSourceData/test.secure.json +5 -0
  35. package/test/reuse/util/data/getData.spec.js +18 -1
  36. package/test/reuse/util/data/getSecureData.spec.js +18 -1
  37. package/test/reuse/util/data/test.data.conf.js +2 -1
@@ -17,7 +17,7 @@ class Control {
17
17
  * @description Executes a native UI5 action as callback function in the browser on the given UI5 control.
18
18
  * @param {Function} callbackFunction - The client script function to be used with the control instance.
19
19
  * Caution: The first and last parameter is reserved for the mockserver instance and the promise resolve function - done.
20
- * @param {String | Object} selectorOrElement - The selector object or the dom element (retrieved from getDisplayedElement).
20
+ * @param {Element | Ui5Selector | Ui5SelectorWithOptions} selectorOrElement - The selector object, selector with options (selector, index, timeout) or the dom element (retrieved from ui5.element.getDisplayed).
21
21
  * @param {Object} args - An object containing the arguments to pass to the callback function.
22
22
  * @example const selector = {"elementProperties":{"metadata":"sap.m.StandardListItem", "id": "*categoryList-7"}};
23
23
  * const args = {"property": "text"};
@@ -34,74 +34,74 @@ class Control {
34
34
  * @function getProperty
35
35
  * @memberOf ui5.control
36
36
  * @description Gets the UI5 control property of the given element.
37
- * @param {Object} elem - The element.
37
+ * @param {Element | Ui5Selector | Ui5SelectorWithOptions} selectorOrElement - The selector object, selector with options (selector, index, timeout) or the dom element (retrieved from ui5.element.getDisplayed)
38
38
  * @param {String} propertyName - The property name of the control to retrieve the value from.
39
39
  * @example const selector = { "elementProperties":{"metadata":"sap.m.StandardListItem","mProperties":{ "title":[{"path":"CategoryName"}] }};
40
- * const elem = await ui5.element.getDisplayedElement(selector);
40
+ * const elem = await ui5.element.getDisplayed(selector);
41
41
  * const propertyName = "title";
42
42
  * const val = await ui5.control.getProperty(elem, propertyName);
43
43
  **/
44
- async getProperty(elem, propertyName) {
45
- return this.locatorCommands.getUI5Property(propertyName, elem);
44
+ async getProperty(selectorOrElement, propertyName) {
45
+ return this.locatorCommands.getUI5Property(propertyName, selectorOrElement);
46
46
  }
47
47
  ;
48
48
  /**
49
49
  * @function getAggregationProperty
50
50
  * @memberOf ui5.control
51
51
  * @description Gets the UI5 control aggregation property of the given element.
52
- * @param {Object} elem - The element.
52
+ * @param {Element | Ui5Selector | Ui5SelectorWithOptions} selectorOrElement - The selector object, selector with options (selector, index, timeout) or the dom element (retrieved from ui5.element.getDisplayed)
53
53
  * @param {String} propertyName - The aggregation property name of the control to retrieve the value from.
54
54
  * @example const selector = { "elementProperties":{"metadata":"sap.m.StandardListItem","mProperties":{ "items":[{"path":"/Categories"}] }};
55
- * const elem = await ui5.element.getDisplayedElement(selector);
55
+ * const elem = await ui5.element.getDisplayed(selector);
56
56
  * const propertyName = "tooltip";
57
57
  * const val = await ui5.control.getAggregationProperty(elem, propertyName);
58
58
  **/
59
- async getAggregationProperty(elem, propertyName) {
60
- return this.locatorCommands.getUI5Aggregation(propertyName, elem);
59
+ async getAggregationProperty(selectorOrElement, propertyName) {
60
+ return this.locatorCommands.getUI5Aggregation(propertyName, selectorOrElement);
61
61
  }
62
62
  ;
63
63
  /**
64
64
  * @function getAssociationProperty
65
65
  * @memberOf ui5.control
66
66
  * @description Get UI control property
67
- * @param {Object} elem - The element.
67
+ * @param {Element | Ui5Selector | Ui5SelectorWithOptions} selectorOrElement - The selector object, selector with options (selector, index, timeout) or the dom element (retrieved from ui5.element.getDisplayed)
68
68
  * @param {String} propertyName - The association property name of the control to retrieve the value from.
69
69
  * @example const selector = { "elementProperties":{"metadata":"sap.m.MultiComboBox","mProperties":{}};
70
- * const elem = await ui5.element.getDisplayedElement(selector);
70
+ * const elem = await ui5.element.getDisplayed(selector);
71
71
  * const propertyName = "selectedItems";
72
72
  * const propertyValue = await ui5.control.getAssociationProperty(elem, propertyName);
73
73
  **/
74
- async getAssociationProperty(elem, propertyName) {
75
- return this.locatorCommands.getUI5Association(propertyName, elem);
74
+ async getAssociationProperty(selectorOrElement, propertyName) {
75
+ return this.locatorCommands.getUI5Association(propertyName, selectorOrElement);
76
76
  }
77
77
  ;
78
78
  /**
79
79
  * @function getBindingContextPathProperty
80
80
  * @memberOf ui5.control
81
81
  * @description Get UI control binding context path
82
- * @param {Object} elem - The element.
82
+ * @param {Element | Ui5Selector | Ui5SelectorWithOptions} selectorOrElement - The selector object, selector with options (selector, index, timeout) or the dom element (retrieved from ui5.element.getDisplayed)
83
83
  * @example const selector = { "elementProperties":{"metadata":"sap.m.StandardListItem","mProperties":{"title":[{"path":"CategoryName"}] }};
84
- * const elem = await ui5.element.getDisplayedElement(selector);
84
+ * const elem = await ui5.element.getDisplayed(selector);
85
85
  * const context = await ui5.control.getBindingContextPathProperty(elem);
86
86
  **/
87
- async getBindingContextPathProperty(elem) {
88
- return this.locatorCommands.getBindingContextPath(elem);
87
+ async getBindingContextPathProperty(selectorOrElement) {
88
+ return this.locatorCommands.getBindingContextPath(selectorOrElement);
89
89
  }
90
90
  ;
91
91
  /**
92
92
  * @function getPropertyBinding
93
93
  * @memberOf ui5.control
94
94
  * @description Get UI control property
95
- * @param {Object} elem - The element.
95
+ * @param {Element | Ui5Selector | Ui5SelectorWithOptions} selectorOrElement - The selector object, selector with options (selector, index, timeout) or the dom element (retrieved from ui5.element.getDisplayed)
96
96
  * @param {String} propertyName - The property name to retrieve from the control binding
97
97
  * @returns {Array} Array of bindings for the specific property
98
98
  * @example const selector = { "elementProperties":{"metadata":"sap.m.StandardListItem","mProperties":{ "title":[{"path":"CategoryName"}] }};
99
- * const elem = await ui5.element.getDisplayedElement(selector);
99
+ * const elem = await ui5.element.getDisplayed(selector);
100
100
  * const propertyName = "title";
101
101
  * const binding = await ui5.control.getPropertyBinding(elem, propertyName);
102
102
  **/
103
- async getPropertyBinding(elem, propertyName) {
104
- return this.locatorCommands.getBindingProperty(propertyName, elem);
103
+ async getPropertyBinding(selectorOrElement, propertyName) {
104
+ return this.locatorCommands.getBindingProperty(propertyName, selectorOrElement);
105
105
  }
106
106
  ;
107
107
  }
@@ -1 +1 @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jF,CAAC;IAAA,CAAC;IAEF;;;;;;;;QAQI;IACJ,KAAK,CAAC,6BAA6B,CAAE,iBAAiE;QACpG,OAAO,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IACvE,CAAC;IAAA,CAAC;IAGF;;;;;;;;;;;QAWI;IACJ,KAAK,CAAC,kBAAkB,CAAE,iBAAiE,EAAE,YAAoB;QAC/G,OAAO,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAClF,CAAC;IAAA,CAAC;CAEH;AArGD,0BAqGC;AAAA,CAAC;AACF,kBAAe,IAAI,OAAO,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare type Ui5Selector = {
2
+ elementProperties: any;
3
+ ancestorProperties?: any;
4
+ parentProperties?: any;
5
+ siblingProperties?: any;
6
+ prevSiblingProperties?: any;
7
+ nextSiblingProperties?: any;
8
+ childProperties?: any;
9
+ descendantProperties?: any;
10
+ };
11
+ export declare type Ui5SelectorWithOptions = {
12
+ selector: Ui5Selector;
13
+ index?: number;
14
+ timeout?: number;
15
+ returnAllDomElements?: boolean;
16
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ui5.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui5.types.js","sourceRoot":"","sources":["../../../../../src/reuse/modules/ui5/types/ui5.types.ts"],"names":[],"mappings":""}
@@ -1,10 +1,11 @@
1
- import { Browser } from './browser';
2
- import { Console } from './console';
3
- import { Data } from './data';
4
- import { File } from './file';
5
- import { Formatter } from './formatter';
6
- import { FunctionModule } from './function';
7
- import { System } from './system';
1
+ import { Browser } from "./browser";
2
+ import { Console } from "./console";
3
+ import { Data } from "./data";
4
+ import { File } from "./file";
5
+ import { Formatter } from "./formatter";
6
+ import { FunctionModule } from "./function";
7
+ import { System } from "./system";
8
+ import { Component } from "./component";
8
9
  interface DataHooksExtended extends Data {
9
10
  decrypt: (input: string) => string;
10
11
  privateKeyFound: boolean;
@@ -17,6 +18,7 @@ export declare class Util {
17
18
  formatter: Formatter;
18
19
  function: FunctionModule;
19
20
  system: System;
21
+ component: Component;
20
22
  }
21
23
  declare const _default: Util;
22
24
  export default _default;
@@ -11,6 +11,7 @@ const file_1 = __importDefault(require("./file"));
11
11
  const formatter_1 = __importDefault(require("./formatter"));
12
12
  const function_1 = __importDefault(require("./function"));
13
13
  const system_1 = __importDefault(require("./system"));
14
+ const component_1 = __importDefault(require("./component"));
14
15
  class Util {
15
16
  constructor() {
16
17
  this.browser = browser_1.default;
@@ -20,6 +21,7 @@ class Util {
20
21
  this.formatter = formatter_1.default;
21
22
  this.function = function_1.default;
22
23
  this.system = system_1.default;
24
+ this.component = component_1.default;
23
25
  }
24
26
  }
25
27
  exports.Util = Util;
@@ -1 +1 @@
1
- {"version":3,"file":"Util.js","sourceRoot":"","sources":["../../../../src/reuse/modules/util/Util.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA2C;AAC3C,wDAA2C;AAC3C,kDAAoC;AACpC,kDAAoC;AACpC,4DAAmD;AACnD,0DAA4D;AAC5D,sDAAwC;AAOxC,MAAa,IAAI;IAAjB;QACI,YAAO,GAAY,iBAAO,CAAA;QAC1B,YAAO,GAAY,iBAAO,CAAA;QAC1B,SAAI,GAAsB,cAAyB,CAAA;QACnD,SAAI,GAAS,cAAI,CAAA;QACjB,cAAS,GAAc,mBAAS,CAAA;QAChC,aAAQ,GAAmB,kBAAc,CAAA;QACzC,WAAM,GAAW,gBAAM,CAAA;IAC3B,CAAC;CAAA;AARD,oBAQC;AAED,kBAAe,IAAI,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"Util.js","sourceRoot":"","sources":["../../../../src/reuse/modules/util/Util.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA6C;AAC7C,wDAA6C;AAC7C,kDAAoC;AACpC,kDAAoC;AACpC,4DAAmD;AACnD,0DAA4D;AAC5D,sDAA0C;AAC1C,4DAAmD;AAOnD,MAAa,IAAI;IAAjB;QACE,YAAO,GAAY,iBAAO,CAAC;QAC3B,YAAO,GAAY,iBAAO,CAAC;QAC3B,SAAI,GAAsB,cAAyB,CAAC;QACpD,SAAI,GAAS,cAAI,CAAC;QAClB,cAAS,GAAc,mBAAS,CAAC;QACjC,aAAQ,GAAmB,kBAAc,CAAC;QAC1C,WAAM,GAAW,gBAAM,CAAC;QACxB,cAAS,GAAc,mBAAS,CAAC;IACnC,CAAC;CAAA;AATD,oBASC;AAED,kBAAe,IAAI,IAAI,EAAE,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @class component
3
+ * @memberof util
4
+ * @description This class provides functions for writing component tests with qmate-proxy-service
5
+ */
6
+ export declare class Component {
7
+ /**
8
+ * @function loadEntryPoint
9
+ * @memberOf util.component
10
+ * @description Will be called in component test scripts. Returns a previously stored entry point object for sharing information (like a draft id) between preparation and the actual component tests.
11
+ * @returns {Object} The data object of the stored entry point.
12
+ * @example const entryPoint = util.component.loadEntryPoint();
13
+ */
14
+ loadEntryPoint(): Promise<any>;
15
+ /**
16
+ * @function storeEntryPoint
17
+ * @memberOf util.component
18
+ * @description Will be called in preparation scripts before component tests. Stores an entry point object for sharing information (like a draft id) between preparation and the actual component tests.
19
+ * @param {Object} The data object of the stored entry point.
20
+ * @example const entryPoint = util.component.storeEntryPoint({"draftId": "0123456789"});
21
+ */
22
+ storeEntryPoint(data: any): Promise<void>;
23
+ }
24
+ declare const _default: Component;
25
+ export default _default;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Component = void 0;
27
+ const path = __importStar(require("path"));
28
+ /**
29
+ * @class component
30
+ * @memberof util
31
+ * @description This class provides functions for writing component tests with qmate-proxy-service
32
+ */
33
+ class Component {
34
+ /**
35
+ * @function loadEntryPoint
36
+ * @memberOf util.component
37
+ * @description Will be called in component test scripts. Returns a previously stored entry point object for sharing information (like a draft id) between preparation and the actual component tests.
38
+ * @returns {Object} The data object of the stored entry point.
39
+ * @example const entryPoint = util.component.loadEntryPoint();
40
+ */
41
+ async loadEntryPoint() {
42
+ // Will be called in component scripts
43
+ const componentSpec = runtime.specs.filter((spec) => {
44
+ return !spec.includes("prep.");
45
+ })[0];
46
+ const componentSpecIdentifier = path.basename(componentSpec).replaceAll(".spec.js", "");
47
+ return await util.data.readDataFromFile(`${componentSpecIdentifier}.entrypoint.json`);
48
+ }
49
+ /**
50
+ * @function storeEntryPoint
51
+ * @memberOf util.component
52
+ * @description Will be called in preparation scripts before component tests. Stores an entry point object for sharing information (like a draft id) between preparation and the actual component tests.
53
+ * @param {Object} The data object of the stored entry point.
54
+ * @example const entryPoint = util.component.storeEntryPoint({"draftId": "0123456789"});
55
+ */
56
+ async storeEntryPoint(data) {
57
+ // Will be called in preparation scripts
58
+ const componentSpec = runtime.specs.filter((spec) => {
59
+ return !spec.includes("prep.");
60
+ })[0];
61
+ const componentSpecIdentifier = path.basename(componentSpec).replaceAll(".spec.js", "");
62
+ await util.data.writeDataToFile(`${componentSpecIdentifier}.entrypoint.json`, data);
63
+ }
64
+ }
65
+ exports.Component = Component;
66
+ exports.default = new Component();
67
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/reuse/modules/util/component.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,2CAA6B;AAE7B;;;;GAIG;AACH,MAAa,SAAS;IACpB;;;;;;OAMG;IACH,KAAK,CAAC,cAAc;QAClB,sCAAsC;QACtC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAY,EAAE,EAAE;YAC1D,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACN,MAAM,uBAAuB,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAExF,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,uBAAuB,kBAAkB,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,eAAe,CAAC,IAAS;QAC7B,wCAAwC;QACxC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAY,EAAE,EAAE;YAC1D,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACN,MAAM,uBAAuB,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAExF,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,uBAAuB,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACtF,CAAC;CACF;AAlCD,8BAkCC;AAED,kBAAe,IAAI,SAAS,EAAE,CAAC"}
@@ -8,25 +8,45 @@ export declare class Data {
8
8
  * @memberOf util.data
9
9
  * @description Returns the data object with the given filename (JSON, stored in data folder).
10
10
  * @param {String} filename - The name of the data file.
11
- * @returns {String} The data object.
11
+ * @param {String} [source=data] - The source key defined under params.import of the config file.
12
+ * @returns {Object} The data object.
12
13
  * @example const data = util.data.getData("myTest");
13
14
  */
14
- getData(filename: string): string;
15
+ getData(filename: string, source?: string): string;
15
16
  /**
16
17
  * @function getSecureData
17
18
  * @memberOf util.data
18
19
  * @description Returns and encrypts the data object with the given filename (JSON, stored in data folder). Will return the local file object if private key is not accessible.
19
20
  * @param {String} filename - The name of the data file (without suffix '.secure' or '.local').
20
- * @returns {String} The encrypted or local data object.
21
+ * @param {String} [source=data] - The source key defined under params.import of the config file.
22
+ * @returns {Object} The encrypted or local data object.
21
23
  * @example const secureData = util.data.getSecureData("myTest");
22
24
  */
23
- getSecureData(filename: string): string;
25
+ getSecureData(filename: string, source?: string): string;
26
+ /**
27
+ * @function readDataFromFile
28
+ * @memberOf util.data
29
+ * @description Reads the data object from the given filepath.
30
+ * @param {String} filePath - The filepath.
31
+ * @returns {Object} The data object.
32
+ * @example const data = util.data.readDataFromFile("./data/myData.json");
33
+ */
34
+ readDataFromFile(filePath: string): Promise<any>;
35
+ /**
36
+ * @function writeDataToFile
37
+ * @memberOf util.data
38
+ * @description Writes the data object to the given filepath.
39
+ * @param {String} filePath - The filepath.
40
+ * @param {Object} data - The data object to write.
41
+ * @example const data = util.data.writeDataToFile("myTest");
42
+ */
43
+ writeDataToFile(filePath: string, data: any): Promise<void>;
24
44
  /**
25
45
  * @function decrypt
26
46
  * @memberOf util.data
27
47
  * @description Decrypts the passed input data.
28
48
  * @param {String} data - The encrypted data to decrypt.
29
- * @returns {String} The decrypted data.
49
+ * @returns {Object} The decrypted data.
30
50
  * @example const decrypted = util.data.decrypt("d704004c262faa8ef4bdcf34c8a94883e15524872c7bef334d26a391a1934cf47338b749d99426980ee4cc7a81deaef21439c6894ab0324cdb29b9b6332635baca442651c5d37847f52bb90b8868e037271a7d456024b39b65fdf4dc62e8d82a3d5683a72e4324c59d339742fc79749f0ee74abef916d38e306218adc48e3547a2b346962249320c962d22cb46d9998de36d8219a2496c0997d0fc389f76fb1431a9b57c317886e9c9795c0a09ad98d9fa0b7687d10814dc7973397f3f72a227a04ead4c3d1d428c096a51922ffc4d7afc3952df1c130def5c5fb3e834605cbf1454885966cc65c77046343f4c678e74931fb2dd6cac8dae17837cf674f288d6550dd7fa6b01f5b7ea68aa6bd27d79dd5d53edb5fd4b4edce824bd31b3939352ad7a71a16bab8c54025c2bb92c54e022fcd23ff08bc54a17fc50d00dc3b884cadbfdefe1e75901fdf80e7324ad02a891f2c4863fa120ca238520b79126c65a03");
31
51
  */
32
52
  decrypt(data: string): string;
@@ -1,6 +1,35 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.Data = void 0;
30
+ const fs_1 = require("fs");
31
+ const path = __importStar(require("path"));
32
+ const dataExchangeUtil_1 = __importDefault(require("../../../scripts/dataExchange/dataExchangeUtil"));
4
33
  /**
5
34
  * @class data
6
35
  * @memberof util
@@ -11,20 +40,21 @@ class Data {
11
40
  * @memberOf util.data
12
41
  * @description Returns the data object with the given filename (JSON, stored in data folder).
13
42
  * @param {String} filename - The name of the data file.
14
- * @returns {String} The data object.
43
+ * @param {String} [source=data] - The source key defined under params.import of the config file.
44
+ * @returns {Object} The data object.
15
45
  * @example const data = util.data.getData("myTest");
16
46
  */
17
- getData(filename) {
18
- if (browser.config.params && browser.config.params.import && browser.config.params.import.data) {
19
- if (browser.config.params.import.data[filename]) {
20
- return browser.config.params.import.data[filename];
47
+ getData(filename, source = "data") {
48
+ if (browser.config.params && browser.config.params.import && browser.config.params.import[source]) {
49
+ if (browser.config.params.import[source][filename]) {
50
+ return browser.config.params.import[source][filename];
21
51
  }
22
52
  else {
23
- throw new Error(`Function 'getData' failed. No file with name ${filename} found'`);
53
+ throw new Error(`Function 'getData' failed. File '${filename}.json' empty or not defined under '${source}'`);
24
54
  }
25
55
  }
26
56
  else {
27
- throw new Error(`Function 'getData' failed. No data path defined in config.`);
57
+ throw new Error(`Function 'getData' failed. Data path '${source}' not defined in config.`);
28
58
  }
29
59
  }
30
60
  /**
@@ -32,10 +62,11 @@ class Data {
32
62
  * @memberOf util.data
33
63
  * @description Returns and encrypts the data object with the given filename (JSON, stored in data folder). Will return the local file object if private key is not accessible.
34
64
  * @param {String} filename - The name of the data file (without suffix '.secure' or '.local').
35
- * @returns {String} The encrypted or local data object.
65
+ * @param {String} [source=data] - The source key defined under params.import of the config file.
66
+ * @returns {Object} The encrypted or local data object.
36
67
  * @example const secureData = util.data.getSecureData("myTest");
37
68
  */
38
- getSecureData(filename) {
69
+ getSecureData(filename, source = "data") {
39
70
  const privateKeyFound = global.util.data.privateKeyFound === true;
40
71
  if (privateKeyFound) {
41
72
  filename = `${filename}.secure`;
@@ -44,20 +75,60 @@ class Data {
44
75
  util.console.info("getSecureData: No private key found. Continue using local file.");
45
76
  filename = `${filename}.local`;
46
77
  }
47
- if (browser.config.params && browser.config.params.import && browser.config.params.import.data) {
48
- if (browser.config.params.import.data[filename]) {
49
- const data = browser.config.params.import.data[filename];
78
+ if (browser.config.params && browser.config.params.import && browser.config.params.import[source]) {
79
+ if (browser.config.params.import[source][filename]) {
80
+ const data = browser.config.params.import[source][filename];
50
81
  if (privateKeyFound) {
51
82
  this._decryptRecursively(data);
52
83
  }
53
84
  return data;
54
85
  }
55
86
  else {
56
- throw new Error(`Function 'getSecureData' failed. File '${filename}.json' not found'`);
87
+ throw new Error(`Function 'getSecureData' failed. File '${filename}.json' empty or not defined under '${source}'`);
57
88
  }
58
89
  }
59
90
  else {
60
- throw new Error(`Function 'getSecureData' failed. No data path defined in config.`);
91
+ throw new Error(`Function 'getSecureData' failed. Data path '${source}' not defined in config.`);
92
+ }
93
+ }
94
+ /**
95
+ * @function readDataFromFile
96
+ * @memberOf util.data
97
+ * @description Reads the data object from the given filepath.
98
+ * @param {String} filePath - The filepath.
99
+ * @returns {Object} The data object.
100
+ * @example const data = util.data.readDataFromFile("./data/myData.json");
101
+ */
102
+ async readDataFromFile(filePath) {
103
+ const relativeFilePath = dataExchangeUtil_1.default.getFileAbsPath(filePath);
104
+ if (!relativeFilePath) {
105
+ throw new Error("Function 'readDataFromFile' failed. Filepath could not be resolved.");
106
+ }
107
+ try {
108
+ return JSON.parse(await fs_1.promises.readFile(path.resolve(relativeFilePath), "utf8"));
109
+ }
110
+ catch (error) {
111
+ throw new Error(`Function 'readDataFromFile' failed: ${error}`);
112
+ }
113
+ }
114
+ /**
115
+ * @function writeDataToFile
116
+ * @memberOf util.data
117
+ * @description Writes the data object to the given filepath.
118
+ * @param {String} filePath - The filepath.
119
+ * @param {Object} data - The data object to write.
120
+ * @example const data = util.data.writeDataToFile("myTest");
121
+ */
122
+ async writeDataToFile(filePath, data) {
123
+ const relativeFilePath = dataExchangeUtil_1.default.getFileAbsPath(filePath);
124
+ if (!relativeFilePath) {
125
+ throw new Error("Function 'writeDataToFile' failed. Filepath could not be resolved.");
126
+ }
127
+ try {
128
+ await fs_1.promises.writeFile(path.resolve(relativeFilePath), JSON.stringify(data));
129
+ }
130
+ catch (error) {
131
+ throw new Error(`Function 'writeDataToFile' failed: ${error}`);
61
132
  }
62
133
  }
63
134
  /**
@@ -65,7 +136,7 @@ class Data {
65
136
  * @memberOf util.data
66
137
  * @description Decrypts the passed input data.
67
138
  * @param {String} data - The encrypted data to decrypt.
68
- * @returns {String} The decrypted data.
139
+ * @returns {Object} The decrypted data.
69
140
  * @example const decrypted = util.data.decrypt("d704004c262faa8ef4bdcf34c8a94883e15524872c7bef334d26a391a1934cf47338b749d99426980ee4cc7a81deaef21439c6894ab0324cdb29b9b6332635baca442651c5d37847f52bb90b8868e037271a7d456024b39b65fdf4dc62e8d82a3d5683a72e4324c59d339742fc79749f0ee74abef916d38e306218adc48e3547a2b346962249320c962d22cb46d9998de36d8219a2496c0997d0fc389f76fb1431a9b57c317886e9c9795c0a09ad98d9fa0b7687d10814dc7973397f3f72a227a04ead4c3d1d428c096a51922ffc4d7afc3952df1c130def5c5fb3e834605cbf1454885966cc65c77046343f4c678e74931fb2dd6cac8dae17837cf674f288d6550dd7fa6b01f5b7ea68aa6bd27d79dd5d53edb5fd4b4edce824bd31b3939352ad7a71a16bab8c54025c2bb92c54e022fcd23ff08bc54a17fc50d00dc3b884cadbfdefe1e75901fdf80e7324ad02a891f2c4863fa120ca238520b79126c65a03");
70
141
  */
71
142
  decrypt(data) {
@@ -1 +1 @@
1
- {"version":3,"file":"data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ED,IAAI;YACF,MAAM,aAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;SAC1E;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,sCAAsC,KAAK,EAAE,CAAC,CAAC;SAChE;IACH,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,IAAY;QAClB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,+DAA+D;IACxG,CAAC;IAEO,mBAAmB,CAAC,IAAS;QACnC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC9D,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aACjD;iBAAM,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;gBACpE,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aACjD;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5HD,oBA4HC;AACD,kBAAe,IAAI,IAAI,EAAE,CAAC"}
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const index_1 = __importDefault(require("../../reuse/index"));
7
+ const Runtime_1 = __importDefault(require("../../reuse/modules/runtime/Runtime"));
7
8
  const dataExchangeCommands_1 = __importDefault(require("./utils/dataExchangeCommands"));
8
9
  const decryption_1 = __importDefault(require("./utils/decryption"));
9
10
  /**
@@ -14,6 +15,9 @@ const decryption_1 = __importDefault(require("./utils/decryption"));
14
15
  * @param {Array.<String>} specs List of spec file paths that are to be run
15
16
  */
16
17
  async function default_1(config, capabilities, specs) {
18
+ // This class is for storing any runtime information (like current specs, ...) and accessing it in the reuse functions.
19
+ global.runtime = Runtime_1.default;
20
+ global.runtime.specs = specs;
17
21
  index_1.default.load();
18
22
  decryption_1.default.initDecryptFunction();
19
23
  if (config.user || config.key) {
@@ -22,5 +26,4 @@ async function default_1(config, capabilities, specs) {
22
26
  await dataExchangeCommands_1.default.readParams();
23
27
  }
24
28
  exports.default = default_1;
25
- ;
26
29
  //# sourceMappingURL=beforeSession.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"beforeSession.js","sourceRoot":"","sources":["../../../src/scripts/hooks/beforeSession.ts"],"names":[],"mappings":";;;;;AAAA,8DAA6C;AAC7C,wFAAgE;AAChE,oEAA4C;AAC5C;;;;;;GAMG;AACY,KAAK,oBAAW,MAA2B,EAAE,YAAsB,EAAE,KAAe;IACjG,eAAY,CAAC,IAAI,EAAE,CAAC;IACpB,oBAAU,CAAC,mBAAmB,EAAE,CAAC;IACjC,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,EAAE;QAC7B,oBAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;KACvC;IACD,MAAM,8BAAoB,CAAC,UAAU,EAAE,CAAC;AAC1C,CAAC;AAPD,4BAOC;AAAA,CAAC"}
1
+ {"version":3,"file":"beforeSession.js","sourceRoot":"","sources":["../../../src/scripts/hooks/beforeSession.ts"],"names":[],"mappings":";;;;;AAAA,8DAA6C;AAC7C,kFAA0D;AAE1D,wFAAgE;AAChE,oEAA4C;AAC5C;;;;;;GAMG;AACY,KAAK,oBAAW,MAA2B,EAAE,YAAsB,EAAE,KAAe;IACjG,uHAAuH;IACvH,MAAM,CAAC,OAAO,GAAG,iBAAO,CAAC;IACzB,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAE7B,eAAY,CAAC,IAAI,EAAE,CAAC;IACpB,oBAAU,CAAC,mBAAmB,EAAE,CAAC;IACjC,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,EAAE;QAC7B,oBAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;KACvC;IACD,MAAM,8BAAoB,CAAC,UAAU,EAAE,CAAC;AAC1C,CAAC;AAXD,4BAWC"}
@@ -77,7 +77,13 @@ module.exports = {
77
77
  // If it is an object, replicate the object.
78
78
  nu = {};
79
79
  Object.keys(value).forEach(function (name) {
80
- nu[name] = derez(value[name], path + "[" + JSON.stringify(name) + "]");
80
+ // remove unnecessary properties
81
+ if (name === "undefined" || name === "oPropagatedProperties" || name === "oParent") {
82
+ nu[name] = null;
83
+ }
84
+ else {
85
+ nu[name] = derez(value[name], path + "[" + JSON.stringify(name) + "]");
86
+ }
81
87
  });
82
88
  }
83
89
  return nu;
@@ -1 +1 @@
1
- {"version":3,"file":"cycle.js","sourceRoot":"","sources":["../../../../src/scripts/hooks/utils/cycle.js"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;EAaE;AACF,iFAAiF;AACjF,4CAA4C;AAE5C,gBAAgB;AAEhB;;;EAGE;AAEF,MAAM,CAAC,OAAO,GAAG;IACf,OAAO,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,QAAQ;QACxC,YAAY,CAAC;QAEb,yEAAyE;QACzE,uEAAuE;QACvE,yEAAyE;QACzE,wBAAwB;QAExB,sBAAsB;QAEtB,wEAAwE;QAExE,MAAM;QAEN,mBAAmB;QACnB,iBAAiB;QACjB,+CAA+C;QAE/C,wCAAwC;QAExC,6EAA6E;QAC7E,wEAAwE;QAExE,6EAA6E;QAC7E,yEAAyE;QACzE,YAAY;QAEZ,IAAI,OAAO,GAAG,IAAI,OAAO,EAAE,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,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE;4BACnD,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;4BACxB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gCAC7C,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;6BACvB;iCAAM;gCACL,GAAG,CAAC,OAAO,CAAC,CAAC;6BACd;yBACF;oBACH,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI;wBACvC,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;wBACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;4BAC7C,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;4BACrB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gCAC7C,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;6BAC1B;iCAAM;gCACL,GAAG,CAAC,IAAI,CAAC,CAAC;6BACX;yBACF;oBACH,CAAC,CAAC,CAAC;iBACJ;aACF;QACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACN,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap_oss/wdio-qmate-service",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "author": "SAP SE",
5
5
  "types": "./@types/index.d.ts",
6
6
  "main": "./lib/index.js",