froth-webdriverio-framework 5.0.11 → 5.0.12
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.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Function to verify text in Android app
|
|
2
|
-
import assert from 'assert';
|
|
2
|
+
//import assert from 'assert';
|
|
3
|
+
const assert=require("assert");
|
|
4
|
+
|
|
3
5
|
const amendToBrowserstack = require("../froth_api_calls/browsersatckSessionInfo").amend2Browserstack;
|
|
4
6
|
|
|
5
7
|
async function assertText(elementSelector, expectedText) {
|
|
@@ -9,7 +9,7 @@ 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('
|
|
12
|
+
global.Util = require('./globalUtilShim');
|
|
13
13
|
|
|
14
14
|
let Util;
|
|
15
15
|
|
|
@@ -6,15 +6,29 @@ const possiblePaths = [
|
|
|
6
6
|
path.resolve(process.cwd(), '../DEPENDENCY/node_modules/froth-webdriverio-framework/froth_common_actions/Utils'),
|
|
7
7
|
path.resolve(process.cwd(), '../../DEPENDENCY/node_modules/froth-webdriverio-framework/froth_common_actions/Utils'),
|
|
8
8
|
];
|
|
9
|
+
let loaded = false;
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
for (const filePath of possiblePaths) {
|
|
11
13
|
if (fs.existsSync(filePath + '.js')) {
|
|
12
14
|
global.Util = require(filePath);
|
|
13
15
|
console.log(`✅ Global Util loaded from: ${filePath}`);
|
|
16
|
+
loaded = true;
|
|
14
17
|
break;
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
if (!
|
|
19
|
-
|
|
21
|
+
if (!loaded) {
|
|
22
|
+
try {
|
|
23
|
+
// fallback to node_modules package (cloud CI)
|
|
24
|
+
global.Util = require('froth-webdriverio-framework/froth_common_actions/Utils');
|
|
25
|
+
console.log('✅ Global Util loaded from npm package');
|
|
26
|
+
loaded = true;
|
|
27
|
+
} catch (err) {
|
|
28
|
+
console.error('❌ Could not load froth_common_actions/Utils from known paths or npm package');
|
|
29
|
+
throw err;
|
|
30
|
+
}
|
|
20
31
|
}
|
|
32
|
+
console.log("global Util loaded from:", global.Util && global.Util.constructor.name);
|
|
33
|
+
|
|
34
|
+
module.exports = global.Util;
|