froth-webdriverio-framework 5.0.9 → 5.0.11

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.
Files changed (47) hide show
  1. package/froth_api_calls/browsersatckSessionInfo.js +1 -1
  2. package/froth_common_actions/logData.js +1 -0
  3. package/froth_configs/commonconfig.js +14 -6
  4. package/froth_configs/globalUtilShim.js +20 -0
  5. package/package.json +3 -2
  6. package/allure-report/app.js +0 -2
  7. package/allure-report/data/attachments/5a44d93eb6bbc152.json +0 -3
  8. package/allure-report/data/attachments/8b4b70d43c5ef509.json +0 -1
  9. package/allure-report/data/attachments/f8f260f9d290c8dc.json +0 -3
  10. package/allure-report/data/behaviors.csv +0 -2
  11. package/allure-report/data/behaviors.json +0 -1
  12. package/allure-report/data/categories.csv +0 -2
  13. package/allure-report/data/categories.json +0 -1
  14. package/allure-report/data/packages.json +0 -1
  15. package/allure-report/data/suites.csv +0 -2
  16. package/allure-report/data/suites.json +0 -1
  17. package/allure-report/data/test-cases/eae527eca53ea9fc.json +0 -1
  18. package/allure-report/data/timeline.json +0 -1
  19. package/allure-report/export/influxDbData.txt +0 -14
  20. package/allure-report/export/mail.html +0 -10
  21. package/allure-report/export/prometheusData.txt +0 -14
  22. package/allure-report/favicon.ico +0 -0
  23. package/allure-report/history/categories-trend.json +0 -1
  24. package/allure-report/history/duration-trend.json +0 -1
  25. package/allure-report/history/history-trend.json +0 -1
  26. package/allure-report/history/history.json +0 -1
  27. package/allure-report/history/retry-trend.json +0 -1
  28. package/allure-report/index.html +0 -34
  29. package/allure-report/plugin/behaviors/index.js +0 -276
  30. package/allure-report/plugin/packages/index.js +0 -160
  31. package/allure-report/plugin/screen-diff/index.js +0 -200
  32. package/allure-report/plugin/screen-diff/styles.css +0 -30
  33. package/allure-report/styles.css +0 -5
  34. package/allure-report/widgets/behaviors.json +0 -1
  35. package/allure-report/widgets/categories-trend.json +0 -1
  36. package/allure-report/widgets/categories.json +0 -1
  37. package/allure-report/widgets/duration-trend.json +0 -1
  38. package/allure-report/widgets/duration.json +0 -1
  39. package/allure-report/widgets/environment.json +0 -1
  40. package/allure-report/widgets/executors.json +0 -1
  41. package/allure-report/widgets/history-trend.json +0 -1
  42. package/allure-report/widgets/launch.json +0 -1
  43. package/allure-report/widgets/retry-trend.json +0 -1
  44. package/allure-report/widgets/severity.json +0 -1
  45. package/allure-report/widgets/status-chart.json +0 -1
  46. package/allure-report/widgets/suites.json +0 -1
  47. package/allure-report/widgets/summary.json +0 -1
@@ -108,7 +108,7 @@ async function amend2Browserstack(annotationMessage, level) {
108
108
  console.log("Annotation message inside amend2Browserstack:" + annotationMessage)
109
109
  if (process.env.PLATFORM === 'browserstack')
110
110
  await driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"' + annotationMessage + '","level": "' + level + '"}}');
111
-
111
+
112
112
  } catch (error) {
113
113
  console.error('Error occurred while annoting to BS :', error);
114
114
  throw error;
@@ -1,5 +1,6 @@
1
1
  const amendToBrowserstack = require("../froth_api_calls/browsersatckSessionInfo").amend2Browserstack;
2
2
 
3
+
3
4
  async function logJsonData2Table(jsonData) {
4
5
  try {
5
6
  console.log("Logging JSON data to table format in BrowserStack:");
@@ -9,6 +9,9 @@ const exeDetails = require("../froth_api_calls/getexecutionDetails")
9
9
  const { fail } = require("assert");
10
10
  const { error } = require('console');
11
11
  const HTMLReportGenerator = require('wdio-json-html-reporter').HTMLReportGenerator;
12
+ require('froth-webdriverio-framework/globalUtilShim');
13
+
14
+ let Util;
12
15
 
13
16
  //const isBrowserStackEnabled = process.env.BROWSERSTACK;
14
17
  let starttime;
@@ -136,10 +139,9 @@ const commonconfig = {
136
139
 
137
140
  if (process.env.PLATFORM === 'browserstack')
138
141
  await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
139
- else
140
- {
142
+ else {
141
143
  console.log("Local execution - no BrowserStack session details to fetch.");
142
- // BUFFER.setItem("SESSION_ID", "local-session");
144
+ // BUFFER.setItem("SESSION_ID", "local-session");
143
145
  BUFFER.setItem("REPORT_URL", `./reports/${process.env.EXECUTION_ID}/test-report.html`);
144
146
  //BUFFER.setItem("FROTH_TOTAL_DURATION", 0);
145
147
 
@@ -163,6 +165,12 @@ const commonconfig = {
163
165
  console.log('==== BEFORE HOOK FOR MOBILE ====');
164
166
  }
165
167
 
168
+ console.log("🔧 Initializing environment setup...");
169
+
170
+ global.require = (p) => {
171
+ if (p.includes('froth_common_actions/Utils')) return global.Util;
172
+ return module.constructor.prototype.require.call(this, p);
173
+ };
166
174
  },
167
175
 
168
176
  /**
@@ -365,10 +373,10 @@ const commonconfig = {
365
373
  // return;
366
374
  // }
367
375
 
368
- // const latestJson = path.join(jsonFolder, jsonFiles[0].name);
376
+ // const latestJson = path.join(jsonFolder, jsonFiles[0].name);
369
377
  //console.log(`🧩 Using JSON report: ${latestJson}`);
370
378
 
371
- // const reportGenerator = new HTMLReportGenerator(outputFilePath, jsonFolder);
379
+ // const reportGenerator = new HTMLReportGenerator(outputFilePath, jsonFolder);
372
380
 
373
381
  // Call your method (you can rename "generate" to whatever method your class exposes)
374
382
  // reportGenerator.generate({
@@ -381,7 +389,7 @@ const commonconfig = {
381
389
 
382
390
  console.log(`✅ HTML report generated: ${outputFilePath}`);
383
391
  // If you want to include historical data, specify the history JSON file path here.
384
- const historyFile = `./reports/${process.env.EXECUTION_ID}/history.json`; // Optional
392
+ const historyFile = `./reports/${process.env.EXECUTION_ID}/history.json`; // Optional
385
393
 
386
394
  // Optionally, generate aggregated history data before generating the HTML report.
387
395
  // JSONReporter.generateAggregateHistory({ reportPaths: jsonFolder, historyPath: historyFile });
@@ -0,0 +1,20 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const possiblePaths = [
5
+ path.resolve(process.cwd(), 'node_modules/froth-webdriverio-framework/froth_common_actions/Utils'),
6
+ path.resolve(process.cwd(), '../DEPENDENCY/node_modules/froth-webdriverio-framework/froth_common_actions/Utils'),
7
+ path.resolve(process.cwd(), '../../DEPENDENCY/node_modules/froth-webdriverio-framework/froth_common_actions/Utils'),
8
+ ];
9
+
10
+ for (const filePath of possiblePaths) {
11
+ if (fs.existsSync(filePath + '.js')) {
12
+ global.Util = require(filePath);
13
+ console.log(`✅ Global Util loaded from: ${filePath}`);
14
+ break;
15
+ }
16
+ }
17
+
18
+ if (!global.Util) {
19
+ console.error('❌ Could not load global Util from known paths');
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "5.0.9",
3
+ "version": "5.0.11",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",
@@ -26,13 +26,13 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@wdio/allure-reporter": "^9.20.0",
29
- "allure-commandline": "^2.34.1",
30
29
  "@wdio/appium-service": "^9.0.9",
31
30
  "@wdio/browserstack-service": "^9.0.9",
32
31
  "@wdio/cli": "^9.0.9",
33
32
  "@wdio/local-runner": "^9.0.9",
34
33
  "@wdio/mocha-framework": "^8.36.1",
35
34
  "@wdio/spec-reporter": "^8.36.1",
35
+ "allure-commandline": "^2.34.1",
36
36
  "appium": "^2.15.0",
37
37
  "appium-uiautomator2-driver": "^4.0.1",
38
38
  "assert": "^2.1.0",
@@ -43,6 +43,7 @@
43
43
  "deepmerge": "^4.3.1",
44
44
  "express": "^5.1.0",
45
45
  "form-data": "^4.0.0",
46
+ "froth-webdriverio-framework": "^5.0.10",
46
47
  "fs": "^0.0.1-security",
47
48
  "js-yaml": "^4.1.0",
48
49
  "mysql2": "^3.10.2",