artes 1.0.37 → 1.0.38
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "artes",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
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": {
|
|
@@ -3,17 +3,17 @@ const { context, selector } = require("../imports/commons");
|
|
|
3
3
|
const browser = {
|
|
4
4
|
setCookies: async (cookies) => {
|
|
5
5
|
let cookieData;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
try {
|
|
7
|
+
cookieData = JSON.parse(cookies);
|
|
8
|
+
} catch {
|
|
9
|
+
cookieData = selector(cookies);
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
cookieData = Array.isArray(cookieData) ? cookieData : [cookieData];
|
|
13
|
+
await context.browser.addCookies(cookieData);
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
module.exports = {
|
|
18
|
-
browser
|
|
18
|
+
browser,
|
|
19
19
|
};
|
|
@@ -11,7 +11,7 @@ const keyboard = {
|
|
|
11
11
|
await element(selector).pressSequentially(keys, { delay: delay });
|
|
12
12
|
},
|
|
13
13
|
fill: async (selector, value) => {
|
|
14
|
-
|
|
14
|
+
value !== "" ? await element(selector).fill(value) : "";
|
|
15
15
|
},
|
|
16
16
|
multipleElementFill: async (selectors, value) => {
|
|
17
17
|
const elementCount = await frame.count(selectors);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { element } = require("../imports/commons");
|
|
1
|
+
const { element, context } = require("../imports/commons");
|
|
2
2
|
const { frame } = require("../stepFunctions/frameActions");
|
|
3
3
|
|
|
4
4
|
const mouse = {
|
|
@@ -125,6 +125,12 @@ const mouse = {
|
|
|
125
125
|
scrollIntoViewIfNeeded: async (selector) => {
|
|
126
126
|
await element(selector).scrollIntoViewIfNeeded();
|
|
127
127
|
},
|
|
128
|
+
upload: async (filePath, fileInput) => {
|
|
129
|
+
const fileChooserPromise = context.page.waitForEvent("filechooser");
|
|
130
|
+
await element(fileInput).click();
|
|
131
|
+
const fileChooser = await fileChooserPromise;
|
|
132
|
+
await fileChooser.setFiles(filePath);
|
|
133
|
+
},
|
|
128
134
|
};
|
|
129
135
|
|
|
130
136
|
module.exports = {
|
|
@@ -249,3 +249,8 @@ When("User unchecks multiple {string}", async function (selectors) {
|
|
|
249
249
|
When("User scrolls {string} into view", async function (selector) {
|
|
250
250
|
await mouse.scrollIntoViewIfNeeded(selector);
|
|
251
251
|
});
|
|
252
|
+
|
|
253
|
+
// User uploads file
|
|
254
|
+
When("User uploads {string} file to {string}", async (filePath, fileInput) => {
|
|
255
|
+
await mouse.upload(filePath, fileInput);
|
|
256
|
+
});
|