artes 1.0.86 → 1.0.88

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 +367 -366
  2. package/cucumber.config.js +136 -120
  3. package/docs/functionDefinitions.md +2401 -2401
  4. package/docs/stepDefinitions.md +352 -352
  5. package/executer.js +108 -106
  6. package/index.js +46 -46
  7. package/package.json +50 -50
  8. package/src/helper/contextManager/browserManager.js +71 -70
  9. package/src/helper/contextManager/requestManager.js +30 -30
  10. package/src/helper/executers/cleaner.js +19 -19
  11. package/src/helper/executers/exporter.js +15 -15
  12. package/src/helper/executers/helper.js +77 -74
  13. package/src/helper/executers/projectCreator.js +164 -163
  14. package/src/helper/executers/reportGenerator.js +25 -25
  15. package/src/helper/executers/testRunner.js +30 -30
  16. package/src/helper/executers/versionChecker.js +14 -13
  17. package/src/helper/imports/commons.js +52 -52
  18. package/src/helper/pomController/elementController.js +144 -144
  19. package/src/helper/pomController/pomCollector.js +20 -20
  20. package/src/helper/stepFunctions/APIActions.js +313 -313
  21. package/src/helper/stepFunctions/assertions.js +523 -523
  22. package/src/helper/stepFunctions/browserActions.js +21 -21
  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 +157 -157
  31. package/src/stepDefinitions/API.steps.js +252 -252
  32. package/src/stepDefinitions/assertions.steps.js +826 -826
  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 +95 -87
  36. package/src/stepDefinitions/mouseActions.steps.js +256 -256
  37. package/src/stepDefinitions/page.steps.js +71 -71
  38. package/src/stepDefinitions/random.steps.js +31 -31
@@ -1,120 +1,136 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const { moduleConfig } = require("./src/helper/imports/commons");
4
-
5
- let artesConfig = {};
6
-
7
- try {
8
- if (fs.existsSync(moduleConfig.cucumberConfigPath)) {
9
- const artesConf = require(moduleConfig.cucumberConfigPath);
10
- artesConfig = artesConf || {};
11
- }
12
- } catch (error) {
13
- console.warn("Error reading config file:", error.message);
14
- console.log("Proceeding with default config.");
15
- }
16
-
17
- module.exports = {
18
- default: {
19
- // File paths and patterns
20
- testPercentage: process.env.PERCENTAGE
21
- ? Number(process.env.PERCENTAGE)
22
- : artesConfig.testPercentage || 0, // number - Percentage of tests to run (0-100)
23
- timeout: process.env.TIMEOUT
24
- ? Number(process.env.TIMEOUT)
25
- : artesConfig.timeout || 30, // Default timeout in milliseconds
26
- paths: process.env.FEATURES
27
- ? [path.join(moduleConfig.projectPath, process.env.FEATURES)]
28
- : artesConfig.features
29
- ? path.join(moduleConfig.projectPath, artesConfig.features)
30
- : [moduleConfig.featuresPath], // Paths to feature files
31
- require: [
32
- artesConfig.steps
33
- ? path.join(moduleConfig.projectPath, artesConfig.steps)
34
- : moduleConfig.stepsPath,
35
- "src/stepDefinitions/*.js",
36
- "src/hooks/hooks.js",
37
- ], // Support code paths (CommonJS)
38
- pomPath: artesConfig.pomPath
39
- ? path.join(moduleConfig.projectPath, artesConfig.pomPath)
40
- : moduleConfig.pomPath,
41
- import: artesConfig.import || [], // Support code paths
42
-
43
- // Formatting and output
44
- format: process.env.REPORT_FORMAT
45
- ? JSON.parse(process.env.REPORT_FORMAT)
46
- : artesConfig.format || [
47
- "rerun:@rerun.txt",
48
- "allure-cucumberjs/reporter",
49
- ], // Formatter names/paths
50
- formatOptions: artesConfig.formatOptions || {
51
- resultsDir: `allure-result`,
52
- }, // Formatter options
53
-
54
- // Execution options
55
- parallel: process.env.PARALLEL
56
- ? Number(process.env.PARALLEL)
57
- : artesConfig.parallel || 1, // Number of parallel workers
58
- dryRun: process.env.DRYRUN
59
- ? process.env.DRYRUN
60
- : artesConfig.dryRun || false, // Prepare test run without execution
61
- failFast: artesConfig.failFast || false, // Stop on first test failure
62
- forceExit: artesConfig.forceExit || false, // Force process.exit() after tests
63
- strict: artesConfig.strict || true, // Fail on pending steps
64
- backtrace: artesConfig.backtrace || false, // Show full backtrace for errors
65
-
66
- // Filtering and organization
67
- tags: process.env.RUN_TAGS
68
- ? JSON.parse(process.env.RUN_TAGS)
69
- : artesConfig.tags || artesConfig.tags || "", // Tag expression to filter scenarios
70
- name: artesConfig.name || [], // Run scenarios matching regex
71
- order: artesConfig.order || "defined", // Run order (defined/random)
72
- language: artesConfig.language || "en", // Default feature file language
73
-
74
- // Module loading
75
- loader: artesConfig.loader || [], // Module loader specifications
76
- requireModule: artesConfig.requireModule || [], // Transpilation module names
77
-
78
- // Retry logic
79
- retry: process.env.RETRY
80
- ? Number(process.env.RETRY)
81
- : artesConfig.retry || 0, // Retry attempts for failing tests
82
- retryTagFilter: artesConfig.retryTagFilter || "", // Tag expression for retries
83
-
84
- // Publishing
85
- publish: artesConfig.publish || false, // Publish to cucumber.io
86
-
87
- // World parameters
88
- worldParameters: artesConfig.worldParameters || {}, // Custom world parameters
89
- },
90
- env: process.env.ENV ? JSON.parse(process.env.ENV) : artesConfig.env || "",
91
- baseURL: process.env.BASE_URL
92
- ? JSON.parse(process.env.BASE_URL)
93
- : artesConfig?.baseURL
94
- ? artesConfig?.baseURL
95
- : "",
96
-
97
- browser: {
98
- browserType: process.env.BROWSER
99
- ? JSON.parse(process.env.BROWSER)
100
- : artesConfig?.browser || "chrome",
101
- viewport: {
102
- width: process.env.WIDTH
103
- ? Number(process.env.WIDTH)
104
- : artesConfig?.width || 1280,
105
- height: process.env.HEIGHT
106
- ? Number(process.env.HEIGHT)
107
- : artesConfig?.height || 720,
108
- },
109
- maximizeScreen: process.env.MAXIMIZE_SCREEN
110
- ? JSON.parse(process.env.MAXIMIZE_SCREEN)
111
- : artesConfig?.maximizeScreen !== undefined
112
- ? artesConfig.maximizeScreen
113
- : true,
114
- headless: process.env.MODE
115
- ? JSON.parse(process.env.MODE)
116
- : artesConfig?.headless !== undefined
117
- ? artesConfig.headless
118
- : true,
119
- },
120
- };
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const { moduleConfig } = require("./src/helper/imports/commons");
4
+
5
+ let artesConfig = {};
6
+
7
+ try {
8
+ if (fs.existsSync(moduleConfig.cucumberConfigPath)) {
9
+ const artesConf = require(moduleConfig.cucumberConfigPath);
10
+ artesConfig = artesConf || {};
11
+ }
12
+ } catch (error) {
13
+ console.warn("Error reading config file:", error.message);
14
+ console.log("Proceeding with default config.");
15
+ }
16
+
17
+ const defaultFormats = [
18
+ "rerun:@rerun.txt",
19
+ "progress-bar"];
20
+
21
+ const userFormatsFromEnv = process.env.REPORT_FORMAT
22
+ ? JSON.parse(process.env.REPORT_FORMAT)
23
+ : [];
24
+
25
+ const userFormatsFromConfig = artesConfig.format || [];
26
+
27
+ const finalFormats = [...new Set([
28
+ ...defaultFormats,
29
+ ...userFormatsFromEnv,
30
+ ...userFormatsFromConfig,
31
+ ])];
32
+
33
+ module.exports = {
34
+ default: {
35
+ // File paths and patterns
36
+ testPercentage: process.env.PERCENTAGE
37
+ ? Number(process.env.PERCENTAGE)
38
+ : artesConfig.testPercentage || 0, // number - Percentage of tests to run (0-100)
39
+ timeout: process.env.TIMEOUT
40
+ ? Number(process.env.TIMEOUT)
41
+ : artesConfig.timeout || 30, // Default timeout in milliseconds
42
+ paths: process.env.FEATURES
43
+ ? [path.join(moduleConfig.projectPath, process.env.FEATURES)]
44
+ : artesConfig.features
45
+ ? path.join(moduleConfig.projectPath, artesConfig.features)
46
+ : [moduleConfig.featuresPath], // Paths to feature files
47
+ require: [
48
+ artesConfig.steps
49
+ ? path.join(moduleConfig.projectPath, artesConfig.steps)
50
+ : moduleConfig.stepsPath,
51
+ "src/stepDefinitions/*.js",
52
+ "src/hooks/hooks.js",
53
+ ], // Support code paths (CommonJS)
54
+ pomPath: artesConfig.pomPath
55
+ ? path.join(moduleConfig.projectPath, artesConfig.pomPath)
56
+ : moduleConfig.pomPath,
57
+ import: artesConfig.import || [], // Support code paths
58
+
59
+ // Formatting and output
60
+ format: finalFormats, // Formatter names/paths
61
+ formatOptions: artesConfig.formatOptions || {
62
+ resultsDir: `allure-result`,
63
+ }, // Formatter options
64
+
65
+ // Execution options
66
+ parallel: process.env.PARALLEL
67
+ ? Number(process.env.PARALLEL)
68
+ : artesConfig.parallel || 1, // Number of parallel workers
69
+ dryRun: process.env.DRYRUN
70
+ ? process.env.DRYRUN
71
+ : artesConfig.dryRun || false, // Prepare test run without execution
72
+ failFast: artesConfig.failFast || false, // Stop on first test failure
73
+ forceExit: artesConfig.forceExit || false, // Force process.exit() after tests
74
+ strict: artesConfig.strict || true, // Fail on pending steps
75
+ backtrace: artesConfig.backtrace || false, // Show full backtrace for errors
76
+
77
+ // Filtering and organization
78
+ tags: process.env.RUN_TAGS
79
+ ? JSON.parse(process.env.RUN_TAGS)
80
+ : artesConfig.tags || artesConfig.tags || "", // Tag expression to filter scenarios
81
+ name: artesConfig.name || [], // Run scenarios matching regex
82
+ order: artesConfig.order || "defined", // Run order (defined/random)
83
+ language: artesConfig.language || "en", // Default feature file language
84
+
85
+ // Module loading
86
+ loader: artesConfig.loader || [], // Module loader specifications
87
+ requireModule: artesConfig.requireModule || [], // Transpilation module names
88
+
89
+ // Retry logic
90
+ retry: process.env.RETRY
91
+ ? Number(process.env.RETRY)
92
+ : artesConfig.retry || 0, // Retry attempts for failing tests
93
+ retryTagFilter: artesConfig.retryTagFilter || "", // Tag expression for retries
94
+
95
+ // Publishing
96
+ publish: artesConfig.publish || false, // Publish to cucumber.io
97
+
98
+ // World parameters
99
+ worldParameters: artesConfig.worldParameters || {}, // Custom world parameters
100
+ },
101
+ env: process.env.ENV ? JSON.parse(process.env.ENV) : artesConfig.env || "",
102
+ baseURL: process.env.BASE_URL
103
+ ? JSON.parse(process.env.BASE_URL)
104
+ : artesConfig?.baseURL
105
+ ? artesConfig?.baseURL
106
+ : "",
107
+
108
+ browser: {
109
+ browserType: process.env.BROWSER
110
+ ? JSON.parse(process.env.BROWSER)
111
+ : artesConfig?.browser || "chrome",
112
+ viewport: {
113
+ width: process.env.WIDTH
114
+ ? Number(process.env.WIDTH)
115
+ : artesConfig?.width || 1280,
116
+ height: process.env.HEIGHT
117
+ ? Number(process.env.HEIGHT)
118
+ : artesConfig?.height || 720,
119
+ },
120
+ maximizeScreen: process.env.MAXIMIZE_SCREEN
121
+ ? JSON.parse(process.env.MAXIMIZE_SCREEN)
122
+ : artesConfig?.maximizeScreen !== undefined
123
+ ? artesConfig.maximizeScreen
124
+ : true,
125
+ headless: process.env.MODE
126
+ ? JSON.parse(process.env.MODE)
127
+ : artesConfig?.headless !== undefined
128
+ ? artesConfig.headless
129
+ : true,
130
+ slowMo: process.env.SLOWMO
131
+ ? Number(process.env.SLOWMO)
132
+ : artesConfig?.slowMo !== undefined
133
+ ? artesConfig.slowMo
134
+ : 0,
135
+ },
136
+ };