froth-webdriverio-framework 3.0.132 → 3.0.134

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.
@@ -59,6 +59,7 @@ async function getExecuitonDetails(frothUrl, token, id) {
59
59
 
60
60
  async function getExecuitonScriptDetails(frothUrl, token, execution_id, script_id, script_platform) {
61
61
  let id;
62
+ console.log("script id is :" + script_id+" script platform is :"+script_platform+" execution id is :"+execution_id+" token is :"+token)
62
63
  const url = `${frothUrl}/api/execution-script-mapping/?execution_id=${execution_id}&automation_script_id=${script_id}&platform=${script_platform}`;
63
64
 
64
65
  try {
@@ -25,13 +25,13 @@ async function getSuiteDetails(frothUrl, token, id) {
25
25
  // jsondata.browser_stack_urls = data.browser_stack_urls == null ? "" : data.browser_stack_urls;
26
26
  jsondata.script_details = data.script_details == null ? [] : data.script_details;
27
27
  // console.log("automation_script_id:" + JSON.stringify(jsondata.automation_script_id))
28
- const automationScripts = jsondata.script_details.reduce((obj, item) => {
29
- obj[item.script_Id] = item.script_Id;
30
- BUFFER.setItem(item.scriptName, item.scriptId);
31
- BUFFER.setItem(item.scriptName + "_PLATFORM", item.platform);
28
+ // const automationScripts = jsondata.script_details.reduce((obj, item) => {
29
+ // obj[item.script_Id] = item.script_Id;
30
+ // BUFFER.setItem(item.scriptName, item.scriptId);
31
+ // BUFFER.setItem(item.scriptName + "_PLATFORM", item.platform);
32
32
 
33
- return obj;
34
- }, {});
33
+ // return obj;
34
+ // }, {});
35
35
  jsondata.test_sequence = data.test_sequence;
36
36
  // console.log("automation_script_ details:" + JSON.stringify(BUFFER))
37
37
 
@@ -9,7 +9,7 @@ const { fail } = require("assert");
9
9
  let starttime;
10
10
  let endtime;
11
11
  console.log('===== common config===== ');
12
-
12
+ let suite_info;
13
13
  const resultdetails = {
14
14
  comments: [],
15
15
  excution_status: 'SKIPPED', // Pass/Fail
@@ -29,7 +29,7 @@ const commonconfig = {
29
29
  await setAllDetails.setExecutionDetails();
30
30
 
31
31
  // await setAllDetails.setIntegrationsDetails();
32
- await setAllDetails.setSuiteDetails();
32
+ suite_info= await setAllDetails.setSuiteDetails();
33
33
  await setAllDetails.setTestDataDetails();
34
34
  console.log("on prepare:", JSON.stringify(capabilities))
35
35
 
@@ -40,13 +40,6 @@ const commonconfig = {
40
40
  }
41
41
  },
42
42
 
43
- before: async function (capabilities, specs) {
44
- console.log('==== BEFORE HOOK ====');
45
-
46
- // Capture uncaught exceptions (including syntax errors)
47
-
48
- },
49
-
50
43
 
51
44
  beforeSession: async function (config, capabilities, specs) {
52
45
  try {
@@ -162,8 +155,17 @@ const commonconfig = {
162
155
 
163
156
  // scriptresult = "FAILED"
164
157
  }
165
- let scriptid = BUFFER.getItem(fileName.replace(".js", ""))
166
- let script_platform = BUFFER.getItem(fileName.replace(".js", "") + "_PLATFORM")
158
+ console.log("suite info:", suite_info)
159
+ const jwtScript = suite_info.script_details.find(script => script.scriptName === fileName.replace(".js", ""));
160
+ console.log("jwtScript:", jwtScript);
161
+ if (jwtScript) {
162
+ console.log("Script ID:", jwtScript.scriptId);
163
+ console.log("Script Platform:", jwtScript.platform);
164
+ }
165
+ let scriptid = jwtScript.scriptId
166
+ let script_platform = jwtScript.platform
167
+ // let scriptid = BUFFER.getItem(fileName.replace(".js", ""))
168
+ // let script_platform = BUFFER.getItem(fileName.replace(".js", "") + "_PLATFORM")
167
169
 
168
170
  await exeDetails.updateScriptExecutionStatus(
169
171
  BUFFER.getItem("ORGANISATION_DOMAIN_URL"),
@@ -78,7 +78,7 @@ async function setSuiteDetails() {
78
78
  const getSuiteDetail = await getSuiteDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), process.env.AUTOMATION_SUITE_ID);
79
79
  // process.env.BROWSERSTACK_APP_PATH = getSuiteDetail.browser_stack_urls;
80
80
  process.env.TESTDATA_ID = getSuiteDetail.test_data_id;
81
-
81
+ return getSuiteDetail;
82
82
 
83
83
  } catch (error) {
84
84
  // console.error('Error in main function:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.132",
3
+ "version": "3.0.134",
4
4
 
5
5
  "readme": "WebdriverIO Integration",
6
6
  "description": "WebdriverIO and BrowserStack App Automate",