froth-webdriverio-framework 4.0.62 → 4.0.64

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.
@@ -34,15 +34,33 @@ async function callapi(methodtype, api_url, queryParams, payloaddetails, body_ty
34
34
  console.log("No body sent (body_type not provided or empty payload).");
35
35
  }
36
36
 
37
-
37
+
38
38
  console.warn("Warning: GET request with a body is non-standard and may not work with all APIs.");
39
- response = await axios({
39
+ const config = {
40
40
  method: method,
41
41
  url: api_url,
42
- headers: headers,
43
- data: body === null ? undefined : body // Axios allows body with GET in some cases
44
- });
45
-
42
+ headers: headers
43
+ };
44
+ const isBodyEmpty =
45
+ body === null ||
46
+ body === undefined ||
47
+ body === ''
48
+
49
+
50
+ if (!isBodyEmpty) {
51
+ config.data = body;
52
+ }
53
+ console.log("body:", body);
54
+ console.log("Config for API call:", config);
55
+ response = await axios(config);
56
+
57
+ // response = await axios({
58
+ // method: method,
59
+ // url: api_url,
60
+ // headers: headers,
61
+ // data: body === null ? undefined : body // Axios allows body with GET in some cases
62
+ // });
63
+
46
64
 
47
65
  console.log("Response Data:", response.data);
48
66
 
@@ -137,7 +155,7 @@ async function validateAttributeData(attribute_name, attribute, buffer, bufferna
137
155
  valueToVerify = Boolean(valueToVerify);
138
156
  } else if (datatype.toLowerCase() == "decimal") {
139
157
  valueToVerify = parseFloat(valueToVerify);
140
- }else if (datatype.toLowerCase() == "string") {
158
+ } else if (datatype.toLowerCase() == "string") {
141
159
  valueToVerify = valueToVerify.toString();
142
160
  }
143
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "4.0.62",
3
+ "version": "4.0.64",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",