@sap_oss/wdio-qmate-service
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -187,6 +187,6 @@ /** | ||
*/ | ||
readPdfFromDirectUrl(url: string, username: string, password: string, isSaml?: boolean): Promise<unknown>; | ||
_doRequest(url: string, username: string, password: string, isSaml: boolean): Promise<unknown>; | ||
readPdfFromDirectUrl(url: string, username: string, password: string, isSaml?: boolean): Promise<any>; | ||
_doRequest(url: string, username: string, password: string, isSaml: boolean): Promise<any>; | ||
} | ||
declare const _default: OData; | ||
export default _default; |
@@ -324,3 +324,3 @@ "use strict"; | ||
// =================================== HELPER =================================== | ||
_doRequest(url, username, password, isSaml) { | ||
async _doRequest(url, username, password, isSaml) { | ||
//const auth = new Buffer(username + ":" + password).toString("base64"); | ||
@@ -333,3 +333,13 @@ const options = { | ||
if (isSaml) { | ||
options.auth = username + ":" + password; | ||
// works only for SAP odata services | ||
const serviceUrl = url.match(/.*\/[a-zA-Z0-9_]+_SRV\//)?.[0]; | ||
if (serviceUrl) { | ||
let relativePath = "/" + url.substring(serviceUrl.length); | ||
const srv = await service.odata.init(serviceUrl, username, password); | ||
const pdfResp = await srv.agent.get(relativePath); | ||
return pdfResp.arrayBuffer(); | ||
} | ||
else { | ||
throw new Error("SAML login option is available only for SAP ODATA services"); | ||
} | ||
} | ||
@@ -336,0 +346,0 @@ else { |
@@ -66,2 +66,3 @@ "use strict"; | ||
} | ||
let remoteFiles = ""; | ||
for (const file of files) { | ||
@@ -71,4 +72,8 @@ const filePath = path.resolve(file); | ||
const remoteFilePath = await browser.uploadFile(filePath); | ||
await elem.setValue(remoteFilePath); | ||
if (remoteFiles) { | ||
remoteFiles = remoteFiles + "\n"; | ||
} | ||
remoteFiles = remoteFiles + remoteFilePath; | ||
} | ||
await elem.addValue(remoteFiles); | ||
} | ||
@@ -75,0 +80,0 @@ catch (error) { |
{ | ||
"name": "@sap_oss/wdio-qmate-service", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"author": "SAP SE", | ||
@@ -5,0 +5,0 @@ "types": "./@types/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2573455
36401