artes 1.0.88 → 1.0.90

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 +370 -367
  2. package/cucumber.config.js +135 -136
  3. package/docs/functionDefinitions.md +2401 -2401
  4. package/docs/stepDefinitions.md +352 -352
  5. package/executer.js +111 -108
  6. package/index.js +46 -46
  7. package/package.json +50 -50
  8. package/src/helper/contextManager/browserManager.js +71 -71
  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 +80 -77
  13. package/src/helper/executers/projectCreator.js +165 -164
  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 -14
  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 +162 -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 -95
  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,136 +1,135 @@
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
- };
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) * 1000
41
+ : artesConfig.timeout * 1000 || 30 * 1000, // Default timeout in seconds
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
+ successReport: process.env.REPORT_SUCCESS ? true : artesConfig.reportSuccess || false, // Include successful tests in report
61
+ format: finalFormats, // Formatter names/paths
62
+ formatOptions: artesConfig.formatOptions || {
63
+ resultsDir: `allure-result`,
64
+ }, // Formatter options
65
+
66
+ // Execution options
67
+ parallel: process.env.PARALLEL
68
+ ? Number(process.env.PARALLEL)
69
+ : artesConfig.parallel || 1, // Number of parallel workers
70
+ dryRun: process.env.DRYRUN
71
+ ? process.env.DRYRUN
72
+ : artesConfig.dryRun || false, // Prepare test run without execution
73
+ failFast: artesConfig.failFast || false, // Stop on first test failure
74
+ forceExit: artesConfig.forceExit || false, // Force process.exit() after tests
75
+ strict: artesConfig.strict || true, // Fail on pending steps
76
+ backtrace: artesConfig.backtrace || false, // Show full backtrace for errors
77
+
78
+ // Filtering and organization
79
+ tags: process.env.RUN_TAGS
80
+ ? JSON.parse(process.env.RUN_TAGS)
81
+ : artesConfig.tags || artesConfig.tags || "", // Tag expression to filter scenarios
82
+ name: artesConfig.name || [], // Run scenarios matching regex
83
+ order: artesConfig.order || "defined", // Run order (defined/random)
84
+ language: artesConfig.language || "en", // Default feature file language
85
+
86
+ // Module loading
87
+ loader: artesConfig.loader || [], // Module loader specifications
88
+ requireModule: artesConfig.requireModule || [], // Transpilation module names
89
+
90
+ // Retry logic
91
+ retry: process.env.RETRY
92
+ ? Number(process.env.RETRY)
93
+ : artesConfig.retry || 0, // Retry attempts for failing tests
94
+ retryTagFilter: artesConfig.retryTagFilter || "", // Tag expression for retries
95
+
96
+ // Publishing
97
+ publish: artesConfig.publish || false, // Publish to cucumber.io
98
+
99
+ // World parameters
100
+ worldParameters: artesConfig.worldParameters || {}, // Custom world parameters
101
+ },
102
+ env: process.env.ENV ? JSON.parse(process.env.ENV) : artesConfig.env || "",
103
+ baseURL: process.env.BASE_URL
104
+ ? JSON.parse(process.env.BASE_URL)
105
+ : artesConfig?.baseURL
106
+ ? artesConfig?.baseURL
107
+ : "",
108
+
109
+ browser: {
110
+ browserType: process.env.BROWSER
111
+ ? JSON.parse(process.env.BROWSER)
112
+ : artesConfig?.browser || "chrome",
113
+ viewport: {
114
+ width: process.env.WIDTH
115
+ ? Number(process.env.WIDTH)
116
+ : artesConfig?.width || 1280,
117
+ height: process.env.HEIGHT
118
+ ? Number(process.env.HEIGHT)
119
+ : artesConfig?.height || 720,
120
+ },
121
+ maximizeScreen: process.env.MAXIMIZE_SCREEN
122
+ ? JSON.parse(process.env.MAXIMIZE_SCREEN)
123
+ : artesConfig?.maximizeScreen !== undefined
124
+ ? artesConfig.maximizeScreen
125
+ : true,
126
+ headless: process.env.MODE
127
+ ? JSON.parse(process.env.MODE)
128
+ : artesConfig?.headless !== undefined
129
+ ? artesConfig.headless
130
+ : true,
131
+ slowMo: process.env.SLOWMO
132
+ ? Number(process.env.SLOWMO) * 1000
133
+ : artesConfig?.slowMo * 1000 || 0
134
+ },
135
+ };