froth-webdriverio-framework 3.0.154 → 3.0.156

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))
@@ -144,7 +141,8 @@ const commonconfig = {
144
141
  }
145
142
  else {
146
143
  scriptresult = "FAILED"
147
- resultdetails.comments.push(`${test.title} - failed: ${error.message}`);
144
+ if (!resultdetails.comments.some(comment => typeof comment === 'string' && comment.includes(test.title)))
145
+ resultdetails.comments.push(`${test.title} - failed: ${error.message}`);
148
146
  }
149
147
  if (error) {
150
148
  console.error(`========= Error occured while executing the test: ${error.message}`);
@@ -155,25 +153,15 @@ const commonconfig = {
155
153
  let scriptDetails = BUFFER.getItem("FROTHE_SUITE_DETAILS");
156
154
  if (typeof scriptDetails === "string") {
157
155
  scriptDetails = JSON.parse(scriptDetails);
158
- }
159
- console.log("Script Details in After Hook:", JSON.stringify(scriptDetails, null, 2));
156
+ }
160
157
  const jwtScript = scriptDetails.find(s => s.scriptName === fileName.replace(".js", ""));
161
-
162
158
  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
159
 
172
160
  await exeDetails.updateScriptExecutionStatus(
173
161
  BUFFER.getItem("ORGANISATION_DOMAIN_URL"),
174
162
  BUFFER.getItem("FROTH_LOGIN_TOKEN"),
175
- scriptid,
176
- script_platform.toLowerCase(),
163
+ jwtScript.scriptId,
164
+ jwtScript.platform.toLowerCase(),
177
165
  scriptresult)
178
166
 
179
167
  },
@@ -195,10 +183,8 @@ const commonconfig = {
195
183
  after: async function (result, config, capabilities, specs) {
196
184
  console.log('==== AFTER HOOK ====');
197
185
  console.log('====> All tests are completed.' + result);
198
-
199
186
  BUFFER.setItem("RESULT_DATA", result);
200
187
  console.log("====> Result data :" + BUFFER.getItem("RESULT_DATA"))
201
-
202
188
  /// const resultdetails = {}
203
189
  resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
204
190
  console.log("====> Total Duration taken for the suite:" + BUFFER.getItem("FROTH_TOTAL_DURATION"));
@@ -218,15 +204,12 @@ const commonconfig = {
218
204
  afterSession: async function (config, capabilities, specs) {
219
205
  console.log('==== AFTER SESSION HOOK ====');
220
206
  console.log('====> This is the aftersession hook');
221
- // Perform any cleanup or post-test actions here
222
207
  // console.log("Capabilities:", capabilities);
223
208
  console.log("Specs:", specs);
224
- console.log("Config:", config);
225
-
209
+ //console.log("Config:", config);
226
210
  endtime = new Date().getTime();
227
211
  let totalDuration = endtime - starttime;
228
212
  console.log("====> Total Duration in after session based on start time and end time:" + totalDuration);
229
-
230
213
  if (process.env.PLATFORM === 'browserstack')
231
214
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
232
215
 
@@ -254,7 +237,6 @@ const commonconfig = {
254
237
  onComplete: async function (exitCode, config, capabilities, results) {
255
238
  console.log('==== ON COMPLETE HOOK ====');
256
239
  console.log('====> Results:', results);
257
-
258
240
  console.log('==== Test Results Summary ======');
259
241
  console.log('Total Tests:', results.total);
260
242
  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.156",
4
4
 
5
5
  "readme": "WebdriverIO Integration",
6
6
  "description": "WebdriverIO and BrowserStack App Automate",