artes 1.1.31 → 1.1.33

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 +458 -458
  2. package/cucumber.config.js +162 -162
  3. package/docs/functionDefinitions.md +2401 -2401
  4. package/docs/stepDefinitions.md +352 -352
  5. package/executer.js +162 -162
  6. package/index.js +48 -48
  7. package/package.json +54 -54
  8. package/src/helper/contextManager/browserManager.js +68 -68
  9. package/src/helper/contextManager/requestManager.js +28 -28
  10. package/src/helper/controller/elementController.js +157 -157
  11. package/src/helper/controller/pomCollector.js +24 -24
  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 +89 -89
  15. package/src/helper/executers/projectCreator.js +168 -168
  16. package/src/helper/executers/reportGenerator.js +25 -25
  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 +57 -57
  20. package/src/helper/stepFunctions/APIActions.js +358 -298
  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 +216 -216
  31. package/src/stepDefinitions/API.steps.js +292 -247
  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 +89 -68
@@ -1,256 +1,256 @@
1
- const { When } = require("../helper/imports/commons");
2
- const { mouse, frame } = require("../helper/stepFunctions/exporter");
3
-
4
- // User clicks on a selector
5
- When("User clicks {string}", async function (selector) {
6
- await mouse.click(selector);
7
- });
8
-
9
- When("User clicks last of {string}", async (selector) => {
10
- const elementCount = await frame.count(selector);
11
- const lastElement = await frame.nth(selector, elementCount);
12
- await mouse.click(lastElement);
13
- });
14
-
15
- When("User clicks {int} th of {string}", async (order, elements) => {
16
- const nthElement = await frame.nth(elements, order);
17
- await nthElement.click();
18
- });
19
-
20
- When("User clicks multiple {string}", async (elements) => {
21
- await mouse.multipleElementClick(elements);
22
- });
23
-
24
- // User clicks on a selector with force
25
- When("User clicks {string} with force", async function (selector) {
26
- await mouse.click(selector, true);
27
- });
28
-
29
- // User clicks on a selector at a specific position
30
- When(
31
- "User clicks {string} at {int}, {int} position",
32
- async function (selector, x, y) {
33
- await mouse.clickPosition(selector, x, y);
34
- },
35
- );
36
-
37
- // User clicks on a selector at a specific position with force
38
- When(
39
- "User clicks {string} at {int}, {int} position with force",
40
- async function (selector, x, y) {
41
- await mouse.clickPosition(selector, x, y, true);
42
- },
43
- );
44
-
45
- // User clicks at specific coordinates
46
- When("User clicks at {int}, {int} coordinates", async function (x, y) {
47
- await mouse.mouseClickPosition(x, y);
48
- });
49
-
50
- // User clicks at specific coordinates with click count and delay
51
- When(
52
- "User clicks at {int}, {int} coordinates with click count {int} and delay {int}",
53
- async function (x, y, clickCount, delay) {
54
- await mouse.mouseClickPosition(x, y, clickCount, delay);
55
- },
56
- );
57
-
58
- // User clicks at specific coordinates with force
59
- When(
60
- "User clicks at {int}, {int} coordinates with force",
61
- async function (x, y) {
62
- await mouse.mouseClickPosition(x, y, 1, 0, true); // Defaulting clickCount and delay
63
- },
64
- );
65
-
66
- // User clicks on a selector with a specific mouse button
67
- When(
68
- "User clicks {string} with button {string}",
69
- async function (selector, button) {
70
- await mouse.clickByBtn(selector, button);
71
- },
72
- );
73
-
74
- // User clicks on a selector with a specific mouse button and force
75
- When(
76
- "User clicks {string} with button {string} and force",
77
- async function (selector, button) {
78
- await mouse.clickByBtn(selector, button, true);
79
- },
80
- );
81
-
82
- // User double clicks on a selector
83
- When("User double clicks {string}", async function (selector) {
84
- await mouse.doubleClick(selector);
85
- });
86
-
87
- When("User double clicks multiple {string}", async (elements) => {
88
- await mouse.multipleElementDoubleClick(elements);
89
- });
90
-
91
- // User double clicks on a selector with force
92
- When("User double clicks {string} with force", async function (selector) {
93
- await mouse.doubleClick(selector, true);
94
- });
95
-
96
- // User double clicks on a selector at a specific position
97
- When(
98
- "User double clicks {string} at {int}, {int} position",
99
- async function (selector, x, y) {
100
- await mouse.doubleClickPosition(selector, x, y);
101
- },
102
- );
103
-
104
- // User double clicks on a selector at a specific position with force
105
- When(
106
- "User double clicks {string} at {int}, {int} position with force",
107
- async function (selector, x, y) {
108
- await mouse.doubleClickPosition(selector, x, y, true);
109
- },
110
- );
111
-
112
- // User double clicks at specific coordinates
113
- When("User double clicks at {int}, {int} coordinates", async function (x, y) {
114
- await mouse.mouseDoubleClickPosition(x, y);
115
- });
116
-
117
- // User double clicks at specific coordinates with click count and delay
118
- When(
119
- "User double clicks at {int}, {int} coordinates with click count {int} and delay {int}",
120
- async function (x, y, clickCount, delay) {
121
- await mouse.mouseDoubleClickPosition(x, y, clickCount, delay);
122
- },
123
- );
124
-
125
- // User double clicks at specific coordinates with force
126
- When(
127
- "User double clicks at {int}, {int} coordinates with force",
128
- async function (x, y) {
129
- await mouse.mouseDoubleClickPosition(x, y, 1, 0, true); // Defaulting clickCount and delay
130
- },
131
- );
132
-
133
- // User moves the mouse to specific coordinates
134
- When("User moves to {int}, {int} coordinates", async function (x, y) {
135
- await mouse.move(x, y);
136
- });
137
-
138
- // User scrolls the mouse wheel at specific coordinates
139
- When(
140
- "User scrolls the mouse wheel at {int}, {int} coordinates",
141
- async function (x, y) {
142
- await mouse.wheel(x, y);
143
- },
144
- );
145
-
146
- // User hovers over a selector
147
- When("User hovers over {string}", async function (selector) {
148
- await mouse.hover(selector);
149
- });
150
-
151
- // User hovers over a selector with force
152
- When("User hovers over {string} with force", async function (selector) {
153
- await mouse.hover(selector, true);
154
- });
155
-
156
- // User hovers over a selector at a specific position
157
- When(
158
- "User hovers over {string} at {int}, {int} position",
159
- async function (selector, x, y) {
160
- await mouse.hoverPosition(selector, x, y);
161
- },
162
- );
163
-
164
- // User hovers over a selector at a specific position with force
165
- When(
166
- "User hovers over {string} at {int}, {int} position with force",
167
- async function (selector, x, y) {
168
- await mouse.hoverPosition(selector, x, y, true);
169
- },
170
- );
171
-
172
- // User focuses on a selector
173
- When("User focuses on {string}", async function (selector) {
174
- await mouse.focus(selector);
175
- });
176
-
177
- // User focuses on a selector with force
178
- When("User focuses on {string} with force", async function (selector) {
179
- await mouse.focus(selector, true);
180
- });
181
-
182
- // User focuses on a selector at a specific position
183
- When(
184
- "User focuses on {string} at {int}, {int} position",
185
- async function (selector, x, y) {
186
- await mouse.focusPosition(selector, x, y);
187
- },
188
- );
189
-
190
- // User focuses on a selector at a specific position with force
191
- When(
192
- "User focuses on {string} at {int}, {int} position with force",
193
- async function (selector, x, y) {
194
- await mouse.focusPosition(selector, x, y, true);
195
- },
196
- );
197
-
198
- // User drags an element from one selector to another
199
- When(
200
- "User drags {string} to {string}",
201
- async function (sourceSelector, targetSelector) {
202
- await mouse.dragAndDrop(sourceSelector, targetSelector);
203
- },
204
- );
205
-
206
- // User drags an element to a specific position
207
- When(
208
- "User drags {string} to {int}, {int} position",
209
- async function (sourceSelector, x, y) {
210
- await mouse.dragAndDropPosition(sourceSelector, x, y);
211
- },
212
- );
213
-
214
- // User selects options by value
215
- When(
216
- "User selects by value {string} from {string}",
217
- async function (value, selector) {
218
- await mouse.selectByValue(selector, value);
219
- },
220
- );
221
-
222
- // User selects an option by text
223
- When(
224
- "User selects by text {string} from {string}",
225
- async function (text, selector) {
226
- await mouse.selectByText(selector, text);
227
- },
228
- );
229
-
230
- // User checks a checkbox or radio button
231
- When("User checks {string}", async function (selector) {
232
- await mouse.check(selector);
233
- });
234
-
235
- When("User checks multiple {string}", async function (selectors) {
236
- await mouse.multipleElementCheck(selectors);
237
- });
238
-
239
- // User unchecks a checkbox or radio button
240
- When("User unchecks {string}", async function (selector) {
241
- await mouse.uncheck(selector);
242
- });
243
-
244
- When("User unchecks multiple {string}", async function (selectors) {
245
- await mouse.multipleElementUncheck(selectors);
246
- });
247
-
248
- // User scrolls into view if needed for a selector
249
- When("User scrolls {string} into view", async function (selector) {
250
- await mouse.scrollIntoViewIfNeeded(selector);
251
- });
252
-
253
- // User uploads file
254
- When("User uploads {string} file to {string}", async (filePath, fileInput) => {
255
- await mouse.upload(filePath, fileInput);
256
- });
1
+ const { When } = require("../helper/imports/commons");
2
+ const { mouse, frame } = require("../helper/stepFunctions/exporter");
3
+
4
+ // User clicks on a selector
5
+ When("User clicks {string}", async function (selector) {
6
+ await mouse.click(selector);
7
+ });
8
+
9
+ When("User clicks last of {string}", async (selector) => {
10
+ const elementCount = await frame.count(selector);
11
+ const lastElement = await frame.nth(selector, elementCount);
12
+ await mouse.click(lastElement);
13
+ });
14
+
15
+ When("User clicks {int} th of {string}", async (order, elements) => {
16
+ const nthElement = await frame.nth(elements, order);
17
+ await nthElement.click();
18
+ });
19
+
20
+ When("User clicks multiple {string}", async (elements) => {
21
+ await mouse.multipleElementClick(elements);
22
+ });
23
+
24
+ // User clicks on a selector with force
25
+ When("User clicks {string} with force", async function (selector) {
26
+ await mouse.click(selector, true);
27
+ });
28
+
29
+ // User clicks on a selector at a specific position
30
+ When(
31
+ "User clicks {string} at {int}, {int} position",
32
+ async function (selector, x, y) {
33
+ await mouse.clickPosition(selector, x, y);
34
+ },
35
+ );
36
+
37
+ // User clicks on a selector at a specific position with force
38
+ When(
39
+ "User clicks {string} at {int}, {int} position with force",
40
+ async function (selector, x, y) {
41
+ await mouse.clickPosition(selector, x, y, true);
42
+ },
43
+ );
44
+
45
+ // User clicks at specific coordinates
46
+ When("User clicks at {int}, {int} coordinates", async function (x, y) {
47
+ await mouse.mouseClickPosition(x, y);
48
+ });
49
+
50
+ // User clicks at specific coordinates with click count and delay
51
+ When(
52
+ "User clicks at {int}, {int} coordinates with click count {int} and delay {int}",
53
+ async function (x, y, clickCount, delay) {
54
+ await mouse.mouseClickPosition(x, y, clickCount, delay);
55
+ },
56
+ );
57
+
58
+ // User clicks at specific coordinates with force
59
+ When(
60
+ "User clicks at {int}, {int} coordinates with force",
61
+ async function (x, y) {
62
+ await mouse.mouseClickPosition(x, y, 1, 0, true); // Defaulting clickCount and delay
63
+ },
64
+ );
65
+
66
+ // User clicks on a selector with a specific mouse button
67
+ When(
68
+ "User clicks {string} with button {string}",
69
+ async function (selector, button) {
70
+ await mouse.clickByBtn(selector, button);
71
+ },
72
+ );
73
+
74
+ // User clicks on a selector with a specific mouse button and force
75
+ When(
76
+ "User clicks {string} with button {string} and force",
77
+ async function (selector, button) {
78
+ await mouse.clickByBtn(selector, button, true);
79
+ },
80
+ );
81
+
82
+ // User double clicks on a selector
83
+ When("User double clicks {string}", async function (selector) {
84
+ await mouse.doubleClick(selector);
85
+ });
86
+
87
+ When("User double clicks multiple {string}", async (elements) => {
88
+ await mouse.multipleElementDoubleClick(elements);
89
+ });
90
+
91
+ // User double clicks on a selector with force
92
+ When("User double clicks {string} with force", async function (selector) {
93
+ await mouse.doubleClick(selector, true);
94
+ });
95
+
96
+ // User double clicks on a selector at a specific position
97
+ When(
98
+ "User double clicks {string} at {int}, {int} position",
99
+ async function (selector, x, y) {
100
+ await mouse.doubleClickPosition(selector, x, y);
101
+ },
102
+ );
103
+
104
+ // User double clicks on a selector at a specific position with force
105
+ When(
106
+ "User double clicks {string} at {int}, {int} position with force",
107
+ async function (selector, x, y) {
108
+ await mouse.doubleClickPosition(selector, x, y, true);
109
+ },
110
+ );
111
+
112
+ // User double clicks at specific coordinates
113
+ When("User double clicks at {int}, {int} coordinates", async function (x, y) {
114
+ await mouse.mouseDoubleClickPosition(x, y);
115
+ });
116
+
117
+ // User double clicks at specific coordinates with click count and delay
118
+ When(
119
+ "User double clicks at {int}, {int} coordinates with click count {int} and delay {int}",
120
+ async function (x, y, clickCount, delay) {
121
+ await mouse.mouseDoubleClickPosition(x, y, clickCount, delay);
122
+ },
123
+ );
124
+
125
+ // User double clicks at specific coordinates with force
126
+ When(
127
+ "User double clicks at {int}, {int} coordinates with force",
128
+ async function (x, y) {
129
+ await mouse.mouseDoubleClickPosition(x, y, 1, 0, true); // Defaulting clickCount and delay
130
+ },
131
+ );
132
+
133
+ // User moves the mouse to specific coordinates
134
+ When("User moves to {int}, {int} coordinates", async function (x, y) {
135
+ await mouse.move(x, y);
136
+ });
137
+
138
+ // User scrolls the mouse wheel at specific coordinates
139
+ When(
140
+ "User scrolls the mouse wheel at {int}, {int} coordinates",
141
+ async function (x, y) {
142
+ await mouse.wheel(x, y);
143
+ },
144
+ );
145
+
146
+ // User hovers over a selector
147
+ When("User hovers over {string}", async function (selector) {
148
+ await mouse.hover(selector);
149
+ });
150
+
151
+ // User hovers over a selector with force
152
+ When("User hovers over {string} with force", async function (selector) {
153
+ await mouse.hover(selector, true);
154
+ });
155
+
156
+ // User hovers over a selector at a specific position
157
+ When(
158
+ "User hovers over {string} at {int}, {int} position",
159
+ async function (selector, x, y) {
160
+ await mouse.hoverPosition(selector, x, y);
161
+ },
162
+ );
163
+
164
+ // User hovers over a selector at a specific position with force
165
+ When(
166
+ "User hovers over {string} at {int}, {int} position with force",
167
+ async function (selector, x, y) {
168
+ await mouse.hoverPosition(selector, x, y, true);
169
+ },
170
+ );
171
+
172
+ // User focuses on a selector
173
+ When("User focuses on {string}", async function (selector) {
174
+ await mouse.focus(selector);
175
+ });
176
+
177
+ // User focuses on a selector with force
178
+ When("User focuses on {string} with force", async function (selector) {
179
+ await mouse.focus(selector, true);
180
+ });
181
+
182
+ // User focuses on a selector at a specific position
183
+ When(
184
+ "User focuses on {string} at {int}, {int} position",
185
+ async function (selector, x, y) {
186
+ await mouse.focusPosition(selector, x, y);
187
+ },
188
+ );
189
+
190
+ // User focuses on a selector at a specific position with force
191
+ When(
192
+ "User focuses on {string} at {int}, {int} position with force",
193
+ async function (selector, x, y) {
194
+ await mouse.focusPosition(selector, x, y, true);
195
+ },
196
+ );
197
+
198
+ // User drags an element from one selector to another
199
+ When(
200
+ "User drags {string} to {string}",
201
+ async function (sourceSelector, targetSelector) {
202
+ await mouse.dragAndDrop(sourceSelector, targetSelector);
203
+ },
204
+ );
205
+
206
+ // User drags an element to a specific position
207
+ When(
208
+ "User drags {string} to {int}, {int} position",
209
+ async function (sourceSelector, x, y) {
210
+ await mouse.dragAndDropPosition(sourceSelector, x, y);
211
+ },
212
+ );
213
+
214
+ // User selects options by value
215
+ When(
216
+ "User selects by value {string} from {string}",
217
+ async function (value, selector) {
218
+ await mouse.selectByValue(selector, value);
219
+ },
220
+ );
221
+
222
+ // User selects an option by text
223
+ When(
224
+ "User selects by text {string} from {string}",
225
+ async function (text, selector) {
226
+ await mouse.selectByText(selector, text);
227
+ },
228
+ );
229
+
230
+ // User checks a checkbox or radio button
231
+ When("User checks {string}", async function (selector) {
232
+ await mouse.check(selector);
233
+ });
234
+
235
+ When("User checks multiple {string}", async function (selectors) {
236
+ await mouse.multipleElementCheck(selectors);
237
+ });
238
+
239
+ // User unchecks a checkbox or radio button
240
+ When("User unchecks {string}", async function (selector) {
241
+ await mouse.uncheck(selector);
242
+ });
243
+
244
+ When("User unchecks multiple {string}", async function (selectors) {
245
+ await mouse.multipleElementUncheck(selectors);
246
+ });
247
+
248
+ // User scrolls into view if needed for a selector
249
+ When("User scrolls {string} into view", async function (selector) {
250
+ await mouse.scrollIntoViewIfNeeded(selector);
251
+ });
252
+
253
+ // User uploads file
254
+ When("User uploads {string} file to {string}", async (filePath, fileInput) => {
255
+ await mouse.upload(filePath, fileInput);
256
+ });
@@ -1,71 +1,71 @@
1
- const { When, context, selector } = require("../helper/imports/commons");
2
- const { page, assert, mouse } = require("../helper/stepFunctions/exporter");
3
-
4
- When("User navigates to {string} page", async function (url) {
5
- const URL = await selector(url);
6
- await page.navigateTo(URL);
7
- });
8
-
9
- When("User is on {string} page", async function (url) {
10
- const URL = await selector(url);
11
- await assert.shouldPageHaveURL(URL);
12
- });
13
-
14
- When("User navigates previous page", async function () {
15
- await page.navigateBack();
16
- });
17
-
18
- When("User navigates next page", async function () {
19
- await page.navigateForward();
20
- });
21
-
22
- When("User gets URL of page", async function () {
23
- await page.getURL();
24
- });
25
-
26
- When("User reloads the page", async function () {
27
- await page.reload();
28
- });
29
-
30
- When(`User waits {int} seconds`, async (sec) => {
31
- await page.wait(sec * 1000);
32
- });
33
-
34
- When(`User waits {int} milliseconds`, async (sec) => {
35
- await page.wait(sec);
36
- });
37
-
38
- When(`User waits {int} minutes`, async (sec) => {
39
- await page.wait(sec * 1000 * 60);
40
- });
41
-
42
- When("User clicks {string} and confirms alert", async (button) => {
43
- context.page.on("dialog", async (dialog) => {
44
- await dialog.accept();
45
- });
46
- await mouse.click(button);
47
- });
48
-
49
- When("User clicks {string} and confirms popup", async (button) => {
50
- context.page.on("dialog", async (dialog) => {
51
- await dialog.accept();
52
- });
53
- await mouse.click(button);
54
- });
55
-
56
- When("User clicks {string} and dismisses popup", async (button) => {
57
- context.page.on("dialog", async (dialog) => {
58
- await dialog.dismiss();
59
- });
60
- await mouse.click(button);
61
- });
62
-
63
- When(
64
- "User clicks {string} and types {string} in prompt",
65
- async (button, prompt) => {
66
- context.page.on("dialog", async (dialog) => {
67
- await dialog.accept(prompt);
68
- });
69
- await mouse.click(button);
70
- },
71
- );
1
+ const { When, context, selector } = require("../helper/imports/commons");
2
+ const { page, assert, mouse } = require("../helper/stepFunctions/exporter");
3
+
4
+ When("User navigates to {string} page", async function (url) {
5
+ const URL = await selector(url);
6
+ await page.navigateTo(URL);
7
+ });
8
+
9
+ When("User is on {string} page", async function (url) {
10
+ const URL = await selector(url);
11
+ await assert.shouldPageHaveURL(URL);
12
+ });
13
+
14
+ When("User navigates previous page", async function () {
15
+ await page.navigateBack();
16
+ });
17
+
18
+ When("User navigates next page", async function () {
19
+ await page.navigateForward();
20
+ });
21
+
22
+ When("User gets URL of page", async function () {
23
+ await page.getURL();
24
+ });
25
+
26
+ When("User reloads the page", async function () {
27
+ await page.reload();
28
+ });
29
+
30
+ When(`User waits {int} seconds`, async (sec) => {
31
+ await page.wait(sec * 1000);
32
+ });
33
+
34
+ When(`User waits {int} milliseconds`, async (sec) => {
35
+ await page.wait(sec);
36
+ });
37
+
38
+ When(`User waits {int} minutes`, async (sec) => {
39
+ await page.wait(sec * 1000 * 60);
40
+ });
41
+
42
+ When("User clicks {string} and confirms alert", async (button) => {
43
+ context.page.on("dialog", async (dialog) => {
44
+ await dialog.accept();
45
+ });
46
+ await mouse.click(button);
47
+ });
48
+
49
+ When("User clicks {string} and confirms popup", async (button) => {
50
+ context.page.on("dialog", async (dialog) => {
51
+ await dialog.accept();
52
+ });
53
+ await mouse.click(button);
54
+ });
55
+
56
+ When("User clicks {string} and dismisses popup", async (button) => {
57
+ context.page.on("dialog", async (dialog) => {
58
+ await dialog.dismiss();
59
+ });
60
+ await mouse.click(button);
61
+ });
62
+
63
+ When(
64
+ "User clicks {string} and types {string} in prompt",
65
+ async (button, prompt) => {
66
+ context.page.on("dialog", async (dialog) => {
67
+ await dialog.accept(prompt);
68
+ });
69
+ await mouse.click(button);
70
+ },
71
+ );