artes 1.1.17 → 1.1.18
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
|
@@ -13,18 +13,28 @@ function addElements(newElements) {
|
|
|
13
13
|
// }
|
|
14
14
|
|
|
15
15
|
function selectorSeperator(element) {
|
|
16
|
-
if(typeof element !== "string") return element;
|
|
17
|
-
|
|
16
|
+
if (typeof element !== "string") return element;
|
|
17
|
+
|
|
18
18
|
const selector = element?.split("=");
|
|
19
|
-
const validTypes = [
|
|
19
|
+
const validTypes = [
|
|
20
|
+
"xpath",
|
|
21
|
+
"name",
|
|
22
|
+
"placeholder",
|
|
23
|
+
"text",
|
|
24
|
+
"label",
|
|
25
|
+
"role",
|
|
26
|
+
"alt",
|
|
27
|
+
"title",
|
|
28
|
+
"testid",
|
|
29
|
+
];
|
|
20
30
|
|
|
21
31
|
if (selector && validTypes.includes(selector[0]?.trim())) {
|
|
22
32
|
return [
|
|
23
33
|
selector[0].trim(),
|
|
24
34
|
selector[1] !== undefined ? selector[1].trim() : "",
|
|
25
35
|
];
|
|
26
|
-
}else{
|
|
27
|
-
return selector.join("=")
|
|
36
|
+
} else {
|
|
37
|
+
return selector.join("=");
|
|
28
38
|
}
|
|
29
39
|
}
|
|
30
40
|
|
|
@@ -48,7 +58,7 @@ function getElement(element) {
|
|
|
48
58
|
locator = context.page.locator(`xpath=${selector[1]}`, { exact: true });
|
|
49
59
|
break;
|
|
50
60
|
case "name":
|
|
51
|
-
locator = context.page.locator(`[name="${selector[1]"
|
|
61
|
+
locator = context.page.locator(`[name="${selector[1]}"]`, {
|
|
52
62
|
exact: true,
|
|
53
63
|
});
|
|
54
64
|
break;
|
|
@@ -86,7 +96,7 @@ function extractVarsFromResponse(responseBody, vars, customVarName) {
|
|
|
86
96
|
const keys = path.split(".");
|
|
87
97
|
let current = obj;
|
|
88
98
|
|
|
89
|
-
if(typeof obj ==
|
|
99
|
+
if (typeof obj == "string") return obj;
|
|
90
100
|
|
|
91
101
|
for (const key of keys) {
|
|
92
102
|
if (current && typeof current === "object" && key in current) {
|
package/src/hooks/hooks.js
CHANGED
|
@@ -38,11 +38,12 @@ Before(async function () {
|
|
|
38
38
|
|
|
39
39
|
await context.page.setDefaultTimeout(cucumberConfig.default.timeout);
|
|
40
40
|
|
|
41
|
-
process.env.TRACE &&
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
process.env.TRACE &&
|
|
42
|
+
(await context.browserContext.tracing.start({
|
|
43
|
+
sources: true,
|
|
44
|
+
screenshots: true,
|
|
45
|
+
snapshots: true,
|
|
46
|
+
}));
|
|
46
47
|
});
|
|
47
48
|
|
|
48
49
|
BeforeStep(async function ({ pickleStep }) {
|
|
@@ -93,9 +94,10 @@ After(async function ({ pickle, result }) {
|
|
|
93
94
|
"",
|
|
94
95
|
);
|
|
95
96
|
|
|
96
|
-
process.env.TRACE &&
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
process.env.TRACE &&
|
|
98
|
+
(await context.browserContext.tracing.stop({
|
|
99
|
+
path: path.join(moduleConfig.projectPath, "./trace.zip"),
|
|
100
|
+
}));
|
|
99
101
|
|
|
100
102
|
if (context.response) {
|
|
101
103
|
for (const [key, value] of Object.entries(context.response)) {
|