tomation 0.0.12 → 0.0.14
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/dist/main.cjs +1 -1
- package/dist/main.js +429 -369
- package/dist/src/dom/actions.d.ts +2 -0
- package/dist/src/dsl/test.d.ts +3 -1
- package/dist/src/engine/compiler.d.ts +1 -1
- package/dist/src/engine/events.d.ts +35 -5
- package/dist/src/engine/runner.d.ts +6 -3
- package/dist/src/feedback/logger.d.ts +7 -5
- package/package.json +2 -2
- package/dist/main.d.ts +0 -1
package/dist/main.js
CHANGED
|
@@ -1,40 +1,54 @@
|
|
|
1
|
+
//#region src/feedback/logger.ts
|
|
2
|
+
var e = !1, t = () => {}, n = {
|
|
3
|
+
setEnabled(t) {
|
|
4
|
+
e = t;
|
|
5
|
+
},
|
|
6
|
+
log: t,
|
|
7
|
+
group: t,
|
|
8
|
+
groupCollapsed: t,
|
|
9
|
+
groupEnd: t,
|
|
10
|
+
error: t,
|
|
11
|
+
warn: t
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(n, "log", { get: () => e ? console.log.bind(console, "[tomation]") : t }), Object.defineProperty(n, "groupCollapsed", { get: () => e ? console.groupCollapsed.bind(console, "[tomation]") : t }), Object.defineProperty(n, "group", { get: () => e ? console.group.bind(console, "[tomation]") : t }), Object.defineProperty(n, "groupEnd", { get: () => e ? console.groupEnd.bind(console) : t }), Object.defineProperty(n, "error", { get: () => e ? console.error.bind(console, "[tomation]") : t }), Object.defineProperty(n, "warn", { get: () => e ? console.warn.bind(console, "[tomation]") : t });
|
|
14
|
+
//#endregion
|
|
1
15
|
//#region src/dsl/ui-element-filters.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
},
|
|
5
|
-
let
|
|
6
|
-
return
|
|
7
|
-
},
|
|
8
|
-
let
|
|
9
|
-
return
|
|
10
|
-
},
|
|
11
|
-
let
|
|
12
|
-
return
|
|
13
|
-
},
|
|
14
|
-
let
|
|
15
|
-
return
|
|
16
|
-
},
|
|
17
|
-
let
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
let
|
|
21
|
-
return
|
|
22
|
-
},
|
|
23
|
-
let
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
let
|
|
27
|
-
return
|
|
28
|
-
},
|
|
29
|
-
let
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
let
|
|
33
|
-
let a = e(
|
|
34
|
-
return
|
|
16
|
+
var r = !1, i = (...e) => {
|
|
17
|
+
r && n.log("[UIElement Filter]", ...e);
|
|
18
|
+
}, a = (e) => (t) => {
|
|
19
|
+
let n = t.className == e;
|
|
20
|
+
return i(`classIs('${e}') on`, t, "=>", n), n;
|
|
21
|
+
}, o = (e) => (t) => {
|
|
22
|
+
let n = t.className.split(" ").includes(e);
|
|
23
|
+
return i(`classIncludes('${e}') on`, t, "=>", n), n;
|
|
24
|
+
}, s = (e) => (t) => {
|
|
25
|
+
let n = t.textContent?.trim() == e;
|
|
26
|
+
return i(`innerTextIs('${e}') on`, t, "=>", n), n;
|
|
27
|
+
}, c = (e) => (t) => {
|
|
28
|
+
let n = t.innerText.trim().includes(e);
|
|
29
|
+
return i(`innerTextContains('${e}') on`, t, "=>", n), n;
|
|
30
|
+
}, l = (e) => (t) => {
|
|
31
|
+
let n = t.title == e;
|
|
32
|
+
return i(`titleIs('${e}') on`, t, "=>", n), n;
|
|
33
|
+
}, u = (e) => (t) => {
|
|
34
|
+
let n = t.placeholder === e;
|
|
35
|
+
return i(`placeholderIs('${e}') on`, t, "=>", n), n;
|
|
36
|
+
}, d = () => (e, t) => {
|
|
37
|
+
let n = t === 0;
|
|
38
|
+
return i("isFirstElement on", e, "index", t, "=>", n), n;
|
|
39
|
+
}, f = (e) => (t, n) => {
|
|
40
|
+
let r = n === e;
|
|
41
|
+
return i(`elementIndexIs(${e}) on`, t, "elemIndex", n, "=>", r), r;
|
|
42
|
+
}, ee = (e) => (t) => {
|
|
43
|
+
let n = (t?.firstChild).innerText.trim() === e;
|
|
44
|
+
return i(`firstChildTextIs('${e}') on`, t, "=>", n), n;
|
|
45
|
+
}, te = (e) => (t, n) => {
|
|
46
|
+
let r = e.every((e, r) => {
|
|
47
|
+
let a = e(t, n);
|
|
48
|
+
return i(`and condition[${r}] on`, t, "elemIndex", n, "=>", a), a;
|
|
35
49
|
});
|
|
36
|
-
return
|
|
37
|
-
},
|
|
50
|
+
return i("and final result on", t, "elemIndex", n, "=>", r), r;
|
|
51
|
+
}, p = class {
|
|
38
52
|
name;
|
|
39
53
|
selector;
|
|
40
54
|
parent;
|
|
@@ -46,73 +60,73 @@ var e = !1, t = (...t) => {
|
|
|
46
60
|
let e = "";
|
|
47
61
|
return this.parent && (e = " in " + this.parent.getElementName()), `${this.name}${e}`;
|
|
48
62
|
}
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
e.style.display !== "none" &&
|
|
63
|
+
}, m, ne = (e) => {
|
|
64
|
+
m = e;
|
|
65
|
+
}, h = (e, t) => (r = m, i) => {
|
|
66
|
+
r ||= m, n.log("Searching elem from Root = ", r);
|
|
67
|
+
let a = [];
|
|
68
|
+
r.querySelectorAll(e).forEach((e) => {
|
|
69
|
+
e.style.display !== "none" && a.push(e);
|
|
56
70
|
});
|
|
57
|
-
let
|
|
58
|
-
return t ? (
|
|
59
|
-
|
|
60
|
-
let
|
|
61
|
-
return
|
|
62
|
-
})[0]) :
|
|
63
|
-
},
|
|
64
|
-
...
|
|
65
|
-
postProcess: (n) => ({ ...
|
|
66
|
-
}),
|
|
67
|
-
...
|
|
68
|
-
childOf: (t) => ({ ...
|
|
69
|
-
postProcess: (t) => ({ ...
|
|
70
|
-
}),
|
|
71
|
-
DIV:
|
|
72
|
-
BUTTON:
|
|
73
|
-
INPUT:
|
|
74
|
-
TEXTAREA:
|
|
75
|
-
ELEMENT: (e) =>
|
|
76
|
-
identifiedBy: (e) =>
|
|
77
|
-
},
|
|
78
|
-
return e.ACTION_UPDATE = "tomation-action-update", e.SAVE_VALUE = "tomation-save-value", e.REGISTER_TEST = "tomation-register-test", e.TEST_STARTED = "tomation-test-started", e.TEST_PASSED = "tomation-test-passed", e.TEST_FAILED = "tomation-test-failed", e.TEST_END = "tomation-test-end", e.TEST_STOP = "tomation-test-stop", e.TEST_PAUSE = "tomation-test-pause", e.TEST_PLAY = "tomation-test-play", e.USER_ACCEPT = "tomation-user-accept", e.USER_REJECT = "tomation-user-reject", e.SESSION_INIT = "tomation-session-init", e.URL_MISMATCH = "tomation-url-mismatch", e.SESSION_CONNECTED = "tomation-session-connected", e;
|
|
79
|
-
}(
|
|
71
|
+
let o;
|
|
72
|
+
return t ? (n.log("Applying filter ", t), n.log(" -- to " + a.length + "elements: ", a), o = a.filter((e, r, i) => {
|
|
73
|
+
n.log("Apply filter to item " + r + ": ", e);
|
|
74
|
+
let a = t(e, r, i);
|
|
75
|
+
return n.log(` -> Item ${r} ${a ? "Match" : "Discarded"}`), a;
|
|
76
|
+
})[0]) : o = a[0], o && i && (n.log("Apply post process to = ", o), o = i(o)), n.log("Return elem = ", o), o;
|
|
77
|
+
}, g = (e, t, n) => ({ as: (r) => new p(r, e, t, n) }), re = (e, t) => ({
|
|
78
|
+
...g(e, t),
|
|
79
|
+
postProcess: (n) => ({ ...g(e, t, n) })
|
|
80
|
+
}), _ = (e) => ({
|
|
81
|
+
...g(e, null),
|
|
82
|
+
childOf: (t) => ({ ...re(e, t) }),
|
|
83
|
+
postProcess: (t) => ({ ...g(e, null, t) })
|
|
84
|
+
}), v = (e) => ({ where: (t) => _(h(e, t)) }), ie = {
|
|
85
|
+
DIV: v("div"),
|
|
86
|
+
BUTTON: v("button"),
|
|
87
|
+
INPUT: v("input"),
|
|
88
|
+
TEXTAREA: v("textarea"),
|
|
89
|
+
ELEMENT: (e) => v(e),
|
|
90
|
+
identifiedBy: (e) => _(h("#" + e))
|
|
91
|
+
}, y = /* @__PURE__ */ function(e) {
|
|
92
|
+
return e.ACTION_UPDATE = "tomation-action-update", e.SAVE_VALUE = "tomation-save-value", e.REGISTER_TEST = "tomation-register-test", e.TEST_STARTED = "tomation-test-started", e.TEST_PASSED = "tomation-test-passed", e.TEST_FAILED = "tomation-test-failed", e.TEST_END = "tomation-test-end", e.TEST_STOP = "tomation-test-stop", e.TEST_PAUSE = "tomation-test-pause", e.TEST_PLAY = "tomation-test-play", e.USER_ACCEPT = "tomation-user-accept", e.USER_REJECT = "tomation-user-reject", e.SESSION_INIT = "tomation-session-init", e.URL_MISMATCH = "tomation-url-mismatch", e.SESSION_CONNECTED = "tomation-session-connected", e.CLEAR_TESTS = "tomation-clear-tests", e.TESTS_LOADED = "tomation-tests-loaded", e;
|
|
93
|
+
}(y || {}), b = new class {
|
|
80
94
|
events;
|
|
81
95
|
constructor() {
|
|
82
96
|
this.events = /* @__PURE__ */ new Map();
|
|
83
97
|
}
|
|
84
98
|
on(e, t) {
|
|
85
|
-
this.events.has(e) || this.events.set(e,
|
|
99
|
+
return this.events.has(e) || this.events.set(e, /* @__PURE__ */ new Set()), this.events.get(e)?.add(t), () => this.off(e, t);
|
|
86
100
|
}
|
|
87
101
|
off(e, t) {
|
|
88
|
-
|
|
102
|
+
let n = this.events.get(e);
|
|
103
|
+
n && (n.delete(t), n.size === 0 && this.events.delete(e));
|
|
89
104
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
105
|
+
once(e, t) {
|
|
106
|
+
let n = async (r) => {
|
|
107
|
+
this.off(e, n), await t(r);
|
|
108
|
+
};
|
|
109
|
+
return this.on(e, n);
|
|
94
110
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
log(...e) {
|
|
100
|
-
b && console.log("[tomation]", ...e);
|
|
101
|
-
},
|
|
102
|
-
groupCollapsed(...e) {
|
|
103
|
-
b && console.groupCollapsed("[tomation]", ...e);
|
|
104
|
-
},
|
|
105
|
-
groupEnd() {
|
|
106
|
-
b && console.groupEnd();
|
|
107
|
-
},
|
|
108
|
-
error(...e) {
|
|
109
|
-
b && console.error("[tomation]", ...e);
|
|
111
|
+
async dispatch(e, t) {
|
|
112
|
+
let n = this.events.get(e);
|
|
113
|
+
if (!(!n || n.size === 0)) for (let e of Array.from(n)) await e(t);
|
|
110
114
|
}
|
|
111
|
-
|
|
115
|
+
clear(e) {
|
|
116
|
+
if (e) {
|
|
117
|
+
this.events.delete(e);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.events.clear();
|
|
121
|
+
}
|
|
122
|
+
listenerCount(e) {
|
|
123
|
+
return this.events.get(e)?.size ?? 0;
|
|
124
|
+
}
|
|
125
|
+
}(), x = (e = 2e3) => new Promise((t) => {
|
|
112
126
|
setTimeout(() => {
|
|
113
127
|
t(null);
|
|
114
128
|
}, e);
|
|
115
|
-
}),
|
|
129
|
+
}), S = (e, t) => {
|
|
116
130
|
Object.entries(t).map(([e, t]) => ({
|
|
117
131
|
key: e,
|
|
118
132
|
value: t
|
|
@@ -120,7 +134,7 @@ var e = !1, t = (...t) => {
|
|
|
120
134
|
let { key: n, value: r } = t;
|
|
121
135
|
e.style[n] = r;
|
|
122
136
|
});
|
|
123
|
-
},
|
|
137
|
+
}, ae = class {
|
|
124
138
|
window;
|
|
125
139
|
document;
|
|
126
140
|
devToolsMessageContainer;
|
|
@@ -218,35 +232,35 @@ var e = !1, t = (...t) => {
|
|
|
218
232
|
}
|
|
219
233
|
createElement(e, t) {
|
|
220
234
|
let n = this.document.createElement(e);
|
|
221
|
-
return t && (t.id && (n.id = t?.id), t.styles &&
|
|
235
|
+
return t && (t.id && (n.id = t?.id), t.styles && S(n, t.styles), t.parent && t.parent.appendChild(n)), n;
|
|
222
236
|
}
|
|
223
237
|
async logAction(e) {
|
|
224
|
-
let t =
|
|
225
|
-
t.innerText = e,
|
|
238
|
+
let t = D.document.createElement("DIV");
|
|
239
|
+
t.innerText = e, S(t, {
|
|
226
240
|
padding: "3px 10px",
|
|
227
241
|
opacity: "1",
|
|
228
242
|
transition: "opacity 1s"
|
|
229
|
-
}), this.devToolsMessageContainer.appendChild(t), await
|
|
243
|
+
}), this.devToolsMessageContainer.appendChild(t), await x(4e3), t.style.opacity = "0", await x(4e3), this.devToolsMessageContainer.removeChild(t), await x(1e3);
|
|
230
244
|
}
|
|
231
245
|
async checkElement(e, t) {
|
|
232
246
|
if (!e) return;
|
|
233
247
|
let n = e.getBoundingClientRect(), r = this.document.body.getBoundingClientRect();
|
|
234
|
-
this.darkLayerLeft.style.left = "0px", this.darkLayerLeft.style.top = n.top + "px", this.darkLayerLeft.style.width = this.window.scrollX + n.left + "px", this.darkLayerLeft.style.height = n.height + "px", this.darkLayerTop.style.left = this.window.scrollX + "px", this.darkLayerTop.style.top = "0px", this.darkLayerTop.style.width = "100%", this.darkLayerTop.style.height = n.top + "px", this.darkLayerRight.style.left = this.window.scrollX + n.left + n.width + "px", this.darkLayerRight.style.top = n.top + "px", this.darkLayerRight.style.width = r.width - (n.left + n.width) + "px", this.darkLayerRight.style.height = n.height + "px", this.darkLayerBottom.style.left = this.window.scrollX + "px", this.darkLayerBottom.style.top = n.top + n.height + "px", this.darkLayerBottom.style.width = "100%", this.darkLayerBottom.style.height = r.height - (n.top + n.height) + "px", this.currentCheckElem.id = `dev-tools-current-check-elem-${t}`, this.currentCheckElem.style.top = n.top + "px", this.currentCheckElem.style.left = this.window.scrollX + n.left + "px", this.currentCheckElem.style.height = n.height + "px", this.currentCheckElem.style.width = n.width + "px", this.currentCheckElem.style.boxShadow = "0px 0px 5px 2px lightgreen", this.currentCheckElem.style.position = "absolute", this.currentCheckElem.style.zIndex = "9992", this.devToolsCheckElementContainer.style.display = "block", this.devToolsCheckElementContainer.style.opacity = "1", await
|
|
248
|
+
this.darkLayerLeft.style.left = "0px", this.darkLayerLeft.style.top = n.top + "px", this.darkLayerLeft.style.width = this.window.scrollX + n.left + "px", this.darkLayerLeft.style.height = n.height + "px", this.darkLayerTop.style.left = this.window.scrollX + "px", this.darkLayerTop.style.top = "0px", this.darkLayerTop.style.width = "100%", this.darkLayerTop.style.height = n.top + "px", this.darkLayerRight.style.left = this.window.scrollX + n.left + n.width + "px", this.darkLayerRight.style.top = n.top + "px", this.darkLayerRight.style.width = r.width - (n.left + n.width) + "px", this.darkLayerRight.style.height = n.height + "px", this.darkLayerBottom.style.left = this.window.scrollX + "px", this.darkLayerBottom.style.top = n.top + n.height + "px", this.darkLayerBottom.style.width = "100%", this.darkLayerBottom.style.height = r.height - (n.top + n.height) + "px", this.currentCheckElem.id = `dev-tools-current-check-elem-${t}`, this.currentCheckElem.style.top = n.top + "px", this.currentCheckElem.style.left = this.window.scrollX + n.left + "px", this.currentCheckElem.style.height = n.height + "px", this.currentCheckElem.style.width = n.width + "px", this.currentCheckElem.style.boxShadow = "0px 0px 5px 2px lightgreen", this.currentCheckElem.style.position = "absolute", this.currentCheckElem.style.zIndex = "9992", this.devToolsCheckElementContainer.style.display = "block", this.devToolsCheckElementContainer.style.opacity = "1", await x(200);
|
|
235
249
|
}
|
|
236
250
|
async showAlert(e) {
|
|
237
|
-
let t =
|
|
238
|
-
t.innerText = e,
|
|
251
|
+
let t = D.document.createElement("DIV"), n = D.document.body;
|
|
252
|
+
t.innerText = e, S(n, { paddingTop: "30px" }), S(this.devToolsAlertContainer, { display: "flex" }), this.devToolsAlertContainer.appendChild(t);
|
|
239
253
|
}
|
|
240
254
|
async hideAlert() {
|
|
241
|
-
|
|
242
|
-
let e =
|
|
243
|
-
|
|
255
|
+
S(this.devToolsAlertContainer, { display: "none" });
|
|
256
|
+
let e = D.document.body;
|
|
257
|
+
S(e, { paddingTop: "0" }), this.devToolsAlertContainer.firstChild && this.devToolsAlertContainer.removeChild(this.devToolsAlertContainer.firstChild);
|
|
244
258
|
}
|
|
245
259
|
async hideCheckElementContainer() {
|
|
246
|
-
this.devToolsCheckElementContainer.style.opacity = "0", await
|
|
260
|
+
this.devToolsCheckElementContainer.style.opacity = "0", await x(200), this.devToolsCheckElementContainer.style.display = "none";
|
|
247
261
|
}
|
|
248
262
|
displayContext(e) {
|
|
249
|
-
|
|
263
|
+
S(this.contextViewerContainer, {
|
|
250
264
|
display: "flex",
|
|
251
265
|
"background-color": "white",
|
|
252
266
|
position: "absolute",
|
|
@@ -255,39 +269,39 @@ var e = !1, t = (...t) => {
|
|
|
255
269
|
"z-index": "9999"
|
|
256
270
|
});
|
|
257
271
|
let t = this.document.createElement("DIV");
|
|
258
|
-
t.id = "context-viewer-before",
|
|
272
|
+
t.id = "context-viewer-before", S(t, {
|
|
259
273
|
flex: "50%",
|
|
260
274
|
width: "100%",
|
|
261
275
|
height: "auto",
|
|
262
276
|
border: "2px solid orange"
|
|
263
277
|
});
|
|
264
278
|
let n = this.document.createElement("DIV");
|
|
265
|
-
n.id = "context-viewer-after",
|
|
279
|
+
n.id = "context-viewer-after", S(n, {
|
|
266
280
|
flex: "50%",
|
|
267
281
|
width: "100%",
|
|
268
282
|
height: "auto",
|
|
269
283
|
border: "2px solid green"
|
|
270
284
|
});
|
|
271
285
|
let r = this.document.createElement("DIV");
|
|
272
|
-
r.innerHTML = e.beforeHTML,
|
|
286
|
+
r.innerHTML = e.beforeHTML, C(r, e.beforeInputValues);
|
|
273
287
|
let i = this.document.createElement("DIV");
|
|
274
|
-
i.innerHTML = e.afterHTML,
|
|
288
|
+
i.innerHTML = e.afterHTML, C(i, e.afterInputValues), this.contextViewerContainer.appendChild(t), t.appendChild(r), setTimeout(() => {
|
|
275
289
|
this.contextViewerContainer.removeChild(t), this.contextViewerContainer.appendChild(n), n.appendChild(i), setTimeout(() => {
|
|
276
|
-
this.contextViewerContainer.removeChild(n),
|
|
290
|
+
this.contextViewerContainer.removeChild(n), S(this.contextViewerContainer, { display: "none" });
|
|
277
291
|
}, 2e3);
|
|
278
292
|
}, 2e3);
|
|
279
293
|
}
|
|
280
|
-
},
|
|
294
|
+
}, C = (e, t) => {
|
|
281
295
|
e.querySelectorAll("input").forEach((e) => {
|
|
282
296
|
e.value = t[e.getAttribute("input-id") || ""];
|
|
283
297
|
});
|
|
284
|
-
},
|
|
298
|
+
}, w = /* @__PURE__ */ function(e) {
|
|
285
299
|
return e[e.SLOW = 2e3] = "SLOW", e[e.NORMAL = 1e3] = "NORMAL", e[e.FAST = 200] = "FAST", e;
|
|
286
|
-
}(
|
|
300
|
+
}(w || {}), T = /* @__PURE__ */ function(e) {
|
|
287
301
|
return e.PLAYING = "Playing", e.STOPPED = "Stopped", e.PAUSED = "Paused", e;
|
|
288
|
-
}(
|
|
302
|
+
}(T || {}), E = /* @__PURE__ */ function(e) {
|
|
289
303
|
return e.NORMAL = "Normal", e.STEPBYSTEP = "Step By Step", e;
|
|
290
|
-
}(
|
|
304
|
+
}(E || {}), oe = class {
|
|
291
305
|
_document;
|
|
292
306
|
debug;
|
|
293
307
|
_uiUtils;
|
|
@@ -296,8 +310,9 @@ var e = !1, t = (...t) => {
|
|
|
296
310
|
runMode;
|
|
297
311
|
currentActionCallback;
|
|
298
312
|
currentAction;
|
|
299
|
-
|
|
300
|
-
|
|
313
|
+
tests;
|
|
314
|
+
constructor(e, t) {
|
|
315
|
+
this._document = e.document, this.debug = !0, this._uiUtils = new ae(e), this.speed = w.NORMAL, this.status = T.STOPPED, this.tests = t, this.runMode = E.NORMAL;
|
|
301
316
|
}
|
|
302
317
|
get document() {
|
|
303
318
|
return this._document;
|
|
@@ -306,131 +321,140 @@ var e = !1, t = (...t) => {
|
|
|
306
321
|
return this._uiUtils;
|
|
307
322
|
}
|
|
308
323
|
get isStepByStepMode() {
|
|
309
|
-
return this.runMode ==
|
|
324
|
+
return this.runMode == E.STEPBYSTEP;
|
|
310
325
|
}
|
|
311
326
|
get isStopped() {
|
|
312
|
-
return this.status ==
|
|
327
|
+
return this.status == T.STOPPED;
|
|
313
328
|
}
|
|
314
329
|
get isPlaying() {
|
|
315
|
-
return this.status ==
|
|
330
|
+
return this.status == T.PLAYING;
|
|
316
331
|
}
|
|
317
332
|
get isPaused() {
|
|
318
|
-
return this.status ==
|
|
333
|
+
return this.status == T.PAUSED;
|
|
319
334
|
}
|
|
320
335
|
pause() {
|
|
321
|
-
|
|
336
|
+
n.log("Pause Test"), this.status = T.PAUSED, b.dispatch(y.TEST_PAUSE);
|
|
322
337
|
}
|
|
323
338
|
continue() {
|
|
324
|
-
|
|
339
|
+
n.log("Continue Test"), this.status = T.PLAYING, this.runMode = E.NORMAL, b.dispatch(y.TEST_PLAY), this.currentActionCallback && this.currentAction && (n.log("Continue: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
325
340
|
}
|
|
326
341
|
next() {
|
|
327
|
-
|
|
342
|
+
n.log("Continue Test to Next Step..."), this.status = T.PLAYING, this.runMode = E.STEPBYSTEP, b.dispatch(y.TEST_PLAY), this.currentActionCallback && this.currentAction && (n.log("Next: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
328
343
|
}
|
|
329
344
|
stop() {
|
|
330
|
-
|
|
345
|
+
n.log("Stop Test"), this.status = T.STOPPED, this.currentActionCallback && this.currentAction && (n.log("Stop: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0), b.dispatch(y.TEST_STOP);
|
|
331
346
|
}
|
|
332
347
|
retryAction() {
|
|
333
|
-
|
|
348
|
+
n.log("Retry current step"), this.status = T.PLAYING, b.dispatch(y.TEST_PLAY), this.currentActionCallback && this.currentAction && (this.currentAction.resetTries && (n.log("Retry: Resetting tries for current action"), this.currentAction.resetTries()), n.log("Retry: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
334
349
|
}
|
|
335
350
|
skipAction() {
|
|
336
|
-
|
|
351
|
+
n.log("Skip current step"), this.status = T.PLAYING, this.currentActionCallback && this.currentAction && (this.currentAction.status = I.SKIPPED, n.log("Skip: Marked current action as SKIPPED"), L.notifyActionUpdated(this.currentAction), n.log("Skip: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
337
352
|
}
|
|
338
353
|
saveCurrentAction(e, t) {
|
|
339
|
-
|
|
354
|
+
n.log("Save current action"), this.currentActionCallback = e, this.currentAction = t;
|
|
340
355
|
}
|
|
341
356
|
setDebug(e) {
|
|
342
|
-
|
|
357
|
+
n.setEnabled(e);
|
|
358
|
+
}
|
|
359
|
+
setupTests() {
|
|
360
|
+
console.log("[tomation] Setting up tests..."), this.tests?.forEach((e) => e()), b.dispatch(y.TESTS_LOADED);
|
|
361
|
+
}
|
|
362
|
+
getTests() {
|
|
363
|
+
return this.tests;
|
|
343
364
|
}
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
365
|
+
}, D, O = (e, t) => {
|
|
366
|
+
if (D) throw Error("Automation Setup already executed.");
|
|
367
|
+
return D = new oe(e, t || []), ne(D.document), D;
|
|
368
|
+
}, k = !1;
|
|
369
|
+
async function se(e) {
|
|
370
|
+
if (k) throw n.error("Not able to run test while other test is running."), Error("Not able to run test while other test is running.");
|
|
371
|
+
k = !0, D.status = T.PLAYING, D.runMode = E.NORMAL, n.groupCollapsed("Start Action: ", e.getDescription()), b.dispatch(y.TEST_STARTED, { action: e?.getJSON() });
|
|
348
372
|
try {
|
|
349
|
-
await e?.execute(),
|
|
373
|
+
await e?.execute(), b.dispatch(y.TEST_PASSED, { id: e.name });
|
|
350
374
|
} catch (t) {
|
|
351
|
-
throw
|
|
375
|
+
throw b.dispatch(y.TEST_FAILED, { id: e.name }), D.uiUtils.hideCheckElementContainer(), n.error(`🤖 Error running task ${e.getDescription()}. Reason: ${t.message}`), t;
|
|
352
376
|
} finally {
|
|
353
|
-
|
|
377
|
+
n.groupEnd(), k = !1, b.dispatch(y.TEST_END, { action: e?.getJSON() });
|
|
354
378
|
}
|
|
355
379
|
}
|
|
356
|
-
var
|
|
357
|
-
start:
|
|
380
|
+
var A = {
|
|
381
|
+
start: se,
|
|
358
382
|
get running() {
|
|
359
|
-
return
|
|
383
|
+
return k;
|
|
360
384
|
}
|
|
361
|
-
},
|
|
362
|
-
for (let e = 0; e < 256; ++e)
|
|
363
|
-
function
|
|
364
|
-
return (
|
|
385
|
+
}, j = [];
|
|
386
|
+
for (let e = 0; e < 256; ++e) j.push((e + 256).toString(16).slice(1));
|
|
387
|
+
function ce(e, t = 0) {
|
|
388
|
+
return (j[e[t + 0]] + j[e[t + 1]] + j[e[t + 2]] + j[e[t + 3]] + "-" + j[e[t + 4]] + j[e[t + 5]] + "-" + j[e[t + 6]] + j[e[t + 7]] + "-" + j[e[t + 8]] + j[e[t + 9]] + "-" + j[e[t + 10]] + j[e[t + 11]] + j[e[t + 12]] + j[e[t + 13]] + j[e[t + 14]] + j[e[t + 15]]).toLowerCase();
|
|
365
389
|
}
|
|
366
390
|
//#endregion
|
|
367
391
|
//#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/rng.js
|
|
368
|
-
var
|
|
369
|
-
function
|
|
370
|
-
return crypto.getRandomValues(
|
|
392
|
+
var le = new Uint8Array(16);
|
|
393
|
+
function ue() {
|
|
394
|
+
return crypto.getRandomValues(le);
|
|
371
395
|
}
|
|
372
396
|
//#endregion
|
|
373
397
|
//#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/v4.js
|
|
374
|
-
function
|
|
375
|
-
return !t && !e && crypto.randomUUID ? crypto.randomUUID() :
|
|
398
|
+
function M(e, t, n) {
|
|
399
|
+
return !t && !e && crypto.randomUUID ? crypto.randomUUID() : de(e, t, n);
|
|
376
400
|
}
|
|
377
|
-
function
|
|
401
|
+
function de(e, t, n) {
|
|
378
402
|
e ||= {};
|
|
379
|
-
let r = e.random ?? e.rng?.() ??
|
|
403
|
+
let r = e.random ?? e.rng?.() ?? ue();
|
|
380
404
|
if (r.length < 16) throw Error("Random bytes length must be >= 16");
|
|
381
405
|
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
|
|
382
406
|
if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
|
|
383
407
|
for (let e = 0; e < 16; ++e) t[n + e] = r[e];
|
|
384
408
|
return t;
|
|
385
409
|
}
|
|
386
|
-
return
|
|
410
|
+
return ce(r);
|
|
387
411
|
}
|
|
388
412
|
//#endregion
|
|
389
413
|
//#region src/dom/actions.ts
|
|
390
|
-
var
|
|
391
|
-
if (
|
|
392
|
-
|
|
393
|
-
if (e.status ==
|
|
414
|
+
var N = null, P = async (e, t, r, i = 1e3, a = 0, o = 10, s = !1) => {
|
|
415
|
+
if (n.log("Automation Status: ", D.status), D.isPaused) return new Promise((n, c) => {
|
|
416
|
+
D.saveCurrentAction(async (e) => {
|
|
417
|
+
if (e.status == I.SKIPPED) return n(null);
|
|
394
418
|
try {
|
|
395
|
-
|
|
419
|
+
n(await P(e, t, r, i, a, o, s));
|
|
396
420
|
} catch (e) {
|
|
397
421
|
c(e);
|
|
398
422
|
}
|
|
399
423
|
}, e);
|
|
400
424
|
});
|
|
401
|
-
if (
|
|
402
|
-
if (
|
|
425
|
+
if (D.isStopped) throw Error("Test stopped manually");
|
|
426
|
+
if (n.groupCollapsed(`tries ${a}/${o}`), e && (e.updateTries(a), await L.notifyActionUpdated(e)), a === o) throw n.groupEnd(), Error(s ? `[tomation] UI Element ${t.getElementName() || "UNKNOWN"} still present after 10 tries` : `[tomation] UI Element ${t.getElementName() || "UNKNOWN"} not found after 10 tries`);
|
|
403
427
|
{
|
|
404
|
-
let
|
|
405
|
-
return
|
|
428
|
+
let c = t.selector(r, t.postProcess);
|
|
429
|
+
return n.groupEnd(), c ? s ? (await x(i), await P(e, t, r, i, ++a, o, s)) : (n.log("Element found = ", c), c) : s ? (n.log("Element removed."), N) : (await x(i), await P(e, t, r, i, ++a, o, s));
|
|
406
430
|
}
|
|
407
|
-
},
|
|
408
|
-
let
|
|
409
|
-
|
|
410
|
-
let
|
|
431
|
+
}, F = async (e, t, r = 1e3, i = 10, a = !1) => {
|
|
432
|
+
let o = t?.getElementName();
|
|
433
|
+
n.group("Looking for Element: " + o);
|
|
434
|
+
let s = null;
|
|
411
435
|
if (t.parent) try {
|
|
412
|
-
|
|
436
|
+
n.groupCollapsed("Look for Parent ", t.parent.getElementName()), s = await F(e, t.parent, r, i, a), n.groupEnd();
|
|
413
437
|
} catch (e) {
|
|
414
|
-
if (
|
|
415
|
-
throw
|
|
438
|
+
if (n.groupEnd(), a && e.message.includes("not found")) return n.log("Parent not found, so element was removed"), n.groupEnd(), N;
|
|
439
|
+
throw n.groupEnd(), e;
|
|
416
440
|
}
|
|
417
441
|
try {
|
|
418
|
-
|
|
419
|
-
let
|
|
420
|
-
return
|
|
442
|
+
n.log("Using parent element: ", s);
|
|
443
|
+
let o = await P(e, t, s, r, 0, i, a);
|
|
444
|
+
return n.groupEnd(), o;
|
|
421
445
|
} catch (e) {
|
|
422
|
-
if (
|
|
423
|
-
throw
|
|
446
|
+
if (a && e.message.includes("not found")) return n.log("Parent not found, so element was removed"), n.groupEnd(), N;
|
|
447
|
+
throw n.groupEnd(), e;
|
|
424
448
|
}
|
|
425
|
-
},
|
|
449
|
+
}, I = /* @__PURE__ */ function(e) {
|
|
426
450
|
return e.WAITING = "waiting", e.RUNNING = "running", e.STOPPED = "stopped", e.PAUSED = "paused", e.SUCCESS = "success", e.ERROR = "error", e.SKIPPED = "skipped", e;
|
|
427
|
-
}(
|
|
451
|
+
}(I || {}), L = class e {
|
|
428
452
|
status;
|
|
429
453
|
error;
|
|
430
454
|
id;
|
|
431
455
|
context;
|
|
432
456
|
constructor() {
|
|
433
|
-
this.status =
|
|
457
|
+
this.status = I.WAITING, this.error = "", this.id = M(), this.context = {
|
|
434
458
|
beforeHTML: "",
|
|
435
459
|
beforeInputValues: {},
|
|
436
460
|
afterInputValues: {},
|
|
@@ -450,29 +474,30 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
450
474
|
};
|
|
451
475
|
}
|
|
452
476
|
reset() {
|
|
453
|
-
this.status =
|
|
477
|
+
this.status = I.WAITING, this.error = "", this.resetAction();
|
|
454
478
|
}
|
|
455
479
|
getInputValuesFromPage() {
|
|
456
480
|
let e = {};
|
|
457
|
-
return
|
|
481
|
+
return D.document.querySelectorAll("input").forEach((t, n) => {
|
|
458
482
|
let r = `value-id-${n}`;
|
|
459
483
|
t.setAttribute("input-id", r), e[r] = t.value;
|
|
460
484
|
}), e;
|
|
461
485
|
}
|
|
462
486
|
async execute() {
|
|
463
487
|
try {
|
|
464
|
-
this.status =
|
|
488
|
+
this.status = I.RUNNING, this.context.beforeInputValues = this.getInputValuesFromPage(), this.context.beforeHTML = D.document.body.innerHTML, await e.notifyActionUpdated(this), n.log("Action: ", this.getDescription()), await this.executeAction(), this.status = I.SUCCESS, this.error = "", D.isStepByStepMode && D.pause();
|
|
465
489
|
} catch (e) {
|
|
466
|
-
if (this.status =
|
|
467
|
-
this.status =
|
|
490
|
+
if (this.status = I.ERROR, this.error = e.message, e.message == "Test stopped manually") throw Error("[tomation] Error in Action " + this.getDescription() + ". Message: " + e.message);
|
|
491
|
+
this.status = I.PAUSED, D.pause();
|
|
468
492
|
} finally {
|
|
469
|
-
this.context.afterInputValues = this.getInputValuesFromPage(), this.context.afterHTML =
|
|
493
|
+
this.context.afterInputValues = this.getInputValuesFromPage(), this.context.afterHTML = D.document.body.innerHTML, await e.notifyActionUpdated(this);
|
|
470
494
|
}
|
|
471
495
|
}
|
|
472
496
|
static async notifyActionUpdated(e) {
|
|
473
|
-
|
|
497
|
+
b.dispatch(y.ACTION_UPDATE, { action: e.getJSON() });
|
|
474
498
|
}
|
|
475
|
-
},
|
|
499
|
+
}, R = class e extends L {
|
|
500
|
+
static useImprovedContinue = !0;
|
|
476
501
|
name;
|
|
477
502
|
stepsFn;
|
|
478
503
|
steps;
|
|
@@ -502,9 +527,9 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
502
527
|
this.steps.length = 0, this.index = 0;
|
|
503
528
|
}
|
|
504
529
|
async continue() {
|
|
505
|
-
if (
|
|
506
|
-
|
|
507
|
-
if (n.status ==
|
|
530
|
+
if (D.isPaused) return new Promise((e, t) => {
|
|
531
|
+
D.saveCurrentAction(async (n) => {
|
|
532
|
+
if (n.status == I.SKIPPED) return e();
|
|
508
533
|
try {
|
|
509
534
|
await n.continue(), e();
|
|
510
535
|
} catch (e) {
|
|
@@ -512,14 +537,14 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
512
537
|
}
|
|
513
538
|
}, this);
|
|
514
539
|
});
|
|
515
|
-
if (
|
|
540
|
+
if (D.isStopped) throw Error("Test stopped manually");
|
|
516
541
|
if (this.index < this.steps.length) {
|
|
517
542
|
let e = this.steps[this.index];
|
|
518
543
|
try {
|
|
519
|
-
if (await
|
|
544
|
+
if (await x(D.speed), await e.execute(), !D.isPaused) this.index++, await this.continue();
|
|
520
545
|
else return new Promise((t, n) => {
|
|
521
|
-
|
|
522
|
-
if (r.status ==
|
|
546
|
+
D.saveCurrentAction(async (r) => {
|
|
547
|
+
if (r.status == I.SKIPPED) return this.index++, await L.notifyActionUpdated(e), await this.continue(), t();
|
|
523
548
|
try {
|
|
524
549
|
await r.continue(), t();
|
|
525
550
|
} catch (e) {
|
|
@@ -532,8 +557,44 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
532
557
|
}
|
|
533
558
|
}
|
|
534
559
|
}
|
|
560
|
+
async continueImproved() {
|
|
561
|
+
if (D.isPaused) return new Promise((e, t) => {
|
|
562
|
+
D.saveCurrentAction(async (n) => {
|
|
563
|
+
if (n.status == I.SKIPPED) return e();
|
|
564
|
+
try {
|
|
565
|
+
await n.continueImproved(), e();
|
|
566
|
+
} catch (e) {
|
|
567
|
+
t(e);
|
|
568
|
+
}
|
|
569
|
+
}, this);
|
|
570
|
+
});
|
|
571
|
+
if (D.isStopped) throw Error("Test stopped manually");
|
|
572
|
+
for (console.warn("[tomation] continueImproved is still experimental, not fully working in all scenarios. Use with caution."); this.index < this.steps.length;) {
|
|
573
|
+
let e = this.steps[this.index];
|
|
574
|
+
try {
|
|
575
|
+
if (await x(D.speed), await e.execute(), !D.isPaused) {
|
|
576
|
+
this.index++;
|
|
577
|
+
continue;
|
|
578
|
+
}
|
|
579
|
+
let t = !1;
|
|
580
|
+
if (await new Promise((n, r) => {
|
|
581
|
+
D.saveCurrentAction(async (i) => {
|
|
582
|
+
if (i.status == I.SKIPPED) return this.index++, t = !0, await L.notifyActionUpdated(e), n();
|
|
583
|
+
try {
|
|
584
|
+
await i.continueImproved(), n();
|
|
585
|
+
} catch (e) {
|
|
586
|
+
r(e);
|
|
587
|
+
}
|
|
588
|
+
}, e);
|
|
589
|
+
}), t) continue;
|
|
590
|
+
return;
|
|
591
|
+
} catch (e) {
|
|
592
|
+
throw e;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
535
596
|
async executeAction() {
|
|
536
|
-
this.index = 0, await this.continue();
|
|
597
|
+
this.index = 0, e.useImprovedContinue ? await this.continueImproved() : await this.continue();
|
|
537
598
|
}
|
|
538
599
|
setParams(e) {
|
|
539
600
|
this.params = e;
|
|
@@ -541,7 +602,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
541
602
|
addStep(e) {
|
|
542
603
|
this.steps.push(e);
|
|
543
604
|
}
|
|
544
|
-
},
|
|
605
|
+
}, z = class e extends L {
|
|
545
606
|
uiElement;
|
|
546
607
|
element;
|
|
547
608
|
tries;
|
|
@@ -568,42 +629,42 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
568
629
|
tries: this.tries
|
|
569
630
|
};
|
|
570
631
|
}
|
|
571
|
-
static waitForElement(t,
|
|
572
|
-
let
|
|
573
|
-
return new Promise(async (
|
|
574
|
-
let
|
|
575
|
-
if (
|
|
632
|
+
static waitForElement(t, r, i = 1e3, a = 10, o = !1) {
|
|
633
|
+
let s = r.getElementName();
|
|
634
|
+
return new Promise(async (c, l) => {
|
|
635
|
+
let u = async (e, i = 1e3, o = 0, c = !1) => {
|
|
636
|
+
if (n.groupCollapsed(`tries ${o}/${a}`), t.updateTries(o), await L.notifyActionUpdated(t), o === a) throw n.groupEnd(), Error(c ? `UI Element ${s || "UNKNOWN"} still present after 10 tries` : `UI Element ${s || "UNKNOWN"} not found after 10 tries`);
|
|
576
637
|
{
|
|
577
|
-
let t =
|
|
578
|
-
return
|
|
638
|
+
let t = r.selector(e, r.postProcess);
|
|
639
|
+
return n.groupEnd(), t ? c ? (await x(i), await u(e, i, ++o, c)) : (n.log("Element found = ", t), t) : c ? (n.log("Element removed."), null) : (await x(i), await u(e, i, ++o, c));
|
|
579
640
|
}
|
|
580
641
|
};
|
|
581
|
-
|
|
582
|
-
let
|
|
583
|
-
if (
|
|
584
|
-
|
|
642
|
+
n.group("[Action On Element] Looking for Element: " + s);
|
|
643
|
+
let d = null, f = !0;
|
|
644
|
+
if (r.parent) {
|
|
645
|
+
n.groupCollapsed("Look for Parent ", r.parent.getElementName());
|
|
585
646
|
try {
|
|
586
|
-
|
|
647
|
+
d = await e.waitForElement(t, r.parent, i, a, o);
|
|
587
648
|
} catch {
|
|
588
|
-
|
|
649
|
+
f = !1;
|
|
589
650
|
} finally {
|
|
590
|
-
|
|
651
|
+
n.groupEnd();
|
|
591
652
|
}
|
|
592
653
|
}
|
|
593
|
-
if (
|
|
594
|
-
|
|
654
|
+
if (f) {
|
|
655
|
+
n.log("using parent element: ", d);
|
|
595
656
|
try {
|
|
596
|
-
let e = await
|
|
597
|
-
|
|
657
|
+
let e = await u(d, i, 0, o);
|
|
658
|
+
n.groupEnd(), c(e);
|
|
598
659
|
} catch (e) {
|
|
599
|
-
|
|
660
|
+
n.groupEnd(), l(Error(e.message));
|
|
600
661
|
}
|
|
601
|
-
} else
|
|
662
|
+
} else n.groupEnd(), l(/* @__PURE__ */ Error(`Parent ${r.parent?.getElementName()} of UI Element ${r.name || "UNKNOWN"} not found`));
|
|
602
663
|
});
|
|
603
664
|
}
|
|
604
665
|
async executeAction() {
|
|
605
666
|
try {
|
|
606
|
-
this.element = await
|
|
667
|
+
this.element = await F(this, this.uiElement), this.element?.setAttribute("test-id", this.getElementName()), await D.uiUtils.checkElement(this.element, this.getElementName()), this.executeActionOnElement(), await D.uiUtils.hideCheckElementContainer();
|
|
607
668
|
} catch (e) {
|
|
608
669
|
throw Error(e.message);
|
|
609
670
|
}
|
|
@@ -611,7 +672,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
611
672
|
resetAction() {
|
|
612
673
|
this.element = null, this.resetTries();
|
|
613
674
|
}
|
|
614
|
-
},
|
|
675
|
+
}, fe = class extends z {
|
|
615
676
|
constructor(e) {
|
|
616
677
|
super(e);
|
|
617
678
|
}
|
|
@@ -627,7 +688,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
627
688
|
type: "Click"
|
|
628
689
|
};
|
|
629
690
|
}
|
|
630
|
-
},
|
|
691
|
+
}, pe = class extends z {
|
|
631
692
|
text;
|
|
632
693
|
constructor(e, t) {
|
|
633
694
|
super(e), this.text = t;
|
|
@@ -645,7 +706,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
645
706
|
value: this.text
|
|
646
707
|
};
|
|
647
708
|
}
|
|
648
|
-
},
|
|
709
|
+
}, me = class extends z {
|
|
649
710
|
text;
|
|
650
711
|
constructor(e, t) {
|
|
651
712
|
super(e), this.text = t;
|
|
@@ -663,7 +724,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
663
724
|
value: this.text
|
|
664
725
|
};
|
|
665
726
|
}
|
|
666
|
-
},
|
|
727
|
+
}, he = class extends z {
|
|
667
728
|
value;
|
|
668
729
|
constructor(e, t) {
|
|
669
730
|
super(e), this.value = t;
|
|
@@ -681,7 +742,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
681
742
|
value: this.value
|
|
682
743
|
};
|
|
683
744
|
}
|
|
684
|
-
},
|
|
745
|
+
}, ge = class extends z {
|
|
685
746
|
constructor(e) {
|
|
686
747
|
super(e);
|
|
687
748
|
}
|
|
@@ -697,13 +758,13 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
697
758
|
type: "AssertExistsAction"
|
|
698
759
|
};
|
|
699
760
|
}
|
|
700
|
-
},
|
|
761
|
+
}, _e = class extends z {
|
|
701
762
|
constructor(e) {
|
|
702
763
|
super(e);
|
|
703
764
|
}
|
|
704
765
|
async executeAction() {
|
|
705
766
|
try {
|
|
706
|
-
this.element = await
|
|
767
|
+
this.element = await F(this, this.uiElement, 1e3, 5, !0), this.element?.setAttribute("test-id", this.getElementName()), await D.uiUtils.checkElement(this.element, this.getElementName()), this.executeActionOnElement(), await D.uiUtils.hideCheckElementContainer();
|
|
707
768
|
} catch (e) {
|
|
708
769
|
throw Error(e.message);
|
|
709
770
|
}
|
|
@@ -720,7 +781,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
720
781
|
type: "AssertNotExistsAction"
|
|
721
782
|
};
|
|
722
783
|
}
|
|
723
|
-
},
|
|
784
|
+
}, ve = class extends z {
|
|
724
785
|
value;
|
|
725
786
|
constructor(e, t) {
|
|
726
787
|
super(e), this.value = t;
|
|
@@ -740,7 +801,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
740
801
|
value: this.value
|
|
741
802
|
};
|
|
742
803
|
}
|
|
743
|
-
},
|
|
804
|
+
}, B = class extends z {
|
|
744
805
|
value;
|
|
745
806
|
constructor(e, t) {
|
|
746
807
|
super(e), this.value = t;
|
|
@@ -760,7 +821,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
760
821
|
value: this.value
|
|
761
822
|
};
|
|
762
823
|
}
|
|
763
|
-
},
|
|
824
|
+
}, ye = class extends z {
|
|
764
825
|
value;
|
|
765
826
|
constructor(e, t) {
|
|
766
827
|
super(e), this.value = t;
|
|
@@ -780,7 +841,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
780
841
|
value: this.value
|
|
781
842
|
};
|
|
782
843
|
}
|
|
783
|
-
},
|
|
844
|
+
}, be = class extends z {
|
|
784
845
|
constructor(e) {
|
|
785
846
|
super(e);
|
|
786
847
|
}
|
|
@@ -809,7 +870,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
809
870
|
type: "PressEscKey"
|
|
810
871
|
};
|
|
811
872
|
}
|
|
812
|
-
},
|
|
873
|
+
}, xe = class extends z {
|
|
813
874
|
constructor(e) {
|
|
814
875
|
super(e);
|
|
815
876
|
}
|
|
@@ -838,7 +899,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
838
899
|
type: "PressDownKey"
|
|
839
900
|
};
|
|
840
901
|
}
|
|
841
|
-
},
|
|
902
|
+
}, Se = class extends z {
|
|
842
903
|
constructor(e) {
|
|
843
904
|
super(e);
|
|
844
905
|
}
|
|
@@ -867,7 +928,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
867
928
|
type: "PressTabKey"
|
|
868
929
|
};
|
|
869
930
|
}
|
|
870
|
-
},
|
|
931
|
+
}, Ce = class extends z {
|
|
871
932
|
constructor(e) {
|
|
872
933
|
super(e);
|
|
873
934
|
}
|
|
@@ -896,23 +957,23 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
896
957
|
type: "PressEnterKey"
|
|
897
958
|
};
|
|
898
959
|
}
|
|
899
|
-
},
|
|
960
|
+
}, V = /* @__PURE__ */ function(e) {
|
|
900
961
|
return e.ESCAPE = "Escape", e.ENTER = "Enter", e.TAB = "Tab", e.ARROW_DOWN = "ArrowDown", e.ARROW_UP = "ArrowUp", e.ARROW_LEFT = "ArrowLeft", e.ARROW_RIGHT = "ArrowRight", e.BACKSPACE = "Backspace", e.DELETE = "Delete", e.SHIFT = "Shift", e.CONTROL = "Control", e.ALT = "Alt", e.META = "Meta", e;
|
|
901
|
-
}(
|
|
902
|
-
[
|
|
903
|
-
[
|
|
904
|
-
[
|
|
905
|
-
[
|
|
906
|
-
[
|
|
907
|
-
[
|
|
908
|
-
[
|
|
909
|
-
[
|
|
910
|
-
[
|
|
911
|
-
[
|
|
912
|
-
[
|
|
913
|
-
[
|
|
914
|
-
[
|
|
915
|
-
},
|
|
962
|
+
}(V || {}), H = {
|
|
963
|
+
[V.ESCAPE]: 27,
|
|
964
|
+
[V.ENTER]: 13,
|
|
965
|
+
[V.TAB]: 9,
|
|
966
|
+
[V.ARROW_DOWN]: 40,
|
|
967
|
+
[V.ARROW_UP]: 38,
|
|
968
|
+
[V.ARROW_LEFT]: 37,
|
|
969
|
+
[V.ARROW_RIGHT]: 39,
|
|
970
|
+
[V.BACKSPACE]: 8,
|
|
971
|
+
[V.DELETE]: 46,
|
|
972
|
+
[V.SHIFT]: 16,
|
|
973
|
+
[V.CONTROL]: 17,
|
|
974
|
+
[V.ALT]: 18,
|
|
975
|
+
[V.META]: 91
|
|
976
|
+
}, we = class extends z {
|
|
916
977
|
key;
|
|
917
978
|
constructor(e, t) {
|
|
918
979
|
super(e), this.key = t;
|
|
@@ -921,9 +982,9 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
921
982
|
this.element?.dispatchEvent(new KeyboardEvent("keydown", {
|
|
922
983
|
key: this.key,
|
|
923
984
|
code: this.key,
|
|
924
|
-
keyCode:
|
|
985
|
+
keyCode: H[this.key],
|
|
925
986
|
charCode: 0,
|
|
926
|
-
which:
|
|
987
|
+
which: H[this.key],
|
|
927
988
|
altKey: !1,
|
|
928
989
|
ctrlKey: !1,
|
|
929
990
|
metaKey: !1,
|
|
@@ -943,7 +1004,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
943
1004
|
key: this.key
|
|
944
1005
|
};
|
|
945
1006
|
}
|
|
946
|
-
},
|
|
1007
|
+
}, Te = class extends z {
|
|
947
1008
|
file;
|
|
948
1009
|
constructor(e, t) {
|
|
949
1010
|
super(e), this.file = t;
|
|
@@ -966,7 +1027,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
966
1027
|
type: "UploadFile"
|
|
967
1028
|
};
|
|
968
1029
|
}
|
|
969
|
-
},
|
|
1030
|
+
}, Ee = class extends z {
|
|
970
1031
|
memorySlotName;
|
|
971
1032
|
constructor(e, t) {
|
|
972
1033
|
super(e), this.memorySlotName = t;
|
|
@@ -974,7 +1035,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
974
1035
|
executeActionOnElement() {
|
|
975
1036
|
let e = this.element;
|
|
976
1037
|
if (this.element?.tagName !== "INPUT" && this.element?.tagName !== "SELECT" && this.element?.tagName !== "TEXTAREA" && (e = this.element?.querySelectorAll("input")[0], !e)) throw Error("Input element not found. Not able to save value from element " + this.getElementName());
|
|
977
|
-
|
|
1038
|
+
b.dispatch(y.SAVE_VALUE, {
|
|
978
1039
|
memorySlotName: this.memorySlotName,
|
|
979
1040
|
value: e.value
|
|
980
1041
|
});
|
|
@@ -989,7 +1050,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
989
1050
|
memorySlotName: this.memorySlotName
|
|
990
1051
|
};
|
|
991
1052
|
}
|
|
992
|
-
},
|
|
1053
|
+
}, De = class extends L {
|
|
993
1054
|
miliseconds;
|
|
994
1055
|
constructor(e) {
|
|
995
1056
|
super(), this.miliseconds = e;
|
|
@@ -1004,10 +1065,10 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
1004
1065
|
};
|
|
1005
1066
|
}
|
|
1006
1067
|
async executeAction() {
|
|
1007
|
-
await
|
|
1068
|
+
await x(this.miliseconds);
|
|
1008
1069
|
}
|
|
1009
1070
|
resetAction() {}
|
|
1010
|
-
},
|
|
1071
|
+
}, Oe = class extends L {
|
|
1011
1072
|
uiElement;
|
|
1012
1073
|
tries;
|
|
1013
1074
|
constructor(e) {
|
|
@@ -1023,7 +1084,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
1023
1084
|
return this.uiElement?.getElementName();
|
|
1024
1085
|
}
|
|
1025
1086
|
async executeAction() {
|
|
1026
|
-
await
|
|
1087
|
+
await F(this, this.uiElement, 1e3, 10, !0);
|
|
1027
1088
|
}
|
|
1028
1089
|
getDescription() {
|
|
1029
1090
|
return "Wait until " + this.getElementName() + " is removed";
|
|
@@ -1034,7 +1095,7 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
1034
1095
|
type: "WaitUntilElementRemoved"
|
|
1035
1096
|
};
|
|
1036
1097
|
}
|
|
1037
|
-
},
|
|
1098
|
+
}, ke = class extends L {
|
|
1038
1099
|
constructor() {
|
|
1039
1100
|
super();
|
|
1040
1101
|
}
|
|
@@ -1048,10 +1109,10 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
1048
1109
|
};
|
|
1049
1110
|
}
|
|
1050
1111
|
async executeAction() {
|
|
1051
|
-
await
|
|
1112
|
+
await D.pause();
|
|
1052
1113
|
}
|
|
1053
1114
|
resetAction() {}
|
|
1054
|
-
},
|
|
1115
|
+
}, Ae = class extends L {
|
|
1055
1116
|
description;
|
|
1056
1117
|
constructor(e) {
|
|
1057
1118
|
super(), this.description = e;
|
|
@@ -1066,12 +1127,12 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
1066
1127
|
};
|
|
1067
1128
|
}
|
|
1068
1129
|
async executeAction() {
|
|
1069
|
-
return await
|
|
1070
|
-
|
|
1130
|
+
return await D.uiUtils.showAlert("Waiting manual step..."), new Promise((e, t) => {
|
|
1131
|
+
b.once(y.USER_ACCEPT, async () => (await D.uiUtils.hideAlert(), e(!0))), b.once(y.USER_REJECT, async () => (await D.uiUtils.hideAlert(), t()));
|
|
1071
1132
|
});
|
|
1072
1133
|
}
|
|
1073
1134
|
resetAction() {}
|
|
1074
|
-
},
|
|
1135
|
+
}, je = class extends L {
|
|
1075
1136
|
constructor() {
|
|
1076
1137
|
super();
|
|
1077
1138
|
}
|
|
@@ -1088,51 +1149,49 @@ var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
|
|
|
1088
1149
|
await location.reload();
|
|
1089
1150
|
}
|
|
1090
1151
|
resetAction() {}
|
|
1091
|
-
}, W, G
|
|
1152
|
+
}, U, W, G = {
|
|
1092
1153
|
init: (e) => {
|
|
1093
|
-
|
|
1154
|
+
U = e, W = !0, n.groupCollapsed("Compile: " + e.getDescription()), e.compileSteps(), W = !1, n.log("Compilation finished"), n.groupEnd();
|
|
1094
1155
|
},
|
|
1095
1156
|
addAction: (e) => {
|
|
1096
|
-
|
|
1157
|
+
n.log("Add action: ", e.getDescription()), U.addStep(e);
|
|
1097
1158
|
},
|
|
1098
1159
|
compileAction: (e) => {
|
|
1099
|
-
let t =
|
|
1100
|
-
|
|
1160
|
+
let t = U;
|
|
1161
|
+
U = e, e.compileSteps(), U = t;
|
|
1101
1162
|
},
|
|
1102
|
-
getCurrentAction: () =>
|
|
1103
|
-
getIsCompiling: () =>
|
|
1104
|
-
}, q = {},
|
|
1105
|
-
if (
|
|
1106
|
-
else throw
|
|
1107
|
-
},
|
|
1108
|
-
|
|
1109
|
-
let
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
}
|
|
1114
|
-
j.start(n);
|
|
1115
|
-
};
|
|
1163
|
+
getCurrentAction: () => U,
|
|
1164
|
+
getIsCompiling: () => W
|
|
1165
|
+
}, K = {}, q = {}, Me = (e) => {
|
|
1166
|
+
if (K[e]) K[e]();
|
|
1167
|
+
else throw n.log("Available Tests:", Object.keys(K)), Error(`[tomation] Test with id ${e} not found.`);
|
|
1168
|
+
}, Ne = (e, t) => {
|
|
1169
|
+
n.log(`Registering Test: ${e}...`);
|
|
1170
|
+
let r = new R(e, t);
|
|
1171
|
+
b.dispatch(y.REGISTER_TEST, { id: e }), n.log(`Registered Test: ${e} in TestsMap`), K[e] = () => {
|
|
1172
|
+
let t = q[e];
|
|
1173
|
+
G.init(t), n.log(`Compiled Test: ${e}`), A.start(t);
|
|
1174
|
+
}, q[e] = r;
|
|
1116
1175
|
};
|
|
1117
1176
|
//#endregion
|
|
1118
1177
|
//#region src/tomation.ts
|
|
1119
1178
|
function J(e) {
|
|
1120
|
-
let { matches: t, tests:
|
|
1121
|
-
if (
|
|
1179
|
+
let { matches: t, tests: r = [], speed: i = "NORMAL", debug: a = !1 } = e, o = M();
|
|
1180
|
+
if (n.log(`Initializing on URL: ${document.location.href} with session ID: ${o}`), window.postMessage({
|
|
1122
1181
|
message: "injectedScript-to-contentScript",
|
|
1123
1182
|
sender: "tomation",
|
|
1124
1183
|
payload: {
|
|
1125
|
-
cmd:
|
|
1126
|
-
params: { sessionId:
|
|
1184
|
+
cmd: y.SESSION_INIT,
|
|
1185
|
+
params: { sessionId: o }
|
|
1127
1186
|
}
|
|
1128
1187
|
}), !(typeof t == "string" ? document.location.href.includes(t) : document.location.href.match(t))) {
|
|
1129
|
-
|
|
1188
|
+
n.log(`URL "${document.location.href}" does not match "${t}"`), window.postMessage({
|
|
1130
1189
|
message: "injectedScript-to-contentScript",
|
|
1131
1190
|
sender: "tomation",
|
|
1132
1191
|
payload: {
|
|
1133
|
-
cmd:
|
|
1192
|
+
cmd: y.URL_MISMATCH,
|
|
1134
1193
|
params: {
|
|
1135
|
-
sessionId:
|
|
1194
|
+
sessionId: o,
|
|
1136
1195
|
matches: t,
|
|
1137
1196
|
url: document.location.href
|
|
1138
1197
|
}
|
|
@@ -1141,148 +1200,149 @@ function J(e) {
|
|
|
1141
1200
|
return;
|
|
1142
1201
|
}
|
|
1143
1202
|
try {
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
let
|
|
1203
|
+
n.log("Setting up messaging bridge with extension..."), Object.values(y).forEach((e) => {
|
|
1204
|
+
n.log(`Setting up listener for event "${e}"`), b.on(e, (t) => {
|
|
1205
|
+
let r = {
|
|
1147
1206
|
cmd: e,
|
|
1148
1207
|
params: {
|
|
1149
1208
|
...t,
|
|
1150
|
-
sessionId:
|
|
1209
|
+
sessionId: o
|
|
1151
1210
|
}
|
|
1152
1211
|
};
|
|
1153
|
-
|
|
1212
|
+
n.log(`Dispatching event "${e}" to extension: `, r), window.postMessage({
|
|
1154
1213
|
message: "injectedScript-to-contentScript",
|
|
1155
1214
|
sender: "tomation",
|
|
1156
|
-
payload:
|
|
1215
|
+
payload: r
|
|
1157
1216
|
});
|
|
1158
1217
|
});
|
|
1159
1218
|
}), window.addEventListener("message", (e) => {
|
|
1160
1219
|
try {
|
|
1161
|
-
console.log("[tomation] Received message from extension:", e.data);
|
|
1162
1220
|
let { message: t, sender: r, payload: i } = e.data || {}, { cmd: a, params: o } = i || {};
|
|
1163
1221
|
if (r !== "web-extension") return;
|
|
1164
1222
|
if (t === "contentScript-to-injectedScript") {
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
"
|
|
1168
|
-
"
|
|
1169
|
-
"
|
|
1170
|
-
"
|
|
1171
|
-
"
|
|
1172
|
-
"
|
|
1173
|
-
"
|
|
1174
|
-
"
|
|
1175
|
-
"user-
|
|
1223
|
+
n.log("Received message from extension:", e.data);
|
|
1224
|
+
let t = {
|
|
1225
|
+
"run-test-request": () => Me(o?.testId),
|
|
1226
|
+
"reload-tests-request": () => D.setupTests(),
|
|
1227
|
+
"pause-test-request": () => D.pause(),
|
|
1228
|
+
"stop-test-request": () => D.stop(),
|
|
1229
|
+
"continue-test-request": () => D.continue(),
|
|
1230
|
+
"next-step-request": () => D.next(),
|
|
1231
|
+
"retry-action-request": () => D.retryAction(),
|
|
1232
|
+
"skip-action-request": () => D.skipAction(),
|
|
1233
|
+
"user-accept-request": () => b.dispatch(y.USER_ACCEPT),
|
|
1234
|
+
"user-reject-request": () => b.dispatch(y.USER_REJECT),
|
|
1235
|
+
"setup-tests-request": () => D.setupTests()
|
|
1176
1236
|
}[a];
|
|
1177
|
-
|
|
1237
|
+
t ? (n.log(`Executing command "${a}" from extension`), t()) : n.warn(`Unknown command "${a}" from extension`);
|
|
1178
1238
|
return;
|
|
1179
1239
|
}
|
|
1180
1240
|
} catch (e) {
|
|
1181
|
-
|
|
1241
|
+
n.error("Error handling message from extension:", e);
|
|
1182
1242
|
}
|
|
1183
|
-
}),
|
|
1243
|
+
}), O(window, r), D.setDebug(a), D.speed = w[i], window.postMessage({
|
|
1184
1244
|
message: "injectedScript-to-contentScript",
|
|
1185
1245
|
sender: "tomation",
|
|
1186
1246
|
payload: {
|
|
1187
|
-
cmd:
|
|
1247
|
+
cmd: y.SESSION_CONNECTED,
|
|
1188
1248
|
params: {
|
|
1189
|
-
speed:
|
|
1190
|
-
sessionId:
|
|
1249
|
+
speed: D.speed,
|
|
1250
|
+
sessionId: o
|
|
1191
1251
|
}
|
|
1192
1252
|
}
|
|
1193
|
-
}),
|
|
1253
|
+
}), n.log("Ready ✓");
|
|
1194
1254
|
} catch (e) {
|
|
1195
|
-
|
|
1255
|
+
n.error("Initialization failed:", e);
|
|
1196
1256
|
}
|
|
1197
1257
|
}
|
|
1198
1258
|
//#endregion
|
|
1199
1259
|
//#region src/dsl/task.ts
|
|
1200
|
-
var
|
|
1201
|
-
let
|
|
1202
|
-
if (
|
|
1203
|
-
|
|
1260
|
+
var Pe = (e, t) => async (r) => {
|
|
1261
|
+
let i = new R(e, t);
|
|
1262
|
+
if (i.setParams(r), !A.running && !G.getIsCompiling()) try {
|
|
1263
|
+
n.log(`Compilation of Task ${e} starts...`), G.init(i), n.log(`Compilation of Task ${e} Finished.`), n.log(`Start running Task ${e}...`), await A.start(i), n.log(`End of Task ${e}: SUCCESS`);
|
|
1204
1264
|
} catch (t) {
|
|
1205
|
-
|
|
1265
|
+
throw n.error(`Error running task ${e}. ${t.message}`), t;
|
|
1206
1266
|
}
|
|
1207
|
-
else
|
|
1208
|
-
},
|
|
1209
|
-
let t = new
|
|
1210
|
-
|
|
1211
|
-
},
|
|
1267
|
+
else n.log(`Adding action ${e} to compilation stack`), G.addAction(i), G.compileAction(i);
|
|
1268
|
+
}, Fe = (e) => {
|
|
1269
|
+
let t = new fe(e);
|
|
1270
|
+
G.addAction(t);
|
|
1271
|
+
}, Ie = (e) => ({
|
|
1212
1272
|
textIs: (t) => {
|
|
1213
|
-
|
|
1273
|
+
G.addAction(new pe(e, t));
|
|
1214
1274
|
},
|
|
1215
1275
|
containsText: (t) => {
|
|
1216
|
-
|
|
1276
|
+
G.addAction(new me(e, t));
|
|
1217
1277
|
},
|
|
1218
1278
|
valueIs: (t) => {
|
|
1219
|
-
|
|
1279
|
+
G.addAction(new he(e, t));
|
|
1220
1280
|
},
|
|
1221
1281
|
exists: () => {
|
|
1222
|
-
|
|
1282
|
+
G.addAction(new ge(e));
|
|
1223
1283
|
},
|
|
1224
1284
|
notExists: () => {
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
}),
|
|
1228
|
-
let n = new
|
|
1229
|
-
|
|
1230
|
-
} }),
|
|
1231
|
-
let n = new
|
|
1232
|
-
|
|
1233
|
-
} }), Le = () => ({ in: (e) => {
|
|
1234
|
-
let t = new V(e, "");
|
|
1235
|
-
K.addAction(t);
|
|
1236
|
-
} }), Re = () => ({ in: (e) => {
|
|
1237
|
-
K.addAction(new ve(e));
|
|
1285
|
+
G.addAction(new _e(e));
|
|
1286
|
+
}
|
|
1287
|
+
}), Le = (e) => ({ in: (t) => {
|
|
1288
|
+
let n = new ve(t, e);
|
|
1289
|
+
G.addAction(n);
|
|
1290
|
+
} }), Re = (e) => ({ in: (t) => {
|
|
1291
|
+
let n = new B(t, e);
|
|
1292
|
+
G.addAction(n);
|
|
1238
1293
|
} }), ze = () => ({ in: (e) => {
|
|
1239
|
-
|
|
1294
|
+
let t = new B(e, "");
|
|
1295
|
+
G.addAction(t);
|
|
1240
1296
|
} }), Be = () => ({ in: (e) => {
|
|
1241
|
-
|
|
1297
|
+
G.addAction(new be(e));
|
|
1242
1298
|
} }), Ve = () => ({ in: (e) => {
|
|
1243
|
-
|
|
1244
|
-
} }), He = (
|
|
1245
|
-
|
|
1246
|
-
} }), Ue = (
|
|
1247
|
-
|
|
1248
|
-
K.addAction(n);
|
|
1299
|
+
G.addAction(new xe(e));
|
|
1300
|
+
} }), He = () => ({ in: (e) => {
|
|
1301
|
+
G.addAction(new Se(e));
|
|
1302
|
+
} }), Ue = () => ({ in: (e) => {
|
|
1303
|
+
G.addAction(new Ce(e));
|
|
1249
1304
|
} }), We = (e) => ({ in: (t) => {
|
|
1250
|
-
|
|
1251
|
-
K.addAction(n);
|
|
1305
|
+
G.addAction(new we(t, e));
|
|
1252
1306
|
} }), Ge = (e) => ({ in: (t) => {
|
|
1253
|
-
let n = new
|
|
1254
|
-
|
|
1307
|
+
let n = new ye(t, e);
|
|
1308
|
+
G.addAction(n);
|
|
1309
|
+
} }), Ke = (e) => ({ in: (t) => {
|
|
1310
|
+
let n = new Te(t, e);
|
|
1311
|
+
G.addAction(n);
|
|
1312
|
+
} }), qe = (e) => ({ in: (t) => {
|
|
1313
|
+
let n = new Ee(e, t);
|
|
1314
|
+
G.addAction(n);
|
|
1255
1315
|
} }), Y = (e) => {
|
|
1256
|
-
|
|
1316
|
+
G.addAction(new De(e));
|
|
1257
1317
|
};
|
|
1258
1318
|
Y.untilElement = (e) => ({ isRemoved: () => {
|
|
1259
|
-
|
|
1319
|
+
G.addAction(new Oe(e));
|
|
1260
1320
|
} });
|
|
1261
|
-
var
|
|
1262
|
-
|
|
1263
|
-
},
|
|
1264
|
-
|
|
1265
|
-
},
|
|
1266
|
-
|
|
1267
|
-
},
|
|
1321
|
+
var Je = () => {
|
|
1322
|
+
G.addAction(new ke());
|
|
1323
|
+
}, Ye = (e) => {
|
|
1324
|
+
G.addAction(new Ae(e));
|
|
1325
|
+
}, Xe = () => {
|
|
1326
|
+
G.addAction(new je());
|
|
1327
|
+
}, X = (e) => e.toLocaleDateString("en-US", {
|
|
1268
1328
|
year: "numeric",
|
|
1269
1329
|
month: "2-digit",
|
|
1270
1330
|
day: "2-digit"
|
|
1271
|
-
}),
|
|
1331
|
+
}), Z = (e) => {
|
|
1272
1332
|
let t = /* @__PURE__ */ new Date();
|
|
1273
|
-
return
|
|
1274
|
-
},
|
|
1333
|
+
return X(new Date(t.setDate(t.getDate() + e)));
|
|
1334
|
+
}, Q = (e) => {
|
|
1275
1335
|
let t = /* @__PURE__ */ new Date();
|
|
1276
|
-
return
|
|
1277
|
-
},
|
|
1278
|
-
formatDate:
|
|
1279
|
-
today:
|
|
1280
|
-
tomorrow:
|
|
1281
|
-
nextWeek:
|
|
1282
|
-
nextMonth:
|
|
1283
|
-
yesterday:
|
|
1284
|
-
lastWeek:
|
|
1285
|
-
lastMonth:
|
|
1286
|
-
},
|
|
1336
|
+
return X(new Date(t.setMonth(t.getMonth() + e)));
|
|
1337
|
+
}, Ze = Z(1), $ = Z(-1), Qe = Z(7), $e = Z(-7), et = Q(1), tt = Q(-1), nt = {
|
|
1338
|
+
formatDate: X,
|
|
1339
|
+
today: X(/* @__PURE__ */ new Date()),
|
|
1340
|
+
tomorrow: Ze,
|
|
1341
|
+
nextWeek: Qe,
|
|
1342
|
+
nextMonth: et,
|
|
1343
|
+
yesterday: $,
|
|
1344
|
+
lastWeek: $e,
|
|
1345
|
+
lastMonth: tt
|
|
1346
|
+
}, rt = J;
|
|
1287
1347
|
//#endregion
|
|
1288
|
-
export {
|
|
1348
|
+
export { I as ACTION_STATUS, Ie as Assert, b as AutomationEvents, D as AutomationInstance, ze as ClearValue, Fe as Click, nt as DateUtils, y as EVENT_NAMES, V as KEY_MAP, Ye as ManualTask, Je as Pause, Ve as PressDownKey, Ue as PressEnterKey, Be as PressEscKey, We as PressKey, He as PressTabKey, Xe as ReloadPage, qe as SaveValue, Le as Select, O as Setup, Pe as Task, Ne as Test, w as TestSpeed, Re as Type, Ge as TypePassword, p as UIElement, Ke as UploadFile, Y as Wait, te as and, o as classIncludes, a as classIs, rt as default, f as elementIndexIs, ee as firstChildTextIs, c as innerTextContains, s as innerTextIs, ie as is, d as isFirstElement, u as placeholderIs, l as titleIs, J as tomation, x as wait };
|