artes 1.4.7 → 1.4.9
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/README.md +668 -668
- package/cucumber.config.js +223 -223
- package/docs/emulationDevicesList.md +152 -152
- package/docs/functionDefinitions.md +2401 -2401
- package/docs/stepDefinitions.md +402 -402
- package/executer.js +479 -479
- package/index.js +50 -50
- package/package.json +52 -52
- package/src/helper/contextManager/browserManager.js +74 -74
- package/src/helper/contextManager/requestManager.js +23 -23
- package/src/helper/controller/elementController.js +203 -185
- package/src/helper/controller/pomCollector.js +82 -82
- package/src/helper/executers/cleaner.js +19 -19
- package/src/helper/executers/exporter.js +15 -15
- package/src/helper/executers/helper.js +110 -110
- package/src/helper/executers/projectCreator.js +206 -206
- package/src/helper/executers/reportGenerator.js +70 -70
- package/src/helper/executers/testRunner.js +28 -28
- package/src/helper/executers/versionChecker.js +31 -31
- package/src/helper/imports/commons.js +57 -57
- package/src/helper/stepFunctions/APIActions.js +495 -495
- package/src/helper/stepFunctions/assertions.js +989 -989
- package/src/helper/stepFunctions/browserActions.js +22 -22
- package/src/helper/stepFunctions/elementInteractions.js +60 -60
- package/src/helper/stepFunctions/exporter.js +19 -19
- package/src/helper/stepFunctions/frameActions.js +72 -72
- package/src/helper/stepFunctions/keyboardActions.js +66 -66
- package/src/helper/stepFunctions/mouseActions.js +83 -83
- package/src/helper/stepFunctions/pageActions.js +43 -43
- package/src/hooks/context.js +15 -15
- package/src/hooks/hooks.js +215 -215
- package/src/stepDefinitions/API.steps.js +310 -310
- package/src/stepDefinitions/assertions.steps.js +1092 -1092
- package/src/stepDefinitions/browser.steps.js +7 -7
- package/src/stepDefinitions/frameActions.steps.js +76 -76
- package/src/stepDefinitions/keyboardActions.steps.js +265 -265
- package/src/stepDefinitions/mouseActions.steps.js +378 -378
- package/src/stepDefinitions/page.steps.js +71 -71
- package/src/stepDefinitions/random.steps.js +188 -188
- package/status-formatter.js +138 -138
package/index.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
const {
|
|
2
|
-
expect,
|
|
3
|
-
Given,
|
|
4
|
-
When,
|
|
5
|
-
Then,
|
|
6
|
-
context,
|
|
7
|
-
element,
|
|
8
|
-
selector,
|
|
9
|
-
saveVar,
|
|
10
|
-
extractVarsFromResponse,
|
|
11
|
-
browserPage,
|
|
12
|
-
request,
|
|
13
|
-
random,
|
|
14
|
-
time,
|
|
15
|
-
resolveVariable,
|
|
16
|
-
} = require("./src/helper/imports/commons");
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
keyboard,
|
|
20
|
-
mouse,
|
|
21
|
-
frame,
|
|
22
|
-
assert,
|
|
23
|
-
elementInteractions,
|
|
24
|
-
api,
|
|
25
|
-
page,
|
|
26
|
-
} = require("./src/helper/stepFunctions/exporter");
|
|
27
|
-
|
|
28
|
-
module.exports = {
|
|
29
|
-
expect,
|
|
30
|
-
Given,
|
|
31
|
-
When,
|
|
32
|
-
Then,
|
|
33
|
-
element,
|
|
34
|
-
selector,
|
|
35
|
-
saveVar,
|
|
36
|
-
extractVarsFromResponse,
|
|
37
|
-
resolveVariable,
|
|
38
|
-
context,
|
|
39
|
-
browserPage,
|
|
40
|
-
api,
|
|
41
|
-
random,
|
|
42
|
-
time,
|
|
43
|
-
page,
|
|
44
|
-
request,
|
|
45
|
-
keyboard,
|
|
46
|
-
mouse,
|
|
47
|
-
frame,
|
|
48
|
-
assert,
|
|
49
|
-
elementInteractions,
|
|
50
|
-
};
|
|
1
|
+
const {
|
|
2
|
+
expect,
|
|
3
|
+
Given,
|
|
4
|
+
When,
|
|
5
|
+
Then,
|
|
6
|
+
context,
|
|
7
|
+
element,
|
|
8
|
+
selector,
|
|
9
|
+
saveVar,
|
|
10
|
+
extractVarsFromResponse,
|
|
11
|
+
browserPage,
|
|
12
|
+
request,
|
|
13
|
+
random,
|
|
14
|
+
time,
|
|
15
|
+
resolveVariable,
|
|
16
|
+
} = require("./src/helper/imports/commons");
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
keyboard,
|
|
20
|
+
mouse,
|
|
21
|
+
frame,
|
|
22
|
+
assert,
|
|
23
|
+
elementInteractions,
|
|
24
|
+
api,
|
|
25
|
+
page,
|
|
26
|
+
} = require("./src/helper/stepFunctions/exporter");
|
|
27
|
+
|
|
28
|
+
module.exports = {
|
|
29
|
+
expect,
|
|
30
|
+
Given,
|
|
31
|
+
When,
|
|
32
|
+
Then,
|
|
33
|
+
element,
|
|
34
|
+
selector,
|
|
35
|
+
saveVar,
|
|
36
|
+
extractVarsFromResponse,
|
|
37
|
+
resolveVariable,
|
|
38
|
+
context,
|
|
39
|
+
browserPage,
|
|
40
|
+
api,
|
|
41
|
+
random,
|
|
42
|
+
time,
|
|
43
|
+
page,
|
|
44
|
+
request,
|
|
45
|
+
keyboard,
|
|
46
|
+
mouse,
|
|
47
|
+
frame,
|
|
48
|
+
assert,
|
|
49
|
+
elementInteractions,
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "artes",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "cucumber-js --config=cucumber.config.js",
|
|
8
|
-
"createProject": "node ./src/helper/executers/projectCreator.js",
|
|
9
|
-
"clean": "rimraf",
|
|
10
|
-
"publishOnly": "prettier -w . && npm version patch && npm publish"
|
|
11
|
-
},
|
|
12
|
-
"bin": {
|
|
13
|
-
"artes": "./executer.js"
|
|
14
|
-
},
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"registry": "https://registry.npmjs.org/"
|
|
17
|
-
},
|
|
18
|
-
"author": "VhdAghyv",
|
|
19
|
-
"license": "ISC",
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@cucumber/cucumber": "^11.3.0",
|
|
22
|
-
"@cucumber/messages": "26.0.1",
|
|
23
|
-
"@faker-js/faker": "9.8.0",
|
|
24
|
-
"@types/node": "22.9.0",
|
|
25
|
-
"ajv": "8.17.1",
|
|
26
|
-
"allure-commandline": "2.36.0",
|
|
27
|
-
"allure-cucumberjs": "3.4.5",
|
|
28
|
-
"allure-js-commons": "3.4.5",
|
|
29
|
-
"archiver": "^7.0.1",
|
|
30
|
-
"dayjs": "1.11.13",
|
|
31
|
-
"deasync": "^0.1.31",
|
|
32
|
-
"playwright": "^1.58.2",
|
|
33
|
-
"rimraf": "6.0.1"
|
|
34
|
-
},
|
|
35
|
-
"repository": {
|
|
36
|
-
"type": "git",
|
|
37
|
-
"url": "git+https://github.com/4gayev1/Artes"
|
|
38
|
-
},
|
|
39
|
-
"bugs": {
|
|
40
|
-
"url": "https://github.com/4gayev1/Artes/issues"
|
|
41
|
-
},
|
|
42
|
-
"homepage": "https://github.com/4gayev1/Artes/blob/main/README.md",
|
|
43
|
-
"keywords": [
|
|
44
|
-
"kdt",
|
|
45
|
-
"automation",
|
|
46
|
-
"playwright",
|
|
47
|
-
"cucumber",
|
|
48
|
-
"test automation",
|
|
49
|
-
"end-to-end",
|
|
50
|
-
"API testing"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "artes",
|
|
3
|
+
"version": "1.4.9",
|
|
4
|
+
"description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "cucumber-js --config=cucumber.config.js",
|
|
8
|
+
"createProject": "node ./src/helper/executers/projectCreator.js",
|
|
9
|
+
"clean": "rimraf",
|
|
10
|
+
"publishOnly": "prettier -w . && npm version patch && npm publish"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"artes": "./executer.js"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
},
|
|
18
|
+
"author": "VhdAghyv",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@cucumber/cucumber": "^11.3.0",
|
|
22
|
+
"@cucumber/messages": "26.0.1",
|
|
23
|
+
"@faker-js/faker": "9.8.0",
|
|
24
|
+
"@types/node": "22.9.0",
|
|
25
|
+
"ajv": "8.17.1",
|
|
26
|
+
"allure-commandline": "2.36.0",
|
|
27
|
+
"allure-cucumberjs": "3.4.5",
|
|
28
|
+
"allure-js-commons": "3.4.5",
|
|
29
|
+
"archiver": "^7.0.1",
|
|
30
|
+
"dayjs": "1.11.13",
|
|
31
|
+
"deasync": "^0.1.31",
|
|
32
|
+
"playwright": "^1.58.2",
|
|
33
|
+
"rimraf": "6.0.1"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/4gayev1/Artes"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/4gayev1/Artes/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/4gayev1/Artes/blob/main/README.md",
|
|
43
|
+
"keywords": [
|
|
44
|
+
"kdt",
|
|
45
|
+
"automation",
|
|
46
|
+
"playwright",
|
|
47
|
+
"cucumber",
|
|
48
|
+
"test automation",
|
|
49
|
+
"end-to-end",
|
|
50
|
+
"API testing"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
const { chromium, firefox, webkit, devices } = require("playwright");
|
|
2
|
-
const cucumberConfig = require("../../../cucumber.config.js");
|
|
3
|
-
|
|
4
|
-
const invokeBrowser = async () => {
|
|
5
|
-
let browser;
|
|
6
|
-
|
|
7
|
-
let baseURL = "";
|
|
8
|
-
|
|
9
|
-
if (typeof cucumberConfig.baseURL === "object") {
|
|
10
|
-
const env = (cucumberConfig.env || "").trim();
|
|
11
|
-
baseURL = cucumberConfig.baseURL[env];
|
|
12
|
-
} else {
|
|
13
|
-
baseURL = cucumberConfig.baseURL;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const options = {
|
|
17
|
-
headless: cucumberConfig.browser.headless,
|
|
18
|
-
slowMo: cucumberConfig.browser.slowMo,
|
|
19
|
-
args: [cucumberConfig.browser.maximizeScreen ? "--start-maximized" : ""],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const browserType = cucumberConfig.browser.device
|
|
23
|
-
? "webkit"
|
|
24
|
-
: cucumberConfig.browser.browserType.toLowerCase() || "chrome";
|
|
25
|
-
|
|
26
|
-
const browserContextOptions = {
|
|
27
|
-
baseURL: baseURL,
|
|
28
|
-
...(cucumberConfig.browser.device
|
|
29
|
-
? {}
|
|
30
|
-
: {
|
|
31
|
-
viewport: cucumberConfig.browser.maximizeScreen
|
|
32
|
-
? null
|
|
33
|
-
: cucumberConfig.browser.viewport,
|
|
34
|
-
}),
|
|
35
|
-
recordVideo: {
|
|
36
|
-
dir: "./test-results/visualReport/",
|
|
37
|
-
size: cucumberConfig.browser.viewport,
|
|
38
|
-
},
|
|
39
|
-
ignoreHTTPSErrors: true,
|
|
40
|
-
offline: cucumberConfig.browser.offline,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
switch (browserType) {
|
|
44
|
-
case "chrome":
|
|
45
|
-
browser = await chromium.launch(options);
|
|
46
|
-
break;
|
|
47
|
-
case "firefox":
|
|
48
|
-
browser = await firefox.launch(options);
|
|
49
|
-
break;
|
|
50
|
-
case "webkit":
|
|
51
|
-
browser = await webkit.launch(options);
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
throw new Error(
|
|
55
|
-
"Please set the proper browser!\n Options: chrome, firefox, webkit",
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const context = await browser.newContext({
|
|
60
|
-
...(cucumberConfig.browser.device
|
|
61
|
-
? devices[cucumberConfig.browser.device]
|
|
62
|
-
: {}),
|
|
63
|
-
...browserContextOptions,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
browser: browser,
|
|
68
|
-
context: context,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
module.exports = {
|
|
73
|
-
invokeBrowser,
|
|
74
|
-
};
|
|
1
|
+
const { chromium, firefox, webkit, devices } = require("playwright");
|
|
2
|
+
const cucumberConfig = require("../../../cucumber.config.js");
|
|
3
|
+
|
|
4
|
+
const invokeBrowser = async () => {
|
|
5
|
+
let browser;
|
|
6
|
+
|
|
7
|
+
let baseURL = "";
|
|
8
|
+
|
|
9
|
+
if (typeof cucumberConfig.baseURL === "object") {
|
|
10
|
+
const env = (cucumberConfig.env || "").trim();
|
|
11
|
+
baseURL = cucumberConfig.baseURL[env];
|
|
12
|
+
} else {
|
|
13
|
+
baseURL = cucumberConfig.baseURL;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const options = {
|
|
17
|
+
headless: cucumberConfig.browser.headless,
|
|
18
|
+
slowMo: cucumberConfig.browser.slowMo,
|
|
19
|
+
args: [cucumberConfig.browser.maximizeScreen ? "--start-maximized" : ""],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const browserType = cucumberConfig.browser.device
|
|
23
|
+
? "webkit"
|
|
24
|
+
: cucumberConfig.browser.browserType.toLowerCase() || "chrome";
|
|
25
|
+
|
|
26
|
+
const browserContextOptions = {
|
|
27
|
+
baseURL: baseURL,
|
|
28
|
+
...(cucumberConfig.browser.device
|
|
29
|
+
? {}
|
|
30
|
+
: {
|
|
31
|
+
viewport: cucumberConfig.browser.maximizeScreen
|
|
32
|
+
? null
|
|
33
|
+
: cucumberConfig.browser.viewport,
|
|
34
|
+
}),
|
|
35
|
+
recordVideo: {
|
|
36
|
+
dir: "./test-results/visualReport/",
|
|
37
|
+
size: cucumberConfig.browser.viewport,
|
|
38
|
+
},
|
|
39
|
+
ignoreHTTPSErrors: true,
|
|
40
|
+
offline: cucumberConfig.browser.offline,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
switch (browserType) {
|
|
44
|
+
case "chrome":
|
|
45
|
+
browser = await chromium.launch(options);
|
|
46
|
+
break;
|
|
47
|
+
case "firefox":
|
|
48
|
+
browser = await firefox.launch(options);
|
|
49
|
+
break;
|
|
50
|
+
case "webkit":
|
|
51
|
+
browser = await webkit.launch(options);
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
throw new Error(
|
|
55
|
+
"Please set the proper browser!\n Options: chrome, firefox, webkit",
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const context = await browser.newContext({
|
|
60
|
+
...(cucumberConfig.browser.device
|
|
61
|
+
? devices[cucumberConfig.browser.device]
|
|
62
|
+
: {}),
|
|
63
|
+
...browserContextOptions,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
browser: browser,
|
|
68
|
+
context: context,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
invokeBrowser,
|
|
74
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const { request } = require("playwright");
|
|
2
|
-
const cucumberConfig = require("../../../cucumber.config.js");
|
|
3
|
-
|
|
4
|
-
let baseURL = "";
|
|
5
|
-
|
|
6
|
-
if (typeof cucumberConfig.baseURL === "object") {
|
|
7
|
-
const env = (cucumberConfig.env || "").trim();
|
|
8
|
-
baseURL = cucumberConfig.baseURL[env];
|
|
9
|
-
} else {
|
|
10
|
-
baseURL = cucumberConfig.baseURL;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const requestContextOptions = {
|
|
14
|
-
baseURL: baseURL,
|
|
15
|
-
ignoreHTTPSErrors: true,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
async function invokeRequest() {
|
|
19
|
-
const context = await request.newContext(requestContextOptions);
|
|
20
|
-
return context;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = { invokeRequest };
|
|
1
|
+
const { request } = require("playwright");
|
|
2
|
+
const cucumberConfig = require("../../../cucumber.config.js");
|
|
3
|
+
|
|
4
|
+
let baseURL = "";
|
|
5
|
+
|
|
6
|
+
if (typeof cucumberConfig.baseURL === "object") {
|
|
7
|
+
const env = (cucumberConfig.env || "").trim();
|
|
8
|
+
baseURL = cucumberConfig.baseURL[env];
|
|
9
|
+
} else {
|
|
10
|
+
baseURL = cucumberConfig.baseURL;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const requestContextOptions = {
|
|
14
|
+
baseURL: baseURL,
|
|
15
|
+
ignoreHTTPSErrors: true,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
async function invokeRequest() {
|
|
19
|
+
const context = await request.newContext(requestContextOptions);
|
|
20
|
+
return context;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = { invokeRequest };
|