froth-webdriverio-framework 3.0.124 → 3.0.126
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.
|
@@ -31,6 +31,17 @@ async function callapi(methodtype, api_url, queryParams, payloaddetails, body_ty
|
|
|
31
31
|
|
|
32
32
|
// console.log("options:", JSON.stringify(options, null, 2));
|
|
33
33
|
// Send the request
|
|
34
|
+
if (method === 'GET' && body) {
|
|
35
|
+
console.warn("Using X-HTTP-Method-Override for GET with body.");
|
|
36
|
+
response = await fetch(api_url, {
|
|
37
|
+
method: 'POST', // Override to POST
|
|
38
|
+
headers: {
|
|
39
|
+
...headers,
|
|
40
|
+
'X-HTTP-Method-Override': 'GET' // Trick the API into treating it as GET
|
|
41
|
+
},
|
|
42
|
+
body: body
|
|
43
|
+
});
|
|
44
|
+
} else
|
|
34
45
|
response = await fetch(api_url, {method,headers, body});
|
|
35
46
|
|
|
36
47
|
console.log("Response Data:", response);
|
|
@@ -71,6 +82,8 @@ async function formheaders(authentication, headers, body_type) {
|
|
|
71
82
|
}
|
|
72
83
|
if (body_type === "formdata") {
|
|
73
84
|
headers['Content-Type'] = 'multipart/form-data';
|
|
85
|
+
}if(body_type === "raw"){
|
|
86
|
+
headers['Content-Type'] = 'application/json';
|
|
74
87
|
}
|
|
75
88
|
// Add authentication headers based on the type
|
|
76
89
|
if (authentication && authentication.auth_type) {
|
|
@@ -44,19 +44,7 @@ const commonconfig = {
|
|
|
44
44
|
console.log('==== BEFORE HOOK ====');
|
|
45
45
|
|
|
46
46
|
// Capture uncaught exceptions (including syntax errors)
|
|
47
|
-
|
|
48
|
-
console.error("Uncaught Exception:", err);
|
|
49
|
-
resultdetails.comments.push(`Execution failed with exit code: ${err}`);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// Capture unhandled promise rejections
|
|
53
|
-
process.on('unhandledRejection', (reason, promise) => {
|
|
54
|
-
console.error("Unhandled Promise Rejection:", reason);
|
|
55
|
-
resultdetails.comments.push(`Execution failed with exit code: ${reason}`);
|
|
56
|
-
});
|
|
57
|
-
resultdetails.excution_status='SKIPPED';
|
|
58
|
-
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
59
|
-
|
|
47
|
+
|
|
60
48
|
},
|
|
61
49
|
|
|
62
50
|
|