@zeesoft/i18n-verify 3.2.1 → 3.2.3
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/dist/executor.mjs +2320 -1762
- package/dist/genrc.mjs +19 -9
- package/dist/index.mjs +40 -27
- package/package.json +8 -6
- package/postinstall.js +21 -0
- package/dist/executor.cjs +0 -3612
- package/dist/genrc.cjs +0 -1
- package/dist/index.cjs +0 -1
package/dist/genrc.mjs
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { g as getRootProjectMainDir, a as getRootProjectPackageJson, c as checkAndExportConfig, j as joinPaths, b as CONFIG_FILE_NAME, S as SYSTEM_TYPES } from "./executor.mjs";
|
|
2
|
+
const projectDir = getRootProjectMainDir();
|
|
3
|
+
const packageJson = getRootProjectPackageJson(projectDir);
|
|
4
|
+
let type = "";
|
|
5
|
+
if (packageJson) {
|
|
6
|
+
const json = JSON.parse(packageJson);
|
|
7
|
+
const dependencies = JSON.stringify({
|
|
8
|
+
...json?.dependencies || {},
|
|
9
|
+
...json?.devDependencies || {}
|
|
8
10
|
});
|
|
9
|
-
|
|
11
|
+
if (dependencies.includes('"nightwatch"')) {
|
|
12
|
+
type = SYSTEM_TYPES.NIGHT_WATCH;
|
|
13
|
+
} else if (dependencies.includes('"cypress"')) {
|
|
14
|
+
type = SYSTEM_TYPES.CYPRESS;
|
|
15
|
+
} else if (dependencies.includes('"selenium-webdriver"')) {
|
|
16
|
+
type = SYSTEM_TYPES.SELENIUMJS;
|
|
17
|
+
} else if (dependencies.includes('"@wdio"') || dependencies.includes("@wdio")) {
|
|
18
|
+
type = SYSTEM_TYPES.WEB_DRIVER_IO;
|
|
19
|
+
}
|
|
10
20
|
}
|
|
11
|
-
|
|
21
|
+
checkAndExportConfig(joinPaths(projectDir, CONFIG_FILE_NAME), type);
|
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,46 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { C as Config, L as Logger, S as SYSTEM_TYPES, l as loadDependencies, R as Reports, E as Executor } from "./executor.mjs";
|
|
2
|
+
const logger = Logger;
|
|
3
|
+
const systems = SYSTEM_TYPES;
|
|
4
|
+
const setRuntime = (driver) => {
|
|
5
|
+
Config.setDriver(driver);
|
|
6
|
+
loadDependencies();
|
|
7
|
+
};
|
|
8
|
+
const setLocale = (locale) => {
|
|
9
|
+
Config.setLocale(locale);
|
|
10
|
+
Config.setIsLoaded(false);
|
|
11
|
+
loadDependencies();
|
|
12
|
+
};
|
|
13
|
+
const genReportTable = () => {
|
|
14
|
+
Reports.generateAsciiTable();
|
|
15
|
+
Reports.generateHtml();
|
|
16
|
+
};
|
|
17
|
+
const getLocale = () => {
|
|
18
|
+
return Config.getLocale();
|
|
19
|
+
};
|
|
20
|
+
const verify = async ({
|
|
21
|
+
verificationArea,
|
|
22
|
+
staticLocators,
|
|
23
|
+
useSmartSelector,
|
|
24
|
+
description
|
|
13
25
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
26
|
+
const executor = Config.getExecutor();
|
|
27
|
+
if (!executor || !(executor instanceof Executor)) {
|
|
16
28
|
throw new Error("Executor is missing, make sure to set configuration");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
}
|
|
30
|
+
await executor.start({
|
|
31
|
+
verificationArea,
|
|
32
|
+
staticLocators,
|
|
33
|
+
useSmartSelector,
|
|
34
|
+
description
|
|
22
35
|
});
|
|
23
36
|
};
|
|
24
|
-
|
|
37
|
+
Config.init();
|
|
25
38
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
genReportTable,
|
|
40
|
+
getLocale,
|
|
41
|
+
logger,
|
|
42
|
+
setLocale,
|
|
43
|
+
setRuntime,
|
|
44
|
+
systems,
|
|
45
|
+
verify
|
|
33
46
|
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeesoft/i18n-verify",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Library to perform I18n verification on Nightwatch, WebdriverIO or Selenium framework projects",
|
|
5
|
-
"main": "dist/index.
|
|
5
|
+
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.mjs",
|
|
11
|
-
"require": "./dist/index.
|
|
11
|
+
"require": "./dist/index.mjs"
|
|
12
12
|
},
|
|
13
13
|
"./genrc": {
|
|
14
14
|
"import": "./dist/genrc.mjs",
|
|
15
|
-
"require": "./dist/genrc.
|
|
15
|
+
"require": "./dist/genrc.mjs"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
@@ -58,12 +58,14 @@
|
|
|
58
58
|
"luxon": "^3.4.4"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
62
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
61
63
|
"@types/nightwatch": "^2.3.31",
|
|
62
64
|
"@types/node": "^22.10.1",
|
|
63
65
|
"@types/selenium-webdriver": "^4.1.26",
|
|
64
66
|
"@wdio/types": "^9.0.8",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
+
"rimraf": "^6.0.1",
|
|
68
|
+
"vite": "^5.4.8"
|
|
67
69
|
},
|
|
68
70
|
"repository": {
|
|
69
71
|
"type": "git",
|
package/postinstall.js
CHANGED
|
@@ -25,4 +25,25 @@ projects automation framework. Please modify it as needed.
|
|
|
25
25
|
Documentation: https://www.npmjs.com/package/@zeesoft/i18n-verify
|
|
26
26
|
Gitlab: https://gitlab.com/zeesoft/qa
|
|
27
27
|
===============================================================================`);
|
|
28
|
+
|
|
29
|
+
// fix TLA issue in eld/languageDetector.js package
|
|
30
|
+
const fs = await moduleLoader('fs');
|
|
31
|
+
const path = await moduleLoader('path');
|
|
32
|
+
const filePath = path.join(
|
|
33
|
+
process.cwd(),
|
|
34
|
+
'..',
|
|
35
|
+
'..',
|
|
36
|
+
'eld',
|
|
37
|
+
'src',
|
|
38
|
+
'languageDetector.js'
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
if (fs.existsSync(filePath)) {
|
|
42
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
43
|
+
const updatedContent = content.replace(
|
|
44
|
+
/await loadNgrams\('ngramsM60\.js'\)/m,
|
|
45
|
+
"(async () => { await loadNgrams('ngramsM60.js'); })()"
|
|
46
|
+
);
|
|
47
|
+
fs.writeFileSync(filePath, updatedContent, 'utf8');
|
|
48
|
+
}
|
|
28
49
|
})();
|