froth-webdriverio-framework 4.0.21 → 4.0.23
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.
- package/froth_configs/commonconfig.js +15 -16
- package/package.json +2 -3
- package/eslint.config.mjs +0 -9
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const { ESLint } = require("eslint");
|
|
3
2
|
const { LocalStorage } = require('node-localstorage');
|
|
4
3
|
global.BUFFER = new LocalStorage('./storage');
|
|
5
4
|
global.suite_info = null;
|
|
@@ -41,27 +40,27 @@ const commonconfig = {
|
|
|
41
40
|
|
|
42
41
|
beforeSession: async function (config, capabilities, specs) {
|
|
43
42
|
try {
|
|
44
|
-
const eslint = new ESLint();
|
|
45
43
|
let syntaxFailed = false;
|
|
46
|
-
|
|
44
|
+
|
|
47
45
|
console.log('==== BEFORE SESSION HOOK ====');
|
|
48
46
|
// Perform any setup or pre-test actions here
|
|
49
47
|
console.log("specdat:", specs);
|
|
50
48
|
console.log("length:", specs.length);
|
|
51
49
|
for (const fileUrl of specs) {
|
|
52
|
-
const filePath =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
const filePath = url.fileURLToPath(fileUrl); // convert file:// URL to file path
|
|
51
|
+
try {
|
|
52
|
+
const code = fs.readFileSync(filePath, 'utf8');
|
|
53
|
+
new Function(code); // Try to compile
|
|
54
|
+
} catch (err) {
|
|
55
|
+
// Extract line number from stack trace
|
|
56
|
+
const match = err.stack.match(/\((.*):(\d+):(\d+)\)/);
|
|
57
|
+
const lineInfo = match ? ` at line ${match[2]}, column ${match[3]}` : '';
|
|
58
|
+
|
|
59
|
+
const errorMsg = `❌ Syntax error in '${path.basename(filePath)}'${lineInfo}: ${err.message}`;
|
|
60
|
+
console.error("🚨", errorMsg);
|
|
61
|
+
resultdetails.comments.push(errorMsg);
|
|
62
|
+
syntaxFailed = true;
|
|
63
|
+
}
|
|
65
64
|
}
|
|
66
65
|
if (syntaxFailed) {
|
|
67
66
|
resultdetails.excution_status = 'FAILED';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "froth-webdriverio-framework",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.23",
|
|
4
4
|
"readme": "WebdriverIO Integration",
|
|
5
5
|
"description": "WebdriverIO and BrowserStack App Automate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"node-localstorage": "^3.0.5",
|
|
48
48
|
"randexp": "^0.5.3",
|
|
49
49
|
"ts-node": "^10.9.2",
|
|
50
|
-
"typescript": "^5.4.5"
|
|
51
|
-
"eslint": "^9.24.0"
|
|
50
|
+
"typescript": "^5.4.5"
|
|
52
51
|
}
|
|
53
52
|
}
|
package/eslint.config.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "eslint/config";
|
|
2
|
-
import js from "@eslint/js";
|
|
3
|
-
import globals from "globals";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default defineConfig([
|
|
7
|
-
{ files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"] },
|
|
8
|
-
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.browser } },
|
|
9
|
-
]);
|