froth-webdriverio-framework 3.0.60 → 3.0.62
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
|
-
|
|
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,17 +91,17 @@ 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) {
|
|
103
101
|
let assertionStatus = false; // Initialize status
|
|
104
102
|
let valueToVerify;
|
|
105
103
|
|
|
106
|
-
|
|
104
|
+
// try {
|
|
107
105
|
//if buffer is true, get the value from buffer
|
|
108
106
|
buffer ? valueToVerify = BUFFER.getItem(buffername_value) : valueToVerify = buffername_value;
|
|
109
107
|
|
|
@@ -118,20 +116,16 @@ 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}.`;
|
|
119
|
+
await amendToBrowserstack(annotationMessage, "info");
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
// } catch (e) {
|
|
122
|
+
// console.error('Error in validateAttributeData:', e);
|
|
123
|
+
// console.log(`${attribute_name} verification failed. Expected text: ${valueToVerify}.`);
|
|
124
|
+
// let annotationMessage = `${attribute_name} verification failed. Expected text: ${valueToVerify}.`;
|
|
125
|
+
// await amendToBrowserstack(annotationMessage, "error");
|
|
124
126
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
console.log(`${attribute_name} verification failed. Expected text: ${valueToVerify}.`);
|
|
128
|
-
let annotationMessage = `${attribute_name} verification failed. Expected text: ${valueToVerify}.`;
|
|
129
|
-
|
|
130
|
-
if (process.env.BROWSERSTACK)
|
|
131
|
-
await amendToBrowserstack(annotationMessage, "error");
|
|
132
|
-
|
|
133
|
-
throw e;
|
|
134
|
-
}
|
|
127
|
+
// throw e;
|
|
128
|
+
// }
|
|
135
129
|
}
|
|
136
130
|
// async function amendToBrowserstack(annotationMessage, level) {
|
|
137
131
|
// try {
|