artes 1.0.15 → 1.0.17
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/cucumber.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "artes",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "The package provide step definitions and user writes feature files, and the package handles automation, with optional POM files and custom step definitions.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -6,13 +6,16 @@ const invokeBrowser = async () => {
|
|
|
6
6
|
|
|
7
7
|
const options = {
|
|
8
8
|
headless: cucumberConfig.browser.headless,
|
|
9
|
+
args: [cucumberConfig.browser.maximizeScreen && "--start-maximized"],
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
const browserType =
|
|
12
13
|
cucumberConfig.browser.browserType.toLowerCase() || "chrome";
|
|
13
14
|
|
|
14
15
|
const browserContextOptions = {
|
|
15
|
-
viewport: cucumberConfig.browser.
|
|
16
|
+
viewport: cucumberConfig.browser.maximizeScreen
|
|
17
|
+
? null
|
|
18
|
+
: cucumberConfig.browser.viewport,
|
|
16
19
|
recordVideo: {
|
|
17
20
|
dir: "./test-results/visualReport/",
|
|
18
21
|
size: cucumberConfig.viewport,
|
|
@@ -53,6 +53,7 @@ function createProject(createYes) {
|
|
|
53
53
|
// browser: "chrome", // "chrome", "firefox", "webkit"
|
|
54
54
|
// width: 1280, // number - Browser width
|
|
55
55
|
// height: 720, // number - Browser height
|
|
56
|
+
// maximizeScreen: true, // boolean - Open browser in full screen mode
|
|
56
57
|
// forceExit: false, // boolean - Force process.exit() after tests
|
|
57
58
|
// failFast: false, // boolean - Stop on first test failure
|
|
58
59
|
// import: [], // string[] - Support code paths
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const { context } = require("../imports/commons");
|
|
1
|
+
const { context, selector } = require("../imports/commons");
|
|
2
2
|
|
|
3
3
|
const page = {
|
|
4
4
|
navigateTo: async (url) => {
|
|
5
|
+
url = selector(url);
|
|
5
6
|
return await context.page.goto(url);
|
|
6
7
|
},
|
|
7
8
|
getURL: async () => {
|
|
@@ -13,6 +14,9 @@ const page = {
|
|
|
13
14
|
navigateForward: async () => {
|
|
14
15
|
return await context.page.goForward();
|
|
15
16
|
},
|
|
17
|
+
reload: async () => {
|
|
18
|
+
page.reload();
|
|
19
|
+
},
|
|
16
20
|
wait: async (time) => {
|
|
17
21
|
return await context.page.waitForTimeout(time);
|
|
18
22
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
const { When, context } = require("../helper/imports/commons");
|
|
1
|
+
const { When, context, selector } = require("../helper/imports/commons");
|
|
2
2
|
const { page } = require("../helper/stepFunctions/exporter");
|
|
3
3
|
|
|
4
4
|
When("User navigates to {string} page", async function (url) {
|
|
5
|
-
await
|
|
5
|
+
const URL = await selector(url);
|
|
6
|
+
await page.navigateTo(URL);
|
|
6
7
|
});
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
When("User is on {string} page", async function (url) {
|
|
10
|
+
const URL = await selector(url);
|
|
11
|
+
await page.navigateTo(URL);
|
|
12
|
+
});
|
|
11
13
|
|
|
12
14
|
When("User navigates previous page", async function () {
|
|
13
15
|
await page.navigateBack();
|
|
@@ -21,6 +23,10 @@ When("User gets URL of page", async function () {
|
|
|
21
23
|
await page.getURL();
|
|
22
24
|
});
|
|
23
25
|
|
|
26
|
+
When("User reloads the page", async function () {
|
|
27
|
+
await page.reload();
|
|
28
|
+
});
|
|
29
|
+
|
|
24
30
|
When(`User waits {int} seconds`, async (sec) => {
|
|
25
31
|
await page.wait(sec * 1000);
|
|
26
32
|
});
|