froth-webdriverio-framework 4.0.72 → 5.0.0
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.
|
@@ -47,18 +47,18 @@ function generateJWTToken(payload) {
|
|
|
47
47
|
//console.log('Signed and encoded JWT', jwt)
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
function main() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
// function main() {
|
|
51
|
+
// // JWT Payload
|
|
52
|
+
// const payload = {
|
|
53
|
+
// iss: "YTLC_TEST_AUTOMATION_APP",
|
|
54
|
+
// iat: currentTimestamp, // Issued at
|
|
55
|
+
// exp: currentTimestamp + 200, // Expiry time: 30 seconds from issuance
|
|
56
|
+
// user_agent: {
|
|
57
|
+
// id: "janga.reddy@ytl.com"
|
|
58
|
+
// }
|
|
59
|
+
// };
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
main()
|
|
61
|
+
// console.log('JWT signed token:', generateJWTToken(payload));
|
|
62
|
+
// }
|
|
63
|
+
//main()
|
|
64
64
|
module.exports = { generateJWTToken}
|
|
@@ -203,20 +203,20 @@ async function RANDOM(template, datatype) {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
// Example function to test the template replacement
|
|
206
|
-
async function main() {
|
|
206
|
+
// async function main() {
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
208
|
+
// let template = "SUBHRASUBUDHI {CTMSTMP} @GMAQIL.COM";
|
|
209
|
+
// let result = await RANDOM(template, 'STRING');
|
|
210
|
+
// console.log(result);
|
|
211
|
+
// console.log(typeof result);
|
|
212
|
+
// // template = "{RANDOMREGEX[\\\\d{5}(-\\\\\d{4})?][10]}";
|
|
213
|
+
// // result = await RANDOM(template, 'STRING');
|
|
214
|
+
// // console.log(result);
|
|
215
|
+
// // console.log(typeof result);
|
|
216
216
|
|
|
217
|
-
}
|
|
217
|
+
// }
|
|
218
218
|
|
|
219
|
-
main();
|
|
219
|
+
//main();
|
|
220
220
|
module.exports = {
|
|
221
221
|
RNDNUMBER,
|
|
222
222
|
RNDFLOAT,
|
|
@@ -249,6 +249,7 @@ const commonconfig = {
|
|
|
249
249
|
console.log("====> Total Duration taken for the suite:" + BUFFER.getItem("FROTH_TOTAL_DURATION"));
|
|
250
250
|
console.log("====> Execution Status from results" + resultdetails.excution_status);
|
|
251
251
|
// Capture WebDriver session errors
|
|
252
|
+
|
|
252
253
|
if (result !== 0) {
|
|
253
254
|
if (resultdetails.comments.length === 0) {
|
|
254
255
|
resultdetails.comments.push("❌ WebDriver session failed or timed out.");
|
|
@@ -264,6 +265,17 @@ const commonconfig = {
|
|
|
264
265
|
|
|
265
266
|
},
|
|
266
267
|
|
|
268
|
+
onError: async function (error) {
|
|
269
|
+
console.error('==== ON ERROR HOOK ====');
|
|
270
|
+
console.error('====> Error occurred:', error.message);
|
|
271
|
+
if (error.message.includes('Automate testing time expired')) {
|
|
272
|
+
console.log('❌ Global error: Session timed out on BrowserStack.');
|
|
273
|
+
resultdetails.comments.push(`Global error: Session timed out on BrowserStack.Please check ths session: ${result}`);
|
|
274
|
+
|
|
275
|
+
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
276
|
+
process.exit(1); // Stop execution if session timed out
|
|
277
|
+
}
|
|
278
|
+
},
|
|
267
279
|
afterSession: async function (config, capabilities, specs) {
|
|
268
280
|
console.log('==== AFTER SESSION HOOK ====');
|
|
269
281
|
console.log('====> This is the aftersession hook');
|
|
@@ -323,8 +335,6 @@ const commonconfig = {
|
|
|
323
335
|
console.log('Total Tests:', results.total);
|
|
324
336
|
console.log('Passed:', results.passed);
|
|
325
337
|
console.log('Failed:', results.failed);
|
|
326
|
-
console.log('Skipped:', results.skipped);
|
|
327
|
-
console.log('Execution Time:', results.duration);
|
|
328
338
|
console.log('Exit Code:', exitCode);
|
|
329
339
|
|
|
330
340
|
console.log('==== ALL TESTS ARE COMPLETED ====');
|