froth-webdriverio-framework 3.0.59 → 3.0.61
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.
|
@@ -100,8 +100,10 @@ async function getBSSessionDetails(sessiontype, bs_username, bs_pwd) {
|
|
|
100
100
|
|
|
101
101
|
async function amend2Browserstack(annotationMessage, level) {
|
|
102
102
|
try {
|
|
103
|
+
|
|
103
104
|
console.log("Annotation message inside amend2Browserstack:" + annotationMessage)
|
|
104
|
-
|
|
105
|
+
if (process.env.BROWSERSTACK)
|
|
106
|
+
await driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"' + annotationMessage + '","level": "' + level + '"}}');
|
|
105
107
|
|
|
106
108
|
} catch (error) {
|
|
107
109
|
console.error('Error occurred while annoting to BS :', error);
|
|
@@ -122,7 +124,8 @@ async function amend2Browserstack(annotationMessage, level) {
|
|
|
122
124
|
// }
|
|
123
125
|
|
|
124
126
|
// main();
|
|
125
|
-
module.exports = {
|
|
127
|
+
module.exports = {
|
|
128
|
+
getBSSessionDetails,
|
|
126
129
|
getBSBuildDetails,
|
|
127
130
|
amend2Browserstack
|
|
128
131
|
};
|
package/commonMethods/apicall.js
CHANGED
|
@@ -8,7 +8,7 @@ async function callapi(method, api_url, queryParams, payloaddetails, authenticat
|
|
|
8
8
|
}
|
|
9
9
|
console.log("URL: " + api_url);
|
|
10
10
|
let formData = new FormData();
|
|
11
|
-
console.log("Payload Details: before if loop", JSON.stringify(payloaddetails));
|
|
11
|
+
// console.log("Payload Details: before if loop", JSON.stringify(payloaddetails));
|
|
12
12
|
|
|
13
13
|
if (payloaddetails && Object.keys(payloaddetails).length > 0) {
|
|
14
14
|
console.log("Payload Details:", JSON.stringify(payloaddetails));
|
|
@@ -84,8 +84,6 @@ async function formheaders(authentication, headers) {
|
|
|
84
84
|
}
|
|
85
85
|
async function validate(attribute_name, attribute, actionname, buffer, buffername_value, datatype) {
|
|
86
86
|
|
|
87
|
-
try {
|
|
88
|
-
|
|
89
87
|
if (actionname.toLowerCase() == "verify") {
|
|
90
88
|
await validateAttributeData(attribute_name, attribute, buffer, buffername_value, datatype);
|
|
91
89
|
} else if (actionname.toLowerCase() == "setbuffer") {
|
|
@@ -93,10 +91,10 @@ async function validate(attribute_name, attribute, actionname, buffer, buffernam
|
|
|
93
91
|
} else if (actionname.toLowerCase() == "getbuffer") {
|
|
94
92
|
return BUFFER.getItem(buffername_value);
|
|
95
93
|
}
|
|
96
|
-
} catch (e) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
94
|
+
// } catch (e) {
|
|
95
|
+
// console.error('Error in validate method:', e);
|
|
96
|
+
// throw e;
|
|
97
|
+
// }
|
|
100
98
|
}
|
|
101
99
|
|
|
102
100
|
async function validateAttributeData(attribute_name, attribute, buffer, buffername_value, datatype) {
|
|
@@ -118,17 +116,15 @@ async function validateAttributeData(attribute_name, attribute, buffer, bufferna
|
|
|
118
116
|
|
|
119
117
|
console.log("verification succeeded.");
|
|
120
118
|
let annotationMessage = `${attribute_name} verification passed. Actual text: ${attribute}, Expected text: ${valueToVerify}.`;
|
|
121
|
-
|
|
122
|
-
if (process.env.BROWSERSTACK)
|
|
123
|
-
await amendToBrowserstack(annotationMessage, "info");
|
|
119
|
+
await amendToBrowserstack(annotationMessage, "info");
|
|
124
120
|
|
|
125
121
|
} catch (e) {
|
|
126
122
|
console.error('Error in validateAttributeData:', e);
|
|
127
123
|
console.log(`${attribute_name} verification failed. Expected text: ${valueToVerify}.`);
|
|
128
124
|
let annotationMessage = `${attribute_name} verification failed. Expected text: ${valueToVerify}.`;
|
|
125
|
+
await amendToBrowserstack(annotationMessage, "error");
|
|
129
126
|
|
|
130
|
-
|
|
131
|
-
await amendToBrowserstack(annotationMessage, "error");
|
|
127
|
+
throw e;
|
|
132
128
|
}
|
|
133
129
|
}
|
|
134
130
|
// async function amendToBrowserstack(annotationMessage, level) {
|