froth-webdriverio-framework 3.0.41 → 3.0.44

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.
@@ -7,8 +7,10 @@ async function callapi(method, api_url, queryParams, payloaddetails, authenticat
7
7
  }
8
8
  console.log("URL: " + api_url);
9
9
  const formData = new FormData();
10
+ console.log("Payload Details: before if loop", JSON.stringify(payloaddetails));
10
11
 
11
12
  if (payloaddetails && Object.keys(payloaddetails).length > 0) {
13
+ console.log("Payload Details:", JSON.stringify(payloaddetails));
12
14
  Object.entries(payloaddetails).forEach(([key, value]) => formData.append(key, value));
13
15
  }
14
16
 
@@ -56,8 +58,11 @@ async function formheaders(authentication, headers) {
56
58
  }
57
59
  async function validate(attribute, actionname, buffer, value, datatype) {
58
60
  try {
59
- let valueToVerify;
61
+ let valueToVerify;
62
+ let assertionStatus = false; // Initialize status
63
+
60
64
  if (actionname.toLowerCase() == "verify") {
65
+
61
66
  //if buffer is true, get the value from buffer
62
67
  buffer ? valueToVerify = BUFFER.getItem(value) : valueToVerify = value;
63
68
 
@@ -67,6 +72,12 @@ async function validate(attribute, actionname, buffer, value, datatype) {
67
72
  valueToVerify = Boolean(valueToVerify);
68
73
  }
69
74
  expect(attribute).toBe(valueToVerify, `Expected value: ${valueToVerify}, but got: ${attribute}`);
75
+ assertionStatus = true; // If assertion passes, set status to true
76
+ console.log("Verification succeeded.");
77
+ actualText = await element.getText();
78
+ let annotationMessage = `Verification passed. Actual text: ${attribute}, Expected text: ${valueToVerify}.`;
79
+ await amendToBrowserstack(annotationMessage, "info");
80
+
70
81
  } else if (actionname.toLowerCase() == "setbuffer") {
71
82
  BUFFER.setItem(value, attribute);
72
83
  } else if (actionname.toLowerCase() == "getbuffer") {
@@ -74,6 +85,9 @@ async function validate(attribute, actionname, buffer, value, datatype) {
74
85
  }
75
86
  } catch (e) {
76
87
  console.error('Error in validate:', e);
88
+ console.log(`Validation failed. Expected text: ,${valueToVerify}.`);
89
+ let annotationMessage = `Verification failed. Expected text: ,${valueToVerify}.`;
90
+ await amendToBrowserstack(annotationMessage, "error");
77
91
  }
78
92
  }
79
93
 
@@ -46,7 +46,7 @@ const commonconfig = {
46
46
 
47
47
  starttime = new Date().getTime();
48
48
 
49
- if (isBrowserStackEnabled === true) {
49
+ if (isBrowserStackEnabled) {
50
50
  console.log("BrowserStack is enabled");
51
51
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
52
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.41",
3
+ "version": "3.0.44",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",