froth-webdriverio-framework 3.0.154 → 3.0.155

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.
@@ -22,18 +22,8 @@ async function getSuiteDetails(frothUrl, token, id) {
22
22
  jsondata.automation_suite_id = data.id == null ? 0 : data.id;
23
23
  jsondata.automation_suite_name = data.automation_suite_name == null ? "" : data.automation_suite_name;
24
24
  jsondata.test_data_id = data.test_data_id == null ? 0 : data.test_data_id;
25
- // jsondata.browser_stack_urls = data.browser_stack_urls == null ? "" : data.browser_stack_urls;
26
25
  jsondata.script_details = data.script_details == null ? [] : data.script_details;
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);
32
-
33
- // return obj;
34
- // }, {});
35
26
  jsondata.test_sequence = data.test_sequence;
36
- // console.log("automation_script_ details:" + JSON.stringify(BUFFER))
37
27
 
38
28
  console.log("json data :" + JSON.stringify(jsondata));
39
29
 
@@ -24,10 +24,7 @@ const commonconfig = {
24
24
  console.log('==== ON PREPARE HOOK ====');
25
25
  // This code runs before the test suite starts
26
26
  await setAllDetails.setEnvVariables();
27
- // await setAllDetails.setLoginToken();
28
27
  await setAllDetails.setExecutionDetails();
29
-
30
- // await setAllDetails.setIntegrationsDetails();
31
28
  await setAllDetails.setSuiteDetails();
32
29
  await setAllDetails.setTestDataDetails();
33
30
  console.log("on prepare:", JSON.stringify(capabilities))
@@ -156,24 +153,14 @@ const commonconfig = {
156
153
  if (typeof scriptDetails === "string") {
157
154
  scriptDetails = JSON.parse(scriptDetails);
158
155
  }
159
- console.log("Script Details in After Hook:", JSON.stringify(scriptDetails, null, 2));
160
156
  const jwtScript = scriptDetails.find(s => s.scriptName === fileName.replace(".js", ""));
161
-
162
157
  console.log("jwtScript:", jwtScript);
163
- if (jwtScript) {
164
- console.log("Script ID:", jwtScript.scriptId);
165
- console.log("Script Platform:", jwtScript.platform);
166
- }
167
- let scriptid = jwtScript.scriptId
168
- let script_platform = jwtScript.platform
169
- // let scriptid = BUFFER.getItem(fileName.replace(".js", ""))
170
- // let script_platform = BUFFER.getItem(fileName.replace(".js", "") + "_PLATFORM")
171
-
158
+
172
159
  await exeDetails.updateScriptExecutionStatus(
173
160
  BUFFER.getItem("ORGANISATION_DOMAIN_URL"),
174
161
  BUFFER.getItem("FROTH_LOGIN_TOKEN"),
175
- scriptid,
176
- script_platform.toLowerCase(),
162
+ jwtScript.scriptId,
163
+ jwtScript.platform.toLowerCase(),
177
164
  scriptresult)
178
165
 
179
166
  },
@@ -195,10 +182,8 @@ const commonconfig = {
195
182
  after: async function (result, config, capabilities, specs) {
196
183
  console.log('==== AFTER HOOK ====');
197
184
  console.log('====> All tests are completed.' + result);
198
-
199
185
  BUFFER.setItem("RESULT_DATA", result);
200
186
  console.log("====> Result data :" + BUFFER.getItem("RESULT_DATA"))
201
-
202
187
  /// const resultdetails = {}
203
188
  resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
204
189
  console.log("====> Total Duration taken for the suite:" + BUFFER.getItem("FROTH_TOTAL_DURATION"));
@@ -218,15 +203,12 @@ const commonconfig = {
218
203
  afterSession: async function (config, capabilities, specs) {
219
204
  console.log('==== AFTER SESSION HOOK ====');
220
205
  console.log('====> This is the aftersession hook');
221
- // Perform any cleanup or post-test actions here
222
206
  // console.log("Capabilities:", capabilities);
223
207
  console.log("Specs:", specs);
224
- console.log("Config:", config);
225
-
208
+ //console.log("Config:", config);
226
209
  endtime = new Date().getTime();
227
210
  let totalDuration = endtime - starttime;
228
211
  console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
229
-
230
212
  if (process.env.PLATFORM === 'browserstack')
231
213
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
232
214
 
@@ -254,7 +236,6 @@ const commonconfig = {
254
236
  onComplete: async function (exitCode, config, capabilities, results) {
255
237
  console.log('==== ON COMPLETE HOOK ====');
256
238
  console.log('====> Results:', results);
257
-
258
239
  console.log('==== Test Results Summary ======');
259
240
  console.log('Total Tests:', results.total);
260
241
  console.log('Passed:', results.passed);
@@ -76,16 +76,7 @@ async function setExecutionDetails() {
76
76
  async function setSuiteDetails() {
77
77
  try {
78
78
  const getSuiteDetail = await getSuiteDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), process.env.AUTOMATION_SUITE_ID);
79
- // process.env.BROWSERSTACK_APP_PATH = getSuiteDetail.browser_stack_urls;
80
- console.log("Script Details:", JSON.stringify(getSuiteDetail.script_details, null, 2));
81
79
  BUFFER.setItem("FROTHE_SUITE_DETAILS", JSON.stringify(getSuiteDetail.script_details))
82
- const scriptDetails = BUFFER.getItem("FROTHE_SUITE_DETAILS");
83
- if (typeof scriptDetails === "string") {
84
- scriptDetails = JSON.parse(scriptDetails);
85
- }
86
-
87
- console.log("Script Details in After Hook:", JSON.stringify(scriptDetails, null, 2));
88
-
89
80
  process.env.TESTDATA_ID = getSuiteDetail.test_data_id;
90
81
  return getSuiteDetail;
91
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "3.0.154",
3
+ "version": "3.0.155",
4
4
 
5
5
  "readme": "WebdriverIO Integration",
6
6
  "description": "WebdriverIO and BrowserStack App Automate",