@sap_oss/wdio-qmate-service 2.7.2 → 2.7.4
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/docs/sections/bestPractices/selectors.md +1 -1
- package/docs/sections/features/selectors.md +2 -2
- package/lib/index.js.map +1 -1
- package/lib/reuse/authenticator/authHandler.js.map +1 -1
- package/lib/reuse/authenticator/basicUrlAuthenticator.js.map +1 -1
- package/lib/reuse/authenticator/customAuthenticator.js.map +1 -1
- package/lib/reuse/authenticator/formAuthenticator.js.map +1 -1
- package/lib/reuse/authenticator/plainAuthenticator.js.map +1 -1
- package/lib/reuse/helper/clientsideUI5scripts.js.map +1 -1
- package/lib/reuse/helper/elementHighlight.js.map +1 -1
- package/lib/reuse/helper/elementResolving.js.map +1 -1
- package/lib/reuse/helper/errorHandler.js.map +1 -1
- package/lib/reuse/helper/inputValidation.js.map +1 -1
- package/lib/reuse/helper/jsDocGen.js.map +1 -1
- package/lib/reuse/helper/jsonDocGen.js.map +1 -1
- package/lib/reuse/modules/common/constants/date.constants.js +1 -1
- package/lib/reuse/modules/common/constants/date.constants.js.map +1 -1
- package/lib/reuse/modules/common/constants/userInteraction.constants.js +1 -1
- package/lib/reuse/modules/common/constants/userInteraction.constants.js.map +1 -1
- package/lib/reuse/modules/common/date.js.map +1 -1
- package/lib/reuse/modules/common/navigation.js.map +1 -1
- package/lib/reuse/modules/common/userInteraction.js.map +1 -1
- package/lib/reuse/modules/nonUi5/assertion.js.map +1 -1
- package/lib/reuse/modules/nonUi5/element.js.map +1 -1
- package/lib/reuse/modules/nonUi5/navigation.js.map +1 -1
- package/lib/reuse/modules/nonUi5/session.js.map +1 -1
- package/lib/reuse/modules/nonUi5/userInteraction.js.map +1 -1
- package/lib/reuse/modules/service/odata.d.ts +74 -48
- package/lib/reuse/modules/service/odata.js +168 -134
- package/lib/reuse/modules/service/odata.js.map +1 -1
- package/lib/reuse/modules/service/rest.js.map +1 -1
- package/lib/reuse/modules/ui5/assertion.js +9 -0
- package/lib/reuse/modules/ui5/assertion.js.map +1 -1
- package/lib/reuse/modules/ui5/constants/mockserver.constants.js +1 -1
- package/lib/reuse/modules/ui5/constants/mockserver.constants.js.map +1 -1
- package/lib/reuse/modules/ui5/control.js.map +1 -1
- package/lib/reuse/modules/ui5/date.d.ts +1 -1
- package/lib/reuse/modules/ui5/date.js +1 -1
- package/lib/reuse/modules/ui5/date.js.map +1 -1
- package/lib/reuse/modules/ui5/element.js.map +1 -1
- package/lib/reuse/modules/ui5/mockserver.js.map +1 -1
- package/lib/reuse/modules/ui5/navigation.js.map +1 -1
- package/lib/reuse/modules/ui5/navigationBar.js.map +1 -1
- package/lib/reuse/modules/ui5/qunit.js.map +1 -1
- package/lib/reuse/modules/ui5/session.js.map +1 -1
- package/lib/reuse/modules/ui5/table.js.map +1 -1
- package/lib/reuse/modules/ui5/userInteraction.js.map +1 -1
- package/lib/reuse/modules/util/browser.js.map +1 -1
- package/lib/reuse/modules/util/component.js.map +1 -1
- package/lib/reuse/modules/util/console.js.map +1 -1
- package/lib/reuse/modules/util/constants/formatter.constants.js +1 -1
- package/lib/reuse/modules/util/constants/formatter.constants.js.map +1 -1
- package/lib/reuse/modules/util/data.js.map +1 -1
- package/lib/reuse/modules/util/file.js.map +1 -1
- package/lib/reuse/modules/util/formatter.js.map +1 -1
- package/lib/reuse/modules/util/function.js.map +1 -1
- package/lib/reuse/modules/util/system.js.map +1 -1
- package/lib/reuse/runner/runner.js.map +1 -1
- package/lib/scripts/clientsideUI5scripts.js.map +1 -1
- package/lib/scripts/dataExchange/dataExchange.js.map +1 -1
- package/lib/scripts/dataExchange/dataExchangeUtil.js.map +1 -1
- package/lib/scripts/hooks/beforeSession.js.map +1 -1
- package/lib/scripts/hooks/onPrepare.js.map +1 -1
- package/lib/scripts/hooks/utils/addLocatorCommands.js.map +1 -1
- package/lib/scripts/hooks/utils/browserLog.js.map +1 -1
- package/lib/scripts/hooks/utils/cycle.js.map +1 -1
- package/lib/scripts/hooks/utils/dataExchangeCommands.js.map +1 -1
- package/lib/scripts/hooks/utils/decryption.js.map +1 -1
- package/lib/scripts/hooks/utils/lib.js.map +1 -1
- package/lib/scripts/hooks/utils/locatorCommands.js.map +1 -1
- package/lib/scripts/locators/qmateLocator.js.map +1 -1
- package/lib/scripts/locators/uiveri5Locator.js.map +1 -1
- package/package.json +12 -12
- package/test/reuse/service/odata/get.spec.js +4 -10
- package/test/reuse/service/odata/getEntitySet.spec.js +2 -8
- package/test/reuse/util/browser/getBrowserName.spec.js +1 -1
- package/tsconfig.json +0 -1
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
interface IHeaders {
|
|
2
|
+
[key: string]: string;
|
|
3
|
+
}
|
|
4
|
+
interface IParams {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}
|
|
1
7
|
/**
|
|
2
8
|
* @class odata
|
|
3
9
|
* @memberof service
|
|
@@ -11,48 +17,58 @@ export declare class OData {
|
|
|
11
17
|
/**
|
|
12
18
|
* @function init
|
|
13
19
|
* @memberOf service.odata
|
|
14
|
-
* @description Initializes
|
|
20
|
+
* @description Initializes the OData Service.
|
|
15
21
|
* XCSRF-Token will be automatically fetched and stored in the service instance.
|
|
16
22
|
* Cookies will also automatically assembled and stored in the service instance.
|
|
17
|
-
* @param {String} url - The base url of the service
|
|
18
|
-
* @param {String} username - The username.
|
|
23
|
+
* @param {String} url - The base url of the service.
|
|
24
|
+
* @param {String} username - The username to authenticate the service.
|
|
19
25
|
* @param {String} password - The password of the username.
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {Object} [params={}] - JSON object with key-value pairs of parameter names and corresponding values
|
|
22
|
-
*
|
|
26
|
+
* @param {Boolean} [loggingEnabled=false] - The boolean param to control whether user wants to see logs during build run.
|
|
27
|
+
* @param {Object} [params={}] - JSON object with key-value pairs of parameter names and corresponding values.
|
|
28
|
+
* By default we send {
|
|
23
29
|
* "client": "715",
|
|
24
30
|
* "documentation": ["heading", "quickinfo"],
|
|
25
31
|
* "language": "EN"
|
|
26
32
|
* }
|
|
27
|
-
* These can be overridden by sending params as JSON object with additional params as shown in example
|
|
33
|
+
* These can be overridden by sending params as JSON object with additional params as shown in example.
|
|
28
34
|
* @param {String} [authType] - authentication type, in case you want to override the default
|
|
29
35
|
* SAML authentication. Set this to "basic", to use basic authentication for communication users for whom SAML login doesn't work.
|
|
30
36
|
* Or "none" for no authentication.
|
|
37
|
+
* @param {Object} [headers=undefined] - JSON object with key-value pairs of optional headers.
|
|
31
38
|
* @returns {Object} The initialized service object.
|
|
32
39
|
* @example const url = "<urlToSystem>/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/";
|
|
33
40
|
* const params = {
|
|
34
41
|
* "saml2": "disabled",
|
|
35
42
|
* "language": "de"
|
|
36
43
|
* }
|
|
37
|
-
* srv = await service.odata.init(url, user, password, false, params);
|
|
44
|
+
* const srv = await service.odata.init(url, user, password, false, params);
|
|
45
|
+
* @example const base64Credentials = Buffer.from(`${user}:${password}`).toString("base64");
|
|
46
|
+
* const authHeaders = {
|
|
47
|
+
* "Authorization": `Basic ${base64Credentials}`,
|
|
48
|
+
* "DwC-Tenant": tenant
|
|
49
|
+
* };
|
|
50
|
+
*
|
|
51
|
+
* const srv = await service.odata.init(url, user, password, true, params, "headers", authHeaders);
|
|
38
52
|
*/
|
|
39
|
-
init(url: string, username: string, password: string, loggingEnabled?: boolean, params?: {}, authType?: string): Promise<any>;
|
|
53
|
+
init(url: string, username: string, password: string, loggingEnabled?: boolean, params?: {}, authType?: string, headers?: any): Promise<any>;
|
|
40
54
|
/**
|
|
41
55
|
* @function get
|
|
42
56
|
* @memberOf service.odata
|
|
43
|
-
* @description
|
|
44
|
-
* @param {Object} srv -
|
|
45
|
-
* @param {String} entitySet - The
|
|
46
|
-
* @param {Object} keys - The required keys for the GET
|
|
47
|
-
* @param {Boolean} raw -
|
|
57
|
+
* @description Sends a GET request to retrieve data from the specified OData entity set.
|
|
58
|
+
* @param {Object} srv - An instance of the service.
|
|
59
|
+
* @param {String} entitySet - The entity set from which data is to be retrieved.
|
|
60
|
+
* @param {Object} keys - The required keys for the GET request.
|
|
61
|
+
* @param {Boolean} [raw=false] - Specifies whether the response should include all header contents.
|
|
62
|
+
* @param {Object} [headers] - Optional headers to be included in the request.
|
|
63
|
+
* @returns {Promise} A Promise that resolves to the response data.
|
|
48
64
|
* @example const url = "<baseUrl>/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/";
|
|
49
|
-
* srv = await service.odata.init(url, user, password);
|
|
65
|
+
* const srv = await service.odata.init(url, user, password);
|
|
50
66
|
* const keys = {
|
|
51
67
|
* PurchaseOrder: "4100000000"
|
|
52
68
|
* };
|
|
53
69
|
* const res = await service.odata.get(srv, "A_PurchaseOrder", keys);
|
|
54
70
|
*/
|
|
55
|
-
get(srv: any, entitySet: string, keys: any, raw?: boolean): Promise<any>;
|
|
71
|
+
get(srv: any, entitySet: string, keys: any, raw?: boolean, headers?: IHeaders): Promise<any>;
|
|
56
72
|
/**
|
|
57
73
|
* @function getEntitySet
|
|
58
74
|
* @memberOf service.odata
|
|
@@ -62,7 +78,7 @@ export declare class OData {
|
|
|
62
78
|
* @param {String} [filterString] - The filters to be applied on get query
|
|
63
79
|
* @param {String} [selectionFields] - comma separated list of fields to be selected
|
|
64
80
|
* @param {Object} [queryParams] - JSON object of key value pairs of custom query parameters.
|
|
65
|
-
* @returns {
|
|
81
|
+
* @returns {Promise} A Promise that resolves to the response data.
|
|
66
82
|
* @example
|
|
67
83
|
* const url = "<baseUrl>/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/";
|
|
68
84
|
* srv = await service.odata.init(url, user, password);
|
|
@@ -80,73 +96,69 @@ export declare class OData {
|
|
|
80
96
|
* let res = await service.odata.getEntitySet(srv, "A_PurchaseOrder", filterString, select, queryParams);
|
|
81
97
|
*/
|
|
82
98
|
getEntitySet(srv: any, entitySet: string, filterString?: string, selectionFields?: string, queryParams?: any): Promise<any>;
|
|
83
|
-
/**
|
|
84
|
-
* @function isFeatureToggleActivated
|
|
85
|
-
* @memberOf service.odata
|
|
86
|
-
* @description checks if a feature toggle is switched on or off
|
|
87
|
-
* @param {Object} srv - Instance of the service
|
|
88
|
-
* @param {String} featureName - The name of the feature you want know the status of.
|
|
89
|
-
* @example const url = browser.params.systemUrl + "/sap/opu/odata/SAP/CA_FM_FEATURE_TOGGLE_STATUS_SRV/";
|
|
90
|
-
* const srv = await service.odata.init(url, user, password);
|
|
91
|
-
* let isFeatureActive = await service.odata.isFeatureToggleActivated(srv, "MM_PUR_PO_BATCHES_IN_MANAGE_PO");
|
|
92
|
-
*/
|
|
93
|
-
isFeatureToggleActivated(srv: any, featureName: string): Promise<boolean>;
|
|
94
99
|
/**
|
|
95
100
|
* @function post
|
|
96
101
|
* @memberOf service.odata
|
|
97
|
-
* @description
|
|
102
|
+
* @description Sends a POST request to retrieve data from the specified OData entity set for the given payload.
|
|
98
103
|
* @param {Object} srv - Instance of the service
|
|
99
104
|
* @param {String} entitySet - The entitySet you want to POST against.
|
|
100
|
-
* @param {Object} payload - The payload
|
|
101
|
-
* @param {Boolean} raw -
|
|
105
|
+
* @param {Object} payload - The payload of the POST request.
|
|
106
|
+
* @param {Boolean} [raw=false] - Specifies whether the response should include all header contents.
|
|
107
|
+
* @param {Object} [headers] - Optional headers to be included in the request.
|
|
108
|
+
* @returns {Promise} A Promise that resolves to the response data.
|
|
102
109
|
* @example
|
|
103
|
-
*
|
|
110
|
+
* const payload = {
|
|
104
111
|
* "PurchaseOrder": "4500007108",
|
|
105
112
|
* "DraftUUID": "00000000-0000-0000-0000-000000000000",
|
|
106
113
|
* "IsActiveEntity": "true"
|
|
107
114
|
* };
|
|
108
|
-
*
|
|
115
|
+
* const res = await service.odata.post(srv, "A_PurchaseOrder", payload);
|
|
109
116
|
*/
|
|
110
|
-
post(srv: any, entitySet: string, payload: any, raw?: boolean): Promise<any>;
|
|
117
|
+
post(srv: any, entitySet: string, payload: any, raw?: boolean, headers?: IHeaders): Promise<any>;
|
|
111
118
|
/**
|
|
112
119
|
* @function merge
|
|
113
120
|
* @memberOf service.odata
|
|
114
|
-
* @description
|
|
121
|
+
* @description @description Sends a MERGE request to merge data from the specified OData entity set for the given payload.
|
|
115
122
|
* @param {Object} srv - Instance of the service
|
|
116
123
|
* @param {String} entitySet - The entitySet you want to MERGE in.
|
|
117
|
-
* @param {Object} payload - The payload
|
|
124
|
+
* @param {Object} payload - The payload of the MERGE request.
|
|
125
|
+
* @param {Object} [headers] - Optional headers to be included in the request.
|
|
126
|
+
* @returns {Promise} A Promise that resolves to the response data.
|
|
118
127
|
* @example
|
|
119
|
-
*
|
|
128
|
+
* const res = await service.odata.merge(srv, "A_PurchaseOrderScheduleLine", {
|
|
120
129
|
* "PurchasingDocument": "4500007108",
|
|
121
130
|
* "PurchasingDocumentItem": "10",
|
|
122
131
|
* "ScheduleLine": "1",
|
|
123
132
|
* "ScheduleLineDeliveryDate": new Date()
|
|
124
133
|
* };
|
|
125
134
|
*/
|
|
126
|
-
merge(srv: any, entitySet: string, payload: any): Promise<any>;
|
|
135
|
+
merge(srv: any, entitySet: string, payload: any, headers?: IHeaders): Promise<any>;
|
|
127
136
|
/**
|
|
128
137
|
* @function delete
|
|
129
138
|
* @memberOf service.odata
|
|
130
|
-
* @description
|
|
131
|
-
* @param {Object} srv - Instance of the service
|
|
139
|
+
* @description Sends a DELETE request to the specified OData entity set.
|
|
140
|
+
* @param {Object} srv - Instance of the service.
|
|
132
141
|
* @param {String} entitySet - The entitySet you want to DELETE.
|
|
133
|
-
* @param {Object} options - The options for the DELETE
|
|
142
|
+
* @param {Object} options - The options for the DELETE request.
|
|
143
|
+
* @param {Object} [headers] - Optional headers to be included in the request.
|
|
144
|
+
* @returns {Promise} A Promise that resolves to the response data.
|
|
134
145
|
* @example
|
|
135
|
-
*
|
|
146
|
+
* const options = {
|
|
136
147
|
* "PurchaseOrder": "",
|
|
137
148
|
* "DraftUUID": draftUUID,
|
|
138
149
|
* "IsActiveEntity": false
|
|
139
150
|
* };
|
|
140
|
-
* await service.odata.delete(srv, "C_PurchaseOrderTP", options);
|
|
151
|
+
* const res = await service.odata.delete(srv, "C_PurchaseOrderTP", options);
|
|
141
152
|
*/
|
|
142
|
-
delete(srv: any, entitySet: string, options: any): Promise<any>;
|
|
153
|
+
delete(srv: any, entitySet: string, options: any, headers?: IHeaders): Promise<any>;
|
|
143
154
|
/**
|
|
144
155
|
* @function callFunctionImport
|
|
145
156
|
* @memberOf service.odata
|
|
146
|
-
* @description
|
|
147
|
-
* @param {Object} srv - Instance of the service
|
|
148
|
-
* @param {String} functionImportName - Name of Function Import
|
|
149
|
-
* @param {Object} options -
|
|
157
|
+
* @description Sends a function import request to the OData service instance.
|
|
158
|
+
* @param {Object} srv - Instance of the service.
|
|
159
|
+
* @param {String} functionImportName - Name of Function Import.
|
|
160
|
+
* @param {Object} options - Parameters for function import.
|
|
161
|
+
* @returns {Promise} A Promise that resolves to the response data.
|
|
150
162
|
* @example
|
|
151
163
|
* const options = {
|
|
152
164
|
* CentralRequestForQuotation : "7500000026",
|
|
@@ -155,6 +167,18 @@ export declare class OData {
|
|
|
155
167
|
* const res = await service.odata.callFunctionImport(srv, "Cancel", options);
|
|
156
168
|
*/
|
|
157
169
|
callFunctionImport(srv: any, functionImportName: string, options: any): Promise<any>;
|
|
170
|
+
/**
|
|
171
|
+
* @function isFeatureToggleActivated
|
|
172
|
+
* @memberOf service.odata
|
|
173
|
+
* @description Checks if a feature toggle is switched on or off.
|
|
174
|
+
* @param {Object} srv - Instance of the service
|
|
175
|
+
* @param {String} featureName - The name of the feature you want know the status of.
|
|
176
|
+
* @returns {Promise} A Promise that resolves to a bool value.
|
|
177
|
+
* @example const url = browser.params.systemUrl + "/sap/opu/odata/SAP/CA_FM_FEATURE_TOGGLE_STATUS_SRV/";
|
|
178
|
+
* const srv = await service.odata.init(url, user, password);
|
|
179
|
+
* let isFeatureActive = await service.odata.isFeatureToggleActivated(srv, "MM_PUR_PO_BATCHES_IN_MANAGE_PO");
|
|
180
|
+
*/
|
|
181
|
+
isFeatureToggleActivated(srv: any, featureName: string): Promise<boolean>;
|
|
158
182
|
/**
|
|
159
183
|
* @function getOutputManagementPdfStream
|
|
160
184
|
* @memberOf service.odata
|
|
@@ -186,6 +210,8 @@ export declare class OData {
|
|
|
186
210
|
*/
|
|
187
211
|
readPdfFromDirectUrl(url: string, username: string, password: string, isSaml?: boolean): Promise<any>;
|
|
188
212
|
_doRequest(url: string, username: string, password: string, isSaml: boolean): Promise<any>;
|
|
213
|
+
_applyHeaders(entity: any, headers: IHeaders): any;
|
|
214
|
+
_applyQueryParameters(entity: any, params: IParams): any;
|
|
189
215
|
}
|
|
190
216
|
declare const _default: OData;
|
|
191
217
|
export default _default;
|