artes 1.2.17 → 1.2.18

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 (38) hide show
  1. package/README.md +629 -629
  2. package/cucumber.config.js +171 -171
  3. package/docs/functionDefinitions.md +2401 -2401
  4. package/docs/stepDefinitions.md +391 -391
  5. package/executer.js +161 -161
  6. package/index.js +48 -48
  7. package/package.json +52 -51
  8. package/src/helper/contextManager/browserManager.js +63 -63
  9. package/src/helper/contextManager/requestManager.js +23 -23
  10. package/src/helper/controller/elementController.js +182 -182
  11. package/src/helper/controller/pomCollector.js +25 -25
  12. package/src/helper/executers/cleaner.js +19 -19
  13. package/src/helper/executers/exporter.js +15 -15
  14. package/src/helper/executers/helper.js +95 -95
  15. package/src/helper/executers/projectCreator.js +198 -198
  16. package/src/helper/executers/reportGenerator.js +58 -58
  17. package/src/helper/executers/testRunner.js +30 -30
  18. package/src/helper/executers/versionChecker.js +31 -31
  19. package/src/helper/imports/commons.js +56 -56
  20. package/src/helper/stepFunctions/APIActions.js +362 -362
  21. package/src/helper/stepFunctions/assertions.js +523 -523
  22. package/src/helper/stepFunctions/browserActions.js +22 -22
  23. package/src/helper/stepFunctions/elementInteractions.js +38 -38
  24. package/src/helper/stepFunctions/exporter.js +19 -19
  25. package/src/helper/stepFunctions/frameActions.js +50 -50
  26. package/src/helper/stepFunctions/keyboardActions.js +41 -41
  27. package/src/helper/stepFunctions/mouseActions.js +145 -145
  28. package/src/helper/stepFunctions/pageActions.js +27 -27
  29. package/src/hooks/context.js +15 -15
  30. package/src/hooks/hooks.js +257 -257
  31. package/src/stepDefinitions/API.steps.js +299 -299
  32. package/src/stepDefinitions/assertions.steps.js +861 -861
  33. package/src/stepDefinitions/browser.steps.js +7 -7
  34. package/src/stepDefinitions/frameActions.steps.js +76 -76
  35. package/src/stepDefinitions/keyboardActions.steps.js +226 -226
  36. package/src/stepDefinitions/mouseActions.steps.js +275 -275
  37. package/src/stepDefinitions/page.steps.js +71 -71
  38. package/src/stepDefinitions/random.steps.js +158 -158
@@ -1,58 +1,58 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const archiver = require("archiver");
4
- const { spawnSync } = require("child_process");
5
- const { moduleConfig } = require("../imports/commons");
6
-
7
- function generateReport() {
8
-
9
- try {
10
- console.log("📊 Generating report...");
11
-
12
- spawnSync("allure", [ "generate", "--clean", `${process.env.SINGLE_FILE_REPORT == "true" ? "--single-file" : "" }`, "allure-result", "--output", moduleConfig.reportPath], {
13
- cwd: moduleConfig.modulePath,
14
- stdio: "ignore",
15
- shell: true,
16
- });
17
-
18
- console.log(`📋 Report generated successfully in ${moduleConfig.reportPath}!`);
19
-
20
- if (fs.existsSync(moduleConfig.reportPath) && process.env.ZIP) {
21
- console.log(`🗜️ Zipping report folder`);
22
-
23
- const zipPath = path.join(path.dirname(moduleConfig.reportPath), "report.zip");
24
-
25
- let done = false;
26
- let error = null;
27
-
28
- const output = fs.createWriteStream(zipPath);
29
- const archive = archiver("zip", { zlib: { level: 9 } });
30
-
31
- output.on("close", () => {
32
- done = true;
33
- });
34
-
35
- archive.on("error", (err) => {
36
- error = err;
37
- done = true;
38
- });
39
-
40
- archive.pipe(output);
41
- archive.directory(moduleConfig.reportPath, false);
42
- archive.finalize();
43
-
44
- require("deasync").loopWhile(() => !done);
45
-
46
- console.log(`🗜️ Zipped in ${moduleConfig.reportPath}/report.zip!`);
47
- if (error) throw error;
48
- } else {
49
- console.warn(`⚠️ Report folder does not exist: ${moduleConfig.reportPath}`);
50
- }
51
-
52
- } catch (err) {
53
- console.error("❌ Report generation failed:", err);
54
- process.env.EXIT_CODE = 1;
55
- }
56
- }
57
-
58
- module.exports = { generateReport };
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const archiver = require("archiver");
4
+ const { spawnSync } = require("child_process");
5
+ const { moduleConfig } = require("../imports/commons");
6
+
7
+ function generateReport() {
8
+
9
+ try {
10
+ console.log("📊 Generating report...");
11
+
12
+ spawnSync("allure", [ "generate", "--clean", `${process.env.SINGLE_FILE_REPORT == "true" ? "--single-file" : "" }`, "allure-result", "--output", moduleConfig.reportPath], {
13
+ cwd: moduleConfig.modulePath,
14
+ stdio: "ignore",
15
+ shell: true,
16
+ });
17
+
18
+ console.log(`📋 Report generated successfully in ${moduleConfig.reportPath}!`);
19
+
20
+ if (fs.existsSync(moduleConfig.reportPath) && process.env.ZIP) {
21
+ console.log(`🗜️ Zipping report folder`);
22
+
23
+ const zipPath = path.join(path.dirname(moduleConfig.reportPath), "report.zip");
24
+
25
+ let done = false;
26
+ let error = null;
27
+
28
+ const output = fs.createWriteStream(zipPath);
29
+ const archive = archiver("zip", { zlib: { level: 9 } });
30
+
31
+ output.on("close", () => {
32
+ done = true;
33
+ });
34
+
35
+ archive.on("error", (err) => {
36
+ error = err;
37
+ done = true;
38
+ });
39
+
40
+ archive.pipe(output);
41
+ archive.directory(moduleConfig.reportPath, false);
42
+ archive.finalize();
43
+
44
+ require("deasync").loopWhile(() => !done);
45
+
46
+ console.log(`🗜️ Zipped in ${moduleConfig.reportPath}/report.zip!`);
47
+ if (error) throw error;
48
+ } else {
49
+ console.warn(`⚠️ Report folder does not exist: ${moduleConfig.reportPath}`);
50
+ }
51
+
52
+ } catch (err) {
53
+ console.error("❌ Report generation failed:", err);
54
+ process.env.EXIT_CODE = 1;
55
+ }
56
+ }
57
+
58
+ module.exports = { generateReport };
@@ -1,30 +1,30 @@
1
- const { spawnSync } = require("child_process");
2
- const { moduleConfig } = require("../imports/commons");
3
-
4
- function runTests() {
5
- try {
6
- console.log("🧪 Running tests...");
7
- process.env.FORCE_COLOR = "1";
8
- process.env.FORCE_STDIO_TTY = "1";
9
-
10
- spawnSync("cucumber-js", ["--config=cucumber.config.js"], {
11
- cwd: moduleConfig.modulePath,
12
- stdio: "inherit",
13
- shell: true,
14
- env: {
15
- ...process.env,
16
- FORCE_TTY: "1",
17
- FORCE_COLOR: "1",
18
- CI: "false",
19
- },
20
- });
21
- console.log("✅ Tests running completed successfully!");
22
- } catch (error) {
23
- console.error("❌ Test execution failed:", error);
24
- process.env.EXIT_CODE = 1;
25
- }
26
- }
27
-
28
- module.exports = {
29
- runTests,
30
- };
1
+ const { spawnSync } = require("child_process");
2
+ const { moduleConfig } = require("../imports/commons");
3
+
4
+ function runTests() {
5
+ try {
6
+ console.log("🧪 Running tests...");
7
+ process.env.FORCE_COLOR = "1";
8
+ process.env.FORCE_STDIO_TTY = "1";
9
+
10
+ spawnSync("cucumber-js", ["--config=cucumber.config.js"], {
11
+ cwd: moduleConfig.modulePath,
12
+ stdio: "inherit",
13
+ shell: true,
14
+ env: {
15
+ ...process.env,
16
+ FORCE_TTY: "1",
17
+ FORCE_COLOR: "1",
18
+ CI: "false",
19
+ },
20
+ });
21
+ console.log("✅ Tests running completed successfully!");
22
+ } catch (error) {
23
+ console.error("❌ Test execution failed:", error);
24
+ process.env.EXIT_CODE = 1;
25
+ }
26
+ }
27
+
28
+ module.exports = {
29
+ runTests,
30
+ };
@@ -1,31 +1,31 @@
1
- const { execSync } = require("child_process");
2
- const path = require("path");
3
- const fs = require("fs");
4
-
5
- function showVersion() {
6
- try {
7
- const localPath = path.join(
8
- process.cwd(),
9
- "node_modules",
10
- "artes",
11
- "package.json",
12
- );
13
- const localData = fs.readFileSync(localPath, "utf8");
14
- const localArtes = JSON.parse(localData);
15
- console.log(`ARTES Version: ${localArtes.version}`);
16
- return;
17
- } catch (err) {}
18
-
19
- try {
20
- const globalRoot = execSync("npm root -g").toString().trim();
21
- const globalPath = path.join(globalRoot, "artes", "package.json");
22
- const globalData = fs.readFileSync(globalPath, "utf8");
23
- const globalArtes = JSON.parse(globalData);
24
- console.log(`ARTES Version: ${globalArtes.version}`);
25
- return;
26
- } catch (err) {}
27
- }
28
-
29
- module.exports = {
30
- showVersion,
31
- };
1
+ const { execSync } = require("child_process");
2
+ const path = require("path");
3
+ const fs = require("fs");
4
+
5
+ function showVersion() {
6
+ try {
7
+ const localPath = path.join(
8
+ process.cwd(),
9
+ "node_modules",
10
+ "artes",
11
+ "package.json",
12
+ );
13
+ const localData = fs.readFileSync(localPath, "utf8");
14
+ const localArtes = JSON.parse(localData);
15
+ console.log(`ARTES Version: ${localArtes.version}`);
16
+ return;
17
+ } catch (err) {}
18
+
19
+ try {
20
+ const globalRoot = execSync("npm root -g").toString().trim();
21
+ const globalPath = path.join(globalRoot, "artes", "package.json");
22
+ const globalData = fs.readFileSync(globalPath, "utf8");
23
+ const globalArtes = JSON.parse(globalData);
24
+ console.log(`ARTES Version: ${globalArtes.version}`);
25
+ return;
26
+ } catch (err) {}
27
+ }
28
+
29
+ module.exports = {
30
+ showVersion,
31
+ };
@@ -1,56 +1,56 @@
1
- const { expect } = require("playwright/test");
2
- const { Given, When, Then } = require("@cucumber/cucumber");
3
- const {
4
- getElement,
5
- getSelector,
6
- extractVarsFromResponse,
7
- saveVar,
8
- resolveVariable,
9
- } = require("../controller/elementController");
10
- const { context } = require("../../hooks/context");
11
-
12
- const { faker } = require("@faker-js/faker");
13
- const dayjs = require("dayjs");
14
-
15
- const element = getElement;
16
- const selector = getSelector;
17
- const page = context.page;
18
- const request = context.request;
19
-
20
- const random = faker;
21
- const time = dayjs;
22
-
23
- const path = require("path");
24
- const modulePath = process.cwd();
25
- const projectPath = modulePath.split(/[/\\]/).slice(0, -2).join("/");
26
-
27
- const moduleConfig = {
28
- projectPath: projectPath,
29
- modulePackageJsonPath: path.join(modulePath, "/package.json"),
30
- modulePath: path.join(modulePath, "/node_modules/artes"),
31
- reportPath: path.join(modulePath, "/report"),
32
- tracerPath: path.join(projectPath, "/trace.zip"),
33
- cucumberConfigPath: path.join(projectPath, "/artes.config.js"),
34
- featuresPath: path.join(projectPath, "/tests/features/"),
35
- stepsPath: path.join(projectPath, "/tests/steps/*.js"),
36
- pomPath: path.join(projectPath, "/tests/POMs"),
37
- cleanUpPaths: "allure-result allure-results test-results @rerun.txt testsStatus EXIT_CODE.txt",
38
- };
39
-
40
- module.exports = {
41
- expect,
42
- Given,
43
- When,
44
- Then,
45
- element,
46
- selector,
47
- extractVarsFromResponse,
48
- saveVar,
49
- resolveVariable,
50
- random,
51
- time,
52
- page,
53
- request,
54
- context,
55
- moduleConfig,
56
- };
1
+ const { expect } = require("playwright/test");
2
+ const { Given, When, Then } = require("@cucumber/cucumber");
3
+ const {
4
+ getElement,
5
+ getSelector,
6
+ extractVarsFromResponse,
7
+ saveVar,
8
+ resolveVariable,
9
+ } = require("../controller/elementController");
10
+ const { context } = require("../../hooks/context");
11
+
12
+ const { faker } = require("@faker-js/faker");
13
+ const dayjs = require("dayjs");
14
+
15
+ const element = getElement;
16
+ const selector = getSelector;
17
+ const page = context.page;
18
+ const request = context.request;
19
+
20
+ const random = faker;
21
+ const time = dayjs;
22
+
23
+ const path = require("path");
24
+ const modulePath = process.cwd();
25
+ const projectPath = modulePath.split(/[/\\]/).slice(0, -2).join("/");
26
+
27
+ const moduleConfig = {
28
+ projectPath: projectPath,
29
+ modulePackageJsonPath: path.join(modulePath, "/package.json"),
30
+ modulePath: path.join(modulePath, "/node_modules/artes"),
31
+ reportPath: path.join(modulePath, "/report"),
32
+ tracerPath: path.join(projectPath, "/trace.zip"),
33
+ cucumberConfigPath: path.join(projectPath, "/artes.config.js"),
34
+ featuresPath: path.join(projectPath, "/tests/features/"),
35
+ stepsPath: path.join(projectPath, "/tests/steps/*.js"),
36
+ pomPath: path.join(projectPath, "/tests/POMs"),
37
+ cleanUpPaths: "allure-result allure-results test-results @rerun.txt testsStatus EXIT_CODE.txt",
38
+ };
39
+
40
+ module.exports = {
41
+ expect,
42
+ Given,
43
+ When,
44
+ Then,
45
+ element,
46
+ selector,
47
+ extractVarsFromResponse,
48
+ saveVar,
49
+ resolveVariable,
50
+ random,
51
+ time,
52
+ page,
53
+ request,
54
+ context,
55
+ moduleConfig,
56
+ };