froth-webdriverio-framework 3.0.47 → 3.0.49

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.
@@ -53,9 +53,9 @@ async function getExecuitonDetails(frothUrl, token, id) {
53
53
 
54
54
  }
55
55
 
56
- async function getExecuitonScriptDetails(frothUrl, token, execution_id, script_id) {
56
+ async function getExecuitonScriptDetails(frothUrl, token, execution_id, script_id,script_platform) {
57
57
  let id;
58
- const url = `${frothUrl}/api/execution-script-mapping/?execution_id=${execution_id}&automation_script_id=${script_id}`;
58
+ const url = `${frothUrl}/api/execution-script-mapping/?execution_id=${execution_id}&automation_script_id=${script_id}&platform=${script_platform}`;
59
59
 
60
60
  try {
61
61
  console.log("URL: " + url)
@@ -151,11 +151,12 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
151
151
 
152
152
  }
153
153
 
154
- async function updateScriptExecutionStatus(frothUrl, token, scriptid, status) {
154
+ async function updateScriptExecutionStatus(frothUrl, token, scriptid,script_platform, status) {
155
155
 
156
156
  if (scriptid != 0) {
157
157
  try {
158
- const id = await getExecuitonScriptDetails(frothUrl, token, BUFFER.getItem("FROTH_EXECUTION_ID"), scriptid)
158
+ console.log("script platform is "+script_platform)
159
+ const id = await getExecuitonScriptDetails(frothUrl, token, BUFFER.getItem("FROTH_EXECUTION_ID"), scriptid,script_platform)
159
160
  console.log("ID is :" + id)
160
161
  const url = `${frothUrl}/api/script-status-percentage/${id}/`;
161
162
  const formData = new FormData();
@@ -181,7 +182,7 @@ async function updateScriptExecutionStatus(frothUrl, token, scriptid, status) {
181
182
  // Call login function to obtain a new token
182
183
  const newToken = await getLoginToken(BUFFER.getItem("SERVICE_USER"), BUFFER.getItem("SERVICE_PASSWORD")); // You need to implement the login function
183
184
  // Retry the request with the new token
184
- return updateScriptExecutionStatus(frothUrl, newToken, id, status);
185
+ return updateScriptExecutionStatus(frothUrl, newToken, scriptid,script_platform, status);
185
186
  } else {
186
187
  const errorText = await response.text();
187
188
  console.error(`error in updating the status into DB ${response.status}`);
@@ -28,6 +28,8 @@ async function getSuiteDetails(frothUrl, token, id) {
28
28
  const automationScripts = jsondata.script_details.reduce((obj, item) => {
29
29
  obj[item.script_Id] = item.script_Id;
30
30
  BUFFER.setItem(item.scriptName, item.scriptId);
31
+ BUFFER.setItem(item.scriptName+"_PLATFORM", item.platform);
32
+
31
33
  return obj;
32
34
  }, {});
33
35
  jsondata.test_sequence = data.test_sequence;
@@ -95,7 +95,6 @@ async function validate(attribute, actionname, buffer, value, datatype) {
95
95
  expect(attribute).toBe(valueToVerify, `Expected value: ${valueToVerify}, but got: ${attribute}`);
96
96
  assertionStatus = true; // If assertion passes, set status to true
97
97
  console.log("Verification succeeded.");
98
- actualText = await element.getText();
99
98
  let annotationMessage = `Verification passed. Actual text: ${attribute}, Expected text: ${valueToVerify}.`;
100
99
  await amendToBrowserstack(annotationMessage, "info");
101
100
 
@@ -106,8 +105,8 @@ async function validate(attribute, actionname, buffer, value, datatype) {
106
105
  }
107
106
  } catch (e) {
108
107
  console.error('Error in validate:', e);
109
- console.log(`Validation failed. Expected text: ,${valueToVerify}.`);
110
- let annotationMessage = `Verification failed. Expected text: ,${valueToVerify}.`;
108
+ console.log(`Validation failed. Expected text: ${valueToVerify}.`);
109
+ let annotationMessage = `Verification failed. Expected text: ${valueToVerify}.`;
111
110
  await amendToBrowserstack(annotationMessage, "error");
112
111
  }
113
112
  }
@@ -102,10 +102,13 @@ const commonconfig = {
102
102
  // scriptresult = "FAILED"
103
103
  }
104
104
  let scriptid = BUFFER.getItem(fileName.replace(".js", ""))
105
+ let script_platform = BUFFER.getItem(fileName.replace(".js", "")+"_PLATFORM")
106
+
105
107
  await exeDetails.updateScriptExecutionStatus(
106
108
  BUFFER.getItem("ORGANISATION_DOMAIN_URL"),
107
109
  BUFFER.getItem("FROTH_LOGIN_TOKEN"),
108
110
  scriptid,
111
+ script_platform.toLowerCase(),
109
112
  scriptresult)
110
113
 
111
114
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.47",
3
+ "version": "3.0.49",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",