froth-webdriverio-framework 7.0.20 → 7.0.22
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.
|
@@ -3,10 +3,10 @@ async function getBSBuildDetails(sessionType, bsUsername, bsPassword) {
|
|
|
3
3
|
console.log(`Session type: ${sessionType}`);
|
|
4
4
|
|
|
5
5
|
const basicAuth = btoa(`${bsUsername}:${bsPassword}`);
|
|
6
|
-
|
|
7
|
-
? `Mobile_Build
|
|
8
|
-
: `Web_Build
|
|
9
|
-
|
|
6
|
+
let buildName = sessionType === 'app-automate'
|
|
7
|
+
? `Mobile_Build-${process.env.FROTH_TESTOPS_BUILD_NAME.trim()}`
|
|
8
|
+
: `Web_Build-${process.env.FROTH_TESTOPS_BUILD_NAME.trim()}`;
|
|
9
|
+
buildName=buildName.trim().replaceAll(" ","");
|
|
10
10
|
console.log(`BrowserStack build name: ${buildName}`);
|
|
11
11
|
|
|
12
12
|
const url = `https://api.browserstack.com/${sessionType}/builds.json?name=${buildName}`;
|
|
@@ -52,10 +52,10 @@ async function getExecuitonDetails(frothUrl, token, id) {
|
|
|
52
52
|
// let responseData = await response.json()
|
|
53
53
|
|
|
54
54
|
data = await aes.decrpytData(data.data)
|
|
55
|
-
|
|
55
|
+
// console.log("after decrypting",data)
|
|
56
56
|
|
|
57
57
|
data = JSON.parse(data)
|
|
58
|
-
|
|
58
|
+
// console.log("json parsing",data)
|
|
59
59
|
if (!data) return null;
|
|
60
60
|
|
|
61
61
|
const jsondata = {
|
|
@@ -267,26 +267,26 @@ async function updateScriptExecutionStatus(
|
|
|
267
267
|
|
|
268
268
|
|
|
269
269
|
|
|
270
|
-
async function main() {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
270
|
+
// async function main() {
|
|
271
|
+
// try {
|
|
272
|
+
// const frothUrl = "https://api.frothtestops.com";
|
|
273
|
+
// // const username = "subhra.subudhi@roboticodigital.com";
|
|
274
|
+
// // const password = "V2VsY29tZUAxMjM=";
|
|
275
|
+
|
|
276
|
+
// // const token = await getLoginToken(frothUrl, username, password);
|
|
277
|
+
// // if (!token) {
|
|
278
|
+
// // throw new Error('Login failed, no token obtained');
|
|
279
|
+
// // }
|
|
280
|
+
// const token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzY3MTc4MTk2LCJpYXQiOjE3NjcxNzQ1OTYsImp0aSI6Ijg2MzA3ZjU0YjZhNzRkZDY5ZjY0MTc2YjM5MWUyMTNiIiwidXNlcl9pZCI6MX0.lwp38e7P-toi7k1EaFdgHi5Eu4B-Ps8Y0epN1d5I_Cc'
|
|
281
|
+
// const id = 133;
|
|
282
|
+
// const data = await getExecuitonDetails(frothUrl, token, id);
|
|
283
|
+
// console.log("Retrieved JSON Data:", data);
|
|
284
|
+
// } catch (error) {
|
|
285
|
+
// console.error('Error in main function:', error);
|
|
286
|
+
// }
|
|
287
|
+
// }
|
|
288
288
|
|
|
289
|
-
main();
|
|
289
|
+
// main();
|
|
290
290
|
|
|
291
291
|
module.exports = {
|
|
292
292
|
getExecuitonDetails,
|
|
@@ -151,7 +151,10 @@ const commonHooks = {
|
|
|
151
151
|
/** Media upload */
|
|
152
152
|
if (process.env.MEDIA_FILES) {
|
|
153
153
|
try {
|
|
154
|
-
|
|
154
|
+
const media = JSON.parse(process.env.MEDIA_FILES);
|
|
155
|
+
console.log('Total items:', media.length);
|
|
156
|
+
if (media.length > 0)
|
|
157
|
+
bsOpts['browserstack.uploadMedia'] = JSON.parse(process.env.MEDIA_FILES);
|
|
155
158
|
} catch {
|
|
156
159
|
console.warn('⚠️ MEDIA_FILES is not valid JSON');
|
|
157
160
|
}
|
|
@@ -161,7 +164,7 @@ const commonHooks = {
|
|
|
161
164
|
}
|
|
162
165
|
console.log('final cinfig dteials :' + JSON.stringify(capabilities))
|
|
163
166
|
|
|
164
|
-
|
|
167
|
+
// console.log("config details " + JSON.stringify(config))
|
|
165
168
|
|
|
166
169
|
|
|
167
170
|
} catch (error) {
|
|
@@ -262,7 +265,7 @@ const commonHooks = {
|
|
|
262
265
|
const endTime = Date.now();
|
|
263
266
|
const totalTime = endTime - suiteStartTime; // Full WDIO+CI elapsed time
|
|
264
267
|
resultdetails.excution_time = await msToTime(totalTime);
|
|
265
|
-
console.log("Exit code after session===>"+exitCode)
|
|
268
|
+
console.log("Exit code after session===>" + exitCode)
|
|
266
269
|
resultdetails.excution_status = exitCode === 0 ? 'PASSED' : 'FAILED';
|
|
267
270
|
|
|
268
271
|
console.log('Comments being sent:', resultdetails.comments);
|