tomation 0.0.9 → 0.0.11
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/.vite/manifest.json +1 -1
- package/dist/{actions.d.ts → dom/actions.d.ts} +2 -43
- package/dist/dsl/actions.d.ts +53 -0
- package/dist/dsl/task.d.ts +2 -0
- package/dist/dsl/test.d.ts +4 -0
- package/dist/dsl/ui-element-filters.d.ts +12 -0
- package/dist/{ui-element-builder.d.ts → dsl/ui-element.d.ts} +1 -13
- package/dist/engine/compiler.d.ts +8 -0
- package/dist/engine/events.d.ts +27 -0
- package/dist/engine/runner.d.ts +49 -0
- package/dist/feedback/logger.d.ts +7 -0
- package/dist/main.cjs +1 -1
- package/dist/main.d.ts +13 -4
- package/dist/main.js +663 -747
- package/dist/tomation.d.ts +9 -0
- package/package.json +1 -1
- package/dist/automation.d.ts +0 -137
- /package/dist/{ui-utils.d.ts → feedback/ui-utils.d.ts} +0 -0
- /package/dist/{date-utils.d.ts → utils/date-utils.d.ts} +0 -0
package/dist/main.js
CHANGED
|
@@ -1,170 +1,144 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var oe = (e, t, n) => t in e ? se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var r = (e, t, n) => (oe(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
const st = (e) => (t) => t.className == e, ot = (e) => (t) => t.className.split(" ").includes(e), it = (e) => (t) => {
|
|
5
|
+
var s;
|
|
6
|
+
return ((s = t.textContent) == null ? void 0 : s.trim()) == e;
|
|
7
|
+
}, rt = (e) => (t) => t.innerText.trim().includes(e), at = (e) => (t) => t.title == e, ct = (e) => (t) => t.placeholder === e, lt = () => (e, t) => t === 0, ut = (e) => (t, n) => n === e, ht = (e) => (t) => (t == null ? void 0 : t.firstChild).innerText.trim() === e, dt = (e) => (t, n) => e.every((o, i) => o(t, n));
|
|
8
|
+
class ie {
|
|
9
|
+
constructor(t, n, s, o) {
|
|
10
|
+
r(this, "name");
|
|
11
|
+
r(this, "selector");
|
|
12
|
+
r(this, "parent");
|
|
13
|
+
r(this, "postProcess");
|
|
14
|
+
this.name = t, this.selector = n, this.parent = s || null, this.postProcess = o;
|
|
11
15
|
}
|
|
12
16
|
getElementName() {
|
|
13
|
-
let
|
|
14
|
-
return this.parent && (
|
|
17
|
+
let t = "";
|
|
18
|
+
return this.parent && (t = " in " + this.parent.getElementName()), `${this.name}${t}`;
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
let F;
|
|
18
|
-
const
|
|
19
|
-
F =
|
|
20
|
-
},
|
|
22
|
+
const re = (e) => {
|
|
23
|
+
F = e;
|
|
24
|
+
}, z = (e, t) => (s = F, o) => {
|
|
21
25
|
s = s || F, console.log("Searching elem from Root = ", s);
|
|
22
|
-
const
|
|
23
|
-
s.querySelectorAll(
|
|
24
|
-
l.style.display !== "none" &&
|
|
26
|
+
const i = [];
|
|
27
|
+
s.querySelectorAll(e).forEach((l) => {
|
|
28
|
+
l.style.display !== "none" && i.push(l);
|
|
25
29
|
});
|
|
26
|
-
let
|
|
27
|
-
return
|
|
28
|
-
console.log("Apply filter to item " +
|
|
29
|
-
const
|
|
30
|
-
return console.log(` -> Item ${
|
|
31
|
-
})[0]) :
|
|
32
|
-
},
|
|
30
|
+
let c;
|
|
31
|
+
return t ? (console.log("Applying filter ", t), console.log(" -- to " + i.length + "elements: ", i), c = i.filter((l, y, w) => {
|
|
32
|
+
console.log("Apply filter to item " + y + ": ", l);
|
|
33
|
+
const f = t(l, y, w);
|
|
34
|
+
return console.log(` -> Item ${y} ${f ? "Match" : "Discarded"}`), f;
|
|
35
|
+
})[0]) : c = i[0], c && o && (console.log("Apply post process to = ", c), c = o(c)), console.log("Return elem = ", c), c;
|
|
36
|
+
}, R = (e, t, n) => ({
|
|
33
37
|
/**
|
|
34
38
|
* Sets the UI element identifier
|
|
35
39
|
* @param uiElementId
|
|
36
40
|
* @returns
|
|
37
41
|
*/
|
|
38
|
-
as: (s) => new
|
|
39
|
-
}),
|
|
40
|
-
|
|
42
|
+
as: (s) => new ie(s, e, t, n)
|
|
43
|
+
}), ae = (e, t) => ({
|
|
44
|
+
...R(e, t),
|
|
41
45
|
/**
|
|
42
46
|
* Tansform the UI element that will be returned
|
|
43
47
|
* @param postProcessFn
|
|
44
48
|
* @returns
|
|
45
49
|
*/
|
|
46
50
|
postProcess: (n) => ({
|
|
47
|
-
|
|
51
|
+
...R(e, t, n)
|
|
48
52
|
})
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
childOf: (
|
|
52
|
-
...
|
|
53
|
+
}), G = (e) => ({
|
|
54
|
+
...R(e, null),
|
|
55
|
+
childOf: (t) => ({
|
|
56
|
+
...ae(e, t)
|
|
53
57
|
}),
|
|
54
58
|
/**
|
|
55
59
|
* Tansform the UI element that will be returned
|
|
56
60
|
* @param postProcessFn
|
|
57
61
|
* @returns
|
|
58
62
|
*/
|
|
59
|
-
postProcess: (
|
|
60
|
-
|
|
63
|
+
postProcess: (t) => ({
|
|
64
|
+
...R(e, null, t)
|
|
61
65
|
})
|
|
62
|
-
}),
|
|
63
|
-
where: (
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const n = e.className == t;
|
|
72
|
-
return A(`classIs('${t}') on`, e, "=>", n), n;
|
|
73
|
-
}, tt = (t) => (e) => {
|
|
74
|
-
const n = e.className.split(" ").includes(t);
|
|
75
|
-
return A(`classIncludes('${t}') on`, e, "=>", n), n;
|
|
76
|
-
}, nt = (t) => (e) => {
|
|
77
|
-
var s;
|
|
78
|
-
const n = ((s = e.textContent) == null ? void 0 : s.trim()) == t;
|
|
79
|
-
return A(`innerTextIs('${t}') on`, e, "=>", n), n;
|
|
80
|
-
}, st = (t) => (e) => {
|
|
81
|
-
const n = e.innerText.trim().includes(t);
|
|
82
|
-
return A(`innerTextContains('${t}') on`, e, "=>", n), n;
|
|
83
|
-
}, ot = (t) => (e) => {
|
|
84
|
-
const n = e.title == t;
|
|
85
|
-
return A(`titleIs('${t}') on`, e, "=>", n), n;
|
|
86
|
-
}, it = (t) => (e) => {
|
|
87
|
-
const n = e.placeholder === t;
|
|
88
|
-
return A(`placeholderIs('${t}') on`, e, "=>", n), n;
|
|
89
|
-
}, rt = () => (t, e) => {
|
|
90
|
-
const n = e === 0;
|
|
91
|
-
return A("isFirstElement on", t, "index", e, "=>", n), n;
|
|
92
|
-
}, at = (t) => (e, n) => {
|
|
93
|
-
const s = n === t;
|
|
94
|
-
return A(`elementIndexIs(${t}) on`, e, "elemIndex", n, "=>", s), s;
|
|
95
|
-
}, ct = (t) => (e) => {
|
|
96
|
-
const n = (e == null ? void 0 : e.firstChild).innerText.trim() === t;
|
|
97
|
-
return A(`firstChildTextIs('${t}') on`, e, "=>", n), n;
|
|
98
|
-
}, lt = (t) => (e, n) => {
|
|
99
|
-
const s = t.every((o, a) => {
|
|
100
|
-
const r = o(e, n);
|
|
101
|
-
return A(`and condition[${a}] on`, e, "elemIndex", n, "=>", r), r;
|
|
102
|
-
});
|
|
103
|
-
return A("and final result on", e, "elemIndex", n, "=>", s), s;
|
|
104
|
-
}, ut = {
|
|
105
|
-
DIV: ae,
|
|
106
|
-
BUTTON: ce,
|
|
107
|
-
INPUT: le,
|
|
108
|
-
TEXTAREA: ue,
|
|
109
|
-
ELEMENT: de,
|
|
110
|
-
identifiedBy: he
|
|
111
|
-
};
|
|
112
|
-
let I;
|
|
113
|
-
const pe = new Uint8Array(16);
|
|
114
|
-
function me() {
|
|
115
|
-
if (!I && (I = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !I))
|
|
116
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
117
|
-
return I(pe);
|
|
118
|
-
}
|
|
119
|
-
const p = [];
|
|
120
|
-
for (let t = 0; t < 256; ++t)
|
|
121
|
-
p.push((t + 256).toString(16).slice(1));
|
|
122
|
-
function ge(t, e = 0) {
|
|
123
|
-
return (p[t[e + 0]] + p[t[e + 1]] + p[t[e + 2]] + p[t[e + 3]] + "-" + p[t[e + 4]] + p[t[e + 5]] + "-" + p[t[e + 6]] + p[t[e + 7]] + "-" + p[t[e + 8]] + p[t[e + 9]] + "-" + p[t[e + 10]] + p[t[e + 11]] + p[t[e + 12]] + p[t[e + 13]] + p[t[e + 14]] + p[t[e + 15]]).toLowerCase();
|
|
124
|
-
}
|
|
125
|
-
const ye = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), W = {
|
|
126
|
-
randomUUID: ye
|
|
66
|
+
}), D = (e) => ({
|
|
67
|
+
where: (t) => G(z(e, t))
|
|
68
|
+
}), ce = D("div"), le = D("button"), ue = D("input"), he = D("textarea"), de = (e) => G(z("#" + e)), pe = (e) => D(e), pt = {
|
|
69
|
+
DIV: ce,
|
|
70
|
+
BUTTON: le,
|
|
71
|
+
INPUT: ue,
|
|
72
|
+
TEXTAREA: he,
|
|
73
|
+
ELEMENT: pe,
|
|
74
|
+
identifiedBy: de
|
|
127
75
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
76
|
+
var d = /* @__PURE__ */ ((e) => (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))(d || {});
|
|
77
|
+
class me {
|
|
78
|
+
constructor() {
|
|
79
|
+
r(this, "events");
|
|
80
|
+
this.events = /* @__PURE__ */ new Map();
|
|
81
|
+
}
|
|
82
|
+
on(t, n) {
|
|
83
|
+
var s;
|
|
84
|
+
this.events.has(t) || this.events.set(t, []), (s = this.events.get(t)) == null || s.push(n);
|
|
85
|
+
}
|
|
86
|
+
off(t, n) {
|
|
87
|
+
var s;
|
|
88
|
+
this.events.has(t) && this.events.set(t, ((s = this.events.get(t)) == null ? void 0 : s.filter((o) => o !== n)) || []);
|
|
89
|
+
}
|
|
90
|
+
dispatch(t, n) {
|
|
91
|
+
var s;
|
|
92
|
+
this.events.has(t) && ((s = this.events.get(t)) == null || s.forEach((o) => {
|
|
93
|
+
console.log(`Dispatch Event ${t}:`, n), o(n);
|
|
94
|
+
}));
|
|
138
95
|
}
|
|
139
|
-
return ge(s);
|
|
140
96
|
}
|
|
141
|
-
const
|
|
97
|
+
const g = new me();
|
|
98
|
+
let b = !1;
|
|
99
|
+
const u = {
|
|
100
|
+
setEnabled(e) {
|
|
101
|
+
b = e;
|
|
102
|
+
},
|
|
103
|
+
log(...e) {
|
|
104
|
+
b && console.log("[tomation]", ...e);
|
|
105
|
+
},
|
|
106
|
+
groupCollapsed(...e) {
|
|
107
|
+
b && console.groupCollapsed("[tomation]", ...e);
|
|
108
|
+
},
|
|
109
|
+
groupEnd() {
|
|
110
|
+
b && console.groupEnd();
|
|
111
|
+
},
|
|
112
|
+
error(...e) {
|
|
113
|
+
b && console.error("[tomation]", ...e);
|
|
114
|
+
}
|
|
115
|
+
}, A = (e = 2e3) => new Promise((t) => {
|
|
142
116
|
setTimeout(() => {
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
}),
|
|
146
|
-
Object.entries(
|
|
117
|
+
t(null);
|
|
118
|
+
}, e);
|
|
119
|
+
}), C = (e, t) => {
|
|
120
|
+
Object.entries(t).map(([s, o]) => ({
|
|
147
121
|
key: s,
|
|
148
122
|
value: o
|
|
149
123
|
})).forEach((s) => {
|
|
150
|
-
const { key: o, value:
|
|
151
|
-
|
|
124
|
+
const { key: o, value: i } = s;
|
|
125
|
+
e.style[o] = i;
|
|
152
126
|
});
|
|
153
127
|
};
|
|
154
|
-
class
|
|
155
|
-
constructor(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
this.document =
|
|
128
|
+
class ge {
|
|
129
|
+
constructor(t) {
|
|
130
|
+
r(this, "window");
|
|
131
|
+
r(this, "document");
|
|
132
|
+
r(this, "devToolsMessageContainer");
|
|
133
|
+
r(this, "devToolsCheckElementContainer");
|
|
134
|
+
r(this, "darkLayerLeft");
|
|
135
|
+
r(this, "darkLayerTop");
|
|
136
|
+
r(this, "darkLayerRight");
|
|
137
|
+
r(this, "darkLayerBottom");
|
|
138
|
+
r(this, "currentCheckElem");
|
|
139
|
+
r(this, "contextViewerContainer");
|
|
140
|
+
r(this, "devToolsAlertContainer");
|
|
141
|
+
this.document = t.document, this.window = t, this.devToolsMessageContainer = this.createElement("DIV", {
|
|
168
142
|
id: "dev-tools-message-container",
|
|
169
143
|
styles: {
|
|
170
144
|
width: "500px",
|
|
@@ -247,50 +221,50 @@ class Ee {
|
|
|
247
221
|
parent: this.document.body
|
|
248
222
|
});
|
|
249
223
|
}
|
|
250
|
-
createElement(
|
|
251
|
-
const s = this.document.createElement(
|
|
252
|
-
return n && (n.id && (s.id = n == null ? void 0 : n.id), n.styles &&
|
|
224
|
+
createElement(t, n) {
|
|
225
|
+
const s = this.document.createElement(t);
|
|
226
|
+
return n && (n.id && (s.id = n == null ? void 0 : n.id), n.styles && C(s, n.styles), n.parent && n.parent.appendChild(s)), s;
|
|
253
227
|
}
|
|
254
228
|
/**
|
|
255
229
|
*
|
|
256
230
|
* @param message @deprecated
|
|
257
231
|
*/
|
|
258
|
-
async logAction(
|
|
259
|
-
const n =
|
|
260
|
-
n.innerText =
|
|
232
|
+
async logAction(t) {
|
|
233
|
+
const n = a.document.createElement("DIV");
|
|
234
|
+
n.innerText = t, C(n, {
|
|
261
235
|
padding: "3px 10px",
|
|
262
236
|
opacity: "1",
|
|
263
237
|
transition: "opacity 1s"
|
|
264
|
-
}), this.devToolsMessageContainer.appendChild(n), await
|
|
238
|
+
}), this.devToolsMessageContainer.appendChild(n), await A(4e3), n.style.opacity = "0", await A(4e3), this.devToolsMessageContainer.removeChild(n), await A(1e3);
|
|
265
239
|
}
|
|
266
|
-
async checkElement(
|
|
267
|
-
if (!
|
|
240
|
+
async checkElement(t, n) {
|
|
241
|
+
if (!t)
|
|
268
242
|
return;
|
|
269
|
-
const s =
|
|
270
|
-
this.darkLayerLeft.style.left = "0px", this.darkLayerLeft.style.top = s.top + "px", this.darkLayerLeft.style.width = this.window.scrollX + s.left + "px", this.darkLayerLeft.style.height = s.height + "px", this.darkLayerTop.style.left = this.window.scrollX + "px", this.darkLayerTop.style.top = "0px", this.darkLayerTop.style.width = "100%", this.darkLayerTop.style.height = s.top + "px", this.darkLayerRight.style.left = this.window.scrollX + s.left + s.width + "px", this.darkLayerRight.style.top = s.top + "px", this.darkLayerRight.style.width = o.width - (s.left + s.width) + "px", this.darkLayerRight.style.height = s.height + "px", this.darkLayerBottom.style.left = this.window.scrollX + "px", this.darkLayerBottom.style.top = s.top + s.height + "px", this.darkLayerBottom.style.width = "100%", this.darkLayerBottom.style.height = o.height - (s.top + s.height) + "px", this.currentCheckElem.id = `dev-tools-current-check-elem-${n}`, this.currentCheckElem.style.top = s.top + "px", this.currentCheckElem.style.left = this.window.scrollX + s.left + "px", this.currentCheckElem.style.height = s.height + "px", this.currentCheckElem.style.width = s.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
|
|
243
|
+
const s = t.getBoundingClientRect(), o = this.document.body.getBoundingClientRect();
|
|
244
|
+
this.darkLayerLeft.style.left = "0px", this.darkLayerLeft.style.top = s.top + "px", this.darkLayerLeft.style.width = this.window.scrollX + s.left + "px", this.darkLayerLeft.style.height = s.height + "px", this.darkLayerTop.style.left = this.window.scrollX + "px", this.darkLayerTop.style.top = "0px", this.darkLayerTop.style.width = "100%", this.darkLayerTop.style.height = s.top + "px", this.darkLayerRight.style.left = this.window.scrollX + s.left + s.width + "px", this.darkLayerRight.style.top = s.top + "px", this.darkLayerRight.style.width = o.width - (s.left + s.width) + "px", this.darkLayerRight.style.height = s.height + "px", this.darkLayerBottom.style.left = this.window.scrollX + "px", this.darkLayerBottom.style.top = s.top + s.height + "px", this.darkLayerBottom.style.width = "100%", this.darkLayerBottom.style.height = o.height - (s.top + s.height) + "px", this.currentCheckElem.id = `dev-tools-current-check-elem-${n}`, this.currentCheckElem.style.top = s.top + "px", this.currentCheckElem.style.left = this.window.scrollX + s.left + "px", this.currentCheckElem.style.height = s.height + "px", this.currentCheckElem.style.width = s.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 A(200);
|
|
271
245
|
}
|
|
272
|
-
async showAlert(
|
|
273
|
-
const n =
|
|
274
|
-
n.innerText =
|
|
246
|
+
async showAlert(t) {
|
|
247
|
+
const n = a.document.createElement("DIV"), s = a.document.body;
|
|
248
|
+
n.innerText = t, C(s, {
|
|
275
249
|
paddingTop: "30px"
|
|
276
|
-
}),
|
|
250
|
+
}), C(this.devToolsAlertContainer, {
|
|
277
251
|
display: "flex"
|
|
278
252
|
}), this.devToolsAlertContainer.appendChild(n);
|
|
279
253
|
}
|
|
280
254
|
async hideAlert() {
|
|
281
|
-
|
|
255
|
+
C(this.devToolsAlertContainer, {
|
|
282
256
|
display: "none"
|
|
283
257
|
});
|
|
284
|
-
const
|
|
285
|
-
|
|
258
|
+
const t = a.document.body;
|
|
259
|
+
C(t, {
|
|
286
260
|
paddingTop: "0"
|
|
287
261
|
}), this.devToolsAlertContainer.firstChild && this.devToolsAlertContainer.removeChild(this.devToolsAlertContainer.firstChild);
|
|
288
262
|
}
|
|
289
263
|
async hideCheckElementContainer() {
|
|
290
|
-
this.devToolsCheckElementContainer.style.opacity = "0", await
|
|
264
|
+
this.devToolsCheckElementContainer.style.opacity = "0", await A(200), this.devToolsCheckElementContainer.style.display = "none";
|
|
291
265
|
}
|
|
292
|
-
displayContext(
|
|
293
|
-
|
|
266
|
+
displayContext(t) {
|
|
267
|
+
C(this.contextViewerContainer, {
|
|
294
268
|
display: "flex",
|
|
295
269
|
"background-color": "white",
|
|
296
270
|
position: "absolute",
|
|
@@ -299,86 +273,197 @@ class Ee {
|
|
|
299
273
|
"z-index": "9999"
|
|
300
274
|
});
|
|
301
275
|
const n = this.document.createElement("DIV");
|
|
302
|
-
n.id = "context-viewer-before",
|
|
276
|
+
n.id = "context-viewer-before", C(n, {
|
|
303
277
|
flex: "50%",
|
|
304
278
|
width: "100%",
|
|
305
279
|
height: "auto",
|
|
306
280
|
border: "2px solid orange"
|
|
307
281
|
});
|
|
308
282
|
const s = this.document.createElement("DIV");
|
|
309
|
-
s.id = "context-viewer-after",
|
|
283
|
+
s.id = "context-viewer-after", C(s, {
|
|
310
284
|
flex: "50%",
|
|
311
285
|
width: "100%",
|
|
312
286
|
height: "auto",
|
|
313
287
|
border: "2px solid green"
|
|
314
288
|
});
|
|
315
289
|
const o = this.document.createElement("DIV");
|
|
316
|
-
o.innerHTML =
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
this.contextViewerContainer.removeChild(n), this.contextViewerContainer.appendChild(s), s.appendChild(
|
|
320
|
-
this.contextViewerContainer.removeChild(s),
|
|
290
|
+
o.innerHTML = t.beforeHTML, H(o, t.beforeInputValues);
|
|
291
|
+
const i = this.document.createElement("DIV");
|
|
292
|
+
i.innerHTML = t.afterHTML, H(i, t.afterInputValues), this.contextViewerContainer.appendChild(n), n.appendChild(o), setTimeout(() => {
|
|
293
|
+
this.contextViewerContainer.removeChild(n), this.contextViewerContainer.appendChild(s), s.appendChild(i), setTimeout(() => {
|
|
294
|
+
this.contextViewerContainer.removeChild(s), C(this.contextViewerContainer, { display: "none" });
|
|
321
295
|
}, 2e3);
|
|
322
296
|
}, 2e3);
|
|
323
297
|
}
|
|
324
298
|
}
|
|
325
|
-
const
|
|
326
|
-
|
|
299
|
+
const H = (e, t) => {
|
|
300
|
+
e.querySelectorAll("input").forEach((n) => {
|
|
327
301
|
const s = n.getAttribute("input-id") || "";
|
|
328
|
-
n.value =
|
|
302
|
+
n.value = t[s];
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
var Q = /* @__PURE__ */ ((e) => (e[e.SLOW = 2e3] = "SLOW", e[e.NORMAL = 1e3] = "NORMAL", e[e.FAST = 200] = "FAST", e))(Q || {});
|
|
306
|
+
class ye {
|
|
307
|
+
constructor(t) {
|
|
308
|
+
r(this, "_document");
|
|
309
|
+
r(this, "debug");
|
|
310
|
+
r(this, "_uiUtils");
|
|
311
|
+
r(this, "speed");
|
|
312
|
+
r(this, "status");
|
|
313
|
+
r(this, "runMode");
|
|
314
|
+
r(this, "currentActionCallback");
|
|
315
|
+
r(this, "currentAction");
|
|
316
|
+
this._document = t.document, this.debug = !0, this._uiUtils = new ge(t), this.speed = 1e3, this.status = "Stopped", this.runMode = "Normal";
|
|
317
|
+
}
|
|
318
|
+
get document() {
|
|
319
|
+
return this._document;
|
|
320
|
+
}
|
|
321
|
+
get uiUtils() {
|
|
322
|
+
return this._uiUtils;
|
|
323
|
+
}
|
|
324
|
+
get isStepByStepMode() {
|
|
325
|
+
return this.runMode == "Step By Step";
|
|
326
|
+
}
|
|
327
|
+
get isStopped() {
|
|
328
|
+
return this.status == "Stopped";
|
|
329
|
+
}
|
|
330
|
+
get isPlaying() {
|
|
331
|
+
return this.status == "Playing";
|
|
332
|
+
}
|
|
333
|
+
get isPaused() {
|
|
334
|
+
return this.status == "Paused";
|
|
335
|
+
}
|
|
336
|
+
pause() {
|
|
337
|
+
u.log("Pause Test"), this.status = "Paused", g.dispatch(d.TEST_PAUSE);
|
|
338
|
+
}
|
|
339
|
+
continue() {
|
|
340
|
+
u.log("Continue Test"), this.status = "Playing", this.runMode = "Normal", g.dispatch(d.TEST_PLAY), this.currentActionCallback && this.currentAction && (u.log("Continue: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
341
|
+
}
|
|
342
|
+
next() {
|
|
343
|
+
u.log("Continue Test to Next Step..."), this.status = "Playing", this.runMode = "Step By Step", g.dispatch(d.TEST_PLAY), this.currentActionCallback && this.currentAction && (u.log("Next: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
344
|
+
}
|
|
345
|
+
stop() {
|
|
346
|
+
u.log("Stop Test"), this.status = "Stopped", this.currentActionCallback && this.currentAction && (u.log("Stop: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0), g.dispatch(d.TEST_STOP);
|
|
347
|
+
}
|
|
348
|
+
retryAction() {
|
|
349
|
+
u.log("Retry current step"), this.status = "Playing", g.dispatch(d.TEST_PLAY), this.currentActionCallback && this.currentAction && (this.currentAction.resetTries && (u.log("Retry: Resetting tries for current action"), this.currentAction.resetTries()), u.log("Retry: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
350
|
+
}
|
|
351
|
+
skipAction() {
|
|
352
|
+
u.log("Skip current step"), this.status = "Playing", this.currentActionCallback && this.currentAction && (this.currentAction.status = Y.SKIPPED, u.log("Skip: Marked current action as SKIPPED"), E.notifyActionUpdated(this.currentAction), u.log("Skip: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
353
|
+
}
|
|
354
|
+
saveCurrentAction(t, n) {
|
|
355
|
+
u.log("Save current action"), this.currentActionCallback = t, this.currentAction = n;
|
|
356
|
+
}
|
|
357
|
+
setDebug(t) {
|
|
358
|
+
u.setEnabled(t);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
let a;
|
|
362
|
+
const _ = (e, t) => (a = new ye(e), re(a.document), t == null || t.forEach((n) => n()), a);
|
|
363
|
+
let P = !1;
|
|
364
|
+
async function Ee(e) {
|
|
365
|
+
if (P)
|
|
366
|
+
throw u.error("Not able to run test while other test is running."), new Error("Not able to run test while other test is running.");
|
|
367
|
+
P = !0, a.status = "Playing", a.runMode = "Normal", u.groupCollapsed("Start Action: ", e.getDescription()), g.dispatch(d.TEST_STARTED, {
|
|
368
|
+
action: e == null ? void 0 : e.getJSON()
|
|
329
369
|
});
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
370
|
+
try {
|
|
371
|
+
await (e == null ? void 0 : e.execute()), g.dispatch(d.TEST_PASSED, { id: e.name });
|
|
372
|
+
} catch (t) {
|
|
373
|
+
throw g.dispatch(d.TEST_FAILED, { id: e.name }), a.uiUtils.hideCheckElementContainer(), u.error(`🤖 Error running task ${e.getDescription()}. Reason: ${t.message}`), t;
|
|
374
|
+
} finally {
|
|
375
|
+
u.groupEnd(), P = !1, g.dispatch(d.TEST_END, {
|
|
376
|
+
action: e == null ? void 0 : e.getJSON()
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const W = {
|
|
381
|
+
start: Ee,
|
|
382
|
+
get running() {
|
|
383
|
+
return P;
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
let I;
|
|
387
|
+
const we = new Uint8Array(16);
|
|
388
|
+
function fe() {
|
|
389
|
+
if (!I && (I = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !I))
|
|
390
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
391
|
+
return I(we);
|
|
392
|
+
}
|
|
393
|
+
const m = [];
|
|
394
|
+
for (let e = 0; e < 256; ++e)
|
|
395
|
+
m.push((e + 256).toString(16).slice(1));
|
|
396
|
+
function xe(e, t = 0) {
|
|
397
|
+
return (m[e[t + 0]] + m[e[t + 1]] + m[e[t + 2]] + m[e[t + 3]] + "-" + m[e[t + 4]] + m[e[t + 5]] + "-" + m[e[t + 6]] + m[e[t + 7]] + "-" + m[e[t + 8]] + m[e[t + 9]] + "-" + m[e[t + 10]] + m[e[t + 11]] + m[e[t + 12]] + m[e[t + 13]] + m[e[t + 14]] + m[e[t + 15]]).toLowerCase();
|
|
398
|
+
}
|
|
399
|
+
const Ae = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), j = {
|
|
400
|
+
randomUUID: Ae
|
|
401
|
+
};
|
|
402
|
+
function Z(e, t, n) {
|
|
403
|
+
if (j.randomUUID && !t && !e)
|
|
404
|
+
return j.randomUUID();
|
|
405
|
+
e = e || {};
|
|
406
|
+
const s = e.random || (e.rng || fe)();
|
|
407
|
+
if (s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, t) {
|
|
408
|
+
n = n || 0;
|
|
409
|
+
for (let o = 0; o < 16; ++o)
|
|
410
|
+
t[n + o] = s[o];
|
|
411
|
+
return t;
|
|
412
|
+
}
|
|
413
|
+
return xe(s);
|
|
414
|
+
}
|
|
415
|
+
const q = null, L = async (e, t, n, s = 1e3, o = 0, i = 10, c = !1) => {
|
|
416
|
+
if (console.log("Automation Status: ", a.status), a.isPaused)
|
|
417
|
+
return new Promise((l, y) => {
|
|
418
|
+
a.saveCurrentAction(async (w) => {
|
|
419
|
+
if (w.status == "skipped")
|
|
335
420
|
return l(null);
|
|
336
421
|
try {
|
|
337
|
-
const
|
|
338
|
-
l(
|
|
339
|
-
} catch (
|
|
340
|
-
|
|
422
|
+
const f = await L(w, t, n, s, o, i, c);
|
|
423
|
+
l(f);
|
|
424
|
+
} catch (f) {
|
|
425
|
+
y(f);
|
|
341
426
|
}
|
|
342
|
-
},
|
|
427
|
+
}, e);
|
|
343
428
|
});
|
|
344
|
-
if (
|
|
429
|
+
if (a.isStopped)
|
|
345
430
|
throw new Error("Test stopped manually");
|
|
346
|
-
if (console.groupCollapsed(`tries ${o}/${
|
|
347
|
-
throw console.groupEnd(),
|
|
431
|
+
if (console.groupCollapsed(`tries ${o}/${i}`), e && (e.updateTries(o), await E.notifyActionUpdated(e)), o === i)
|
|
432
|
+
throw console.groupEnd(), c ? new Error(`UI Element ${t.getElementName() || "UNKNOWN"} still present after 10 tries`) : new Error(`UI Element ${t.getElementName() || "UNKNOWN"} not found after 10 tries`);
|
|
348
433
|
{
|
|
349
|
-
const l =
|
|
350
|
-
return console.groupEnd(), l ?
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
const
|
|
354
|
-
console.group("Looking for Element: " +
|
|
355
|
-
let
|
|
356
|
-
if (
|
|
434
|
+
const l = t.selector(n, t.postProcess);
|
|
435
|
+
return console.groupEnd(), l ? c ? (await A(s), await L(e, t, n, s, ++o, i, c)) : (console.log("Element found = ", l), l) : c ? (console.log("Element removed."), q) : (await A(s), await L(e, t, n, s, ++o, i, c));
|
|
436
|
+
}
|
|
437
|
+
}, J = async (e, t, n = 1e3, s = 10, o = !1) => {
|
|
438
|
+
const i = t == null ? void 0 : t.getElementName();
|
|
439
|
+
console.group("Looking for Element: " + i);
|
|
440
|
+
let c = null;
|
|
441
|
+
if (t.parent)
|
|
357
442
|
try {
|
|
358
|
-
console.groupCollapsed("Look for Parent ",
|
|
443
|
+
console.groupCollapsed("Look for Parent ", t.parent.getElementName()), c = await J(e, t.parent, n, s, o), console.groupEnd();
|
|
359
444
|
} catch (l) {
|
|
360
445
|
if (console.groupEnd(), o && l.message.includes("not found"))
|
|
361
|
-
return console.log("Parent not found, so element was removed"), console.groupEnd(),
|
|
446
|
+
return console.log("Parent not found, so element was removed"), console.groupEnd(), q;
|
|
362
447
|
throw console.groupEnd(), l;
|
|
363
448
|
}
|
|
364
449
|
try {
|
|
365
|
-
console.log("Using parent element: ",
|
|
366
|
-
const l = await L(
|
|
450
|
+
console.log("Using parent element: ", c);
|
|
451
|
+
const l = await L(e, t, c, n, 0, s, o);
|
|
367
452
|
return console.groupEnd(), l;
|
|
368
453
|
} catch (l) {
|
|
369
454
|
if (o && l.message.includes("not found"))
|
|
370
|
-
return console.log("Parent not found, so element was removed"), console.groupEnd(),
|
|
455
|
+
return console.log("Parent not found, so element was removed"), console.groupEnd(), q;
|
|
371
456
|
throw console.groupEnd(), l;
|
|
372
457
|
}
|
|
373
458
|
};
|
|
374
|
-
var
|
|
459
|
+
var Y = /* @__PURE__ */ ((e) => (e.WAITING = "waiting", e.RUNNING = "running", e.STOPPED = "stopped", e.PAUSED = "paused", e.SUCCESS = "success", e.ERROR = "error", e.SKIPPED = "skipped", e))(Y || {});
|
|
375
460
|
class E {
|
|
376
461
|
constructor() {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
this.status = "waiting", this.error = "", this.id =
|
|
462
|
+
r(this, "status");
|
|
463
|
+
r(this, "error");
|
|
464
|
+
r(this, "id");
|
|
465
|
+
r(this, "context");
|
|
466
|
+
this.status = "waiting", this.error = "", this.id = Z(), this.context = {
|
|
382
467
|
beforeHTML: "",
|
|
383
468
|
beforeInputValues: {},
|
|
384
469
|
afterInputValues: {},
|
|
@@ -401,37 +486,37 @@ class E {
|
|
|
401
486
|
this.status = "waiting", this.error = "", this.resetAction();
|
|
402
487
|
}
|
|
403
488
|
getInputValuesFromPage() {
|
|
404
|
-
const
|
|
405
|
-
return
|
|
406
|
-
const
|
|
407
|
-
s.setAttribute("input-id",
|
|
408
|
-
}),
|
|
489
|
+
const t = {};
|
|
490
|
+
return a.document.querySelectorAll("input").forEach((s, o) => {
|
|
491
|
+
const i = `value-id-${o}`;
|
|
492
|
+
s.setAttribute("input-id", i), t[i] = s.value;
|
|
493
|
+
}), t;
|
|
409
494
|
}
|
|
410
495
|
async execute() {
|
|
411
496
|
try {
|
|
412
|
-
this.status = "running", this.context.beforeInputValues = this.getInputValuesFromPage(), this.context.beforeHTML =
|
|
413
|
-
} catch (
|
|
414
|
-
if (this.status = "error", this.error =
|
|
415
|
-
throw Error("Error in Action " + this.getDescription() + ". Message: " +
|
|
416
|
-
this.status = "paused",
|
|
497
|
+
this.status = "running", this.context.beforeInputValues = this.getInputValuesFromPage(), this.context.beforeHTML = a.document.body.innerHTML, await E.notifyActionUpdated(this), console.log("Action: ", this.getDescription()), await this.executeAction(), this.status = "success", this.error = "", a.isStepByStepMode && a.pause();
|
|
498
|
+
} catch (t) {
|
|
499
|
+
if (this.status = "error", this.error = t.message, t.message == "Test stopped manually")
|
|
500
|
+
throw Error("Error in Action " + this.getDescription() + ". Message: " + t.message);
|
|
501
|
+
this.status = "paused", a.pause();
|
|
417
502
|
} finally {
|
|
418
|
-
this.context.afterInputValues = this.getInputValuesFromPage(), this.context.afterHTML =
|
|
503
|
+
this.context.afterInputValues = this.getInputValuesFromPage(), this.context.afterHTML = a.document.body.innerHTML, await E.notifyActionUpdated(this);
|
|
419
504
|
}
|
|
420
505
|
}
|
|
421
|
-
static async notifyActionUpdated(
|
|
422
|
-
|
|
423
|
-
action:
|
|
506
|
+
static async notifyActionUpdated(t) {
|
|
507
|
+
g.dispatch(d.ACTION_UPDATE, {
|
|
508
|
+
action: t.getJSON()
|
|
424
509
|
});
|
|
425
510
|
}
|
|
426
511
|
}
|
|
427
|
-
class
|
|
512
|
+
class ee extends E {
|
|
428
513
|
constructor(n, s) {
|
|
429
514
|
super();
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
515
|
+
r(this, "name");
|
|
516
|
+
r(this, "stepsFn");
|
|
517
|
+
r(this, "steps");
|
|
518
|
+
r(this, "params");
|
|
519
|
+
r(this, "index");
|
|
435
520
|
this.name = n, this.stepsFn = s, this.steps = [], this.index = 0;
|
|
436
521
|
}
|
|
437
522
|
getDescription() {
|
|
@@ -454,41 +539,40 @@ class Z extends E {
|
|
|
454
539
|
resetAction() {
|
|
455
540
|
this.steps.length = 0, this.index = 0;
|
|
456
541
|
}
|
|
457
|
-
async handlePause() {
|
|
458
|
-
return new Promise((n, s) => {
|
|
459
|
-
c.saveCurrentAction(async (o) => {
|
|
460
|
-
if (o.status === "skipped") {
|
|
461
|
-
n();
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
try {
|
|
465
|
-
await this.continue(), n();
|
|
466
|
-
} catch (a) {
|
|
467
|
-
s(a);
|
|
468
|
-
}
|
|
469
|
-
}, this);
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
542
|
async continue() {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
543
|
+
if (a.isPaused)
|
|
544
|
+
return new Promise((n, s) => {
|
|
545
|
+
a.saveCurrentAction(async (o) => {
|
|
546
|
+
if (o.status == "skipped")
|
|
547
|
+
return n();
|
|
548
|
+
try {
|
|
549
|
+
await o.continue(), n();
|
|
550
|
+
} catch (i) {
|
|
551
|
+
s(i);
|
|
552
|
+
}
|
|
553
|
+
}, this);
|
|
554
|
+
});
|
|
555
|
+
if (a.isStopped)
|
|
556
|
+
throw new Error("Test stopped manually");
|
|
557
|
+
if (this.index < this.steps.length) {
|
|
476
558
|
const n = this.steps[this.index];
|
|
477
559
|
try {
|
|
478
|
-
if (await
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
560
|
+
if (await A(a.speed), await n.execute(), !a.isPaused)
|
|
561
|
+
this.index++, await this.continue();
|
|
562
|
+
else
|
|
563
|
+
return new Promise((s, o) => {
|
|
564
|
+
a.saveCurrentAction(async (i) => {
|
|
565
|
+
if (i.status == "skipped")
|
|
566
|
+
return this.index++, await E.notifyActionUpdated(n), await this.continue(), s();
|
|
567
|
+
try {
|
|
568
|
+
await i.continue(), s();
|
|
569
|
+
} catch (c) {
|
|
570
|
+
o(c);
|
|
571
|
+
}
|
|
572
|
+
}, n);
|
|
573
|
+
});
|
|
485
574
|
} catch (s) {
|
|
486
|
-
throw
|
|
487
|
-
action: this.getJSON(),
|
|
488
|
-
step: n,
|
|
489
|
-
error: s.message,
|
|
490
|
-
index: this.index
|
|
491
|
-
}), s;
|
|
575
|
+
throw s;
|
|
492
576
|
}
|
|
493
577
|
}
|
|
494
578
|
}
|
|
@@ -502,12 +586,12 @@ class Z extends E {
|
|
|
502
586
|
this.steps.push(n);
|
|
503
587
|
}
|
|
504
588
|
}
|
|
505
|
-
class
|
|
589
|
+
class p extends E {
|
|
506
590
|
constructor(n) {
|
|
507
591
|
super();
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
592
|
+
r(this, "uiElement");
|
|
593
|
+
r(this, "element");
|
|
594
|
+
r(this, "tries");
|
|
511
595
|
this.uiElement = n, this.element = null, this.tries = 0;
|
|
512
596
|
}
|
|
513
597
|
getElementName() {
|
|
@@ -536,46 +620,46 @@ class d extends E {
|
|
|
536
620
|
* @param uiElement
|
|
537
621
|
* @param delay of each try. Defaults to 1 second
|
|
538
622
|
*/
|
|
539
|
-
static waitForElement(n, s, o = 1e3,
|
|
623
|
+
static waitForElement(n, s, o = 1e3, i = 10, c = !1) {
|
|
540
624
|
const l = s.getElementName();
|
|
541
|
-
return new Promise(async (
|
|
542
|
-
var
|
|
543
|
-
const
|
|
544
|
-
if (console.groupCollapsed(`tries ${N}/${
|
|
545
|
-
throw console.groupEnd(),
|
|
625
|
+
return new Promise(async (y, w) => {
|
|
626
|
+
var V;
|
|
627
|
+
const f = async (x, O = 1e3, N = 0, v = !1) => {
|
|
628
|
+
if (console.groupCollapsed(`tries ${N}/${i}`), n.updateTries(N), await E.notifyActionUpdated(n), N === i)
|
|
629
|
+
throw console.groupEnd(), v ? new Error(`UI Element ${l || "UNKNOWN"} still present after 10 tries`) : new Error(`UI Element ${l || "UNKNOWN"} not found after 10 tries`);
|
|
546
630
|
{
|
|
547
|
-
const
|
|
548
|
-
return console.groupEnd(),
|
|
631
|
+
const M = s.selector(x, s.postProcess);
|
|
632
|
+
return console.groupEnd(), M ? v ? (await A(O), await f(x, O, ++N, v)) : (console.log("Element found = ", M), M) : v ? (console.log("Element removed."), null) : (await A(O), await f(x, O, ++N, v));
|
|
549
633
|
}
|
|
550
634
|
};
|
|
551
635
|
console.group("[Action On Element] Looking for Element: " + l);
|
|
552
|
-
let
|
|
636
|
+
let S = null, T = !0;
|
|
553
637
|
if (s.parent) {
|
|
554
638
|
console.groupCollapsed("Look for Parent ", s.parent.getElementName());
|
|
555
639
|
try {
|
|
556
|
-
|
|
640
|
+
S = await p.waitForElement(n, s.parent, o, i, c);
|
|
557
641
|
} catch {
|
|
558
|
-
|
|
642
|
+
T = !1;
|
|
559
643
|
} finally {
|
|
560
644
|
console.groupEnd();
|
|
561
645
|
}
|
|
562
646
|
}
|
|
563
|
-
if (
|
|
564
|
-
console.log("using parent element: ",
|
|
647
|
+
if (T) {
|
|
648
|
+
console.log("using parent element: ", S);
|
|
565
649
|
try {
|
|
566
|
-
const
|
|
567
|
-
console.groupEnd(),
|
|
568
|
-
} catch (
|
|
569
|
-
console.groupEnd(),
|
|
650
|
+
const x = await f(S, o, 0, c);
|
|
651
|
+
console.groupEnd(), y(x);
|
|
652
|
+
} catch (x) {
|
|
653
|
+
console.groupEnd(), w(new Error(x.message));
|
|
570
654
|
}
|
|
571
655
|
} else
|
|
572
|
-
console.groupEnd(),
|
|
656
|
+
console.groupEnd(), w(new Error(`Parent ${(V = s.parent) == null ? void 0 : V.getElementName()} of UI Element ${s.name || "UNKNOWN"} not found`));
|
|
573
657
|
});
|
|
574
658
|
}
|
|
575
659
|
async executeAction() {
|
|
576
660
|
var n;
|
|
577
661
|
try {
|
|
578
|
-
this.element = await
|
|
662
|
+
this.element = await J(this, this.uiElement), (n = this.element) == null || n.setAttribute("test-id", this.getElementName()), await a.uiUtils.checkElement(this.element, this.getElementName()), this.executeActionOnElement(), await a.uiUtils.hideCheckElementContainer();
|
|
579
663
|
} catch (s) {
|
|
580
664
|
throw Error(s.message);
|
|
581
665
|
}
|
|
@@ -584,13 +668,13 @@ class d extends E {
|
|
|
584
668
|
this.element = null, this.resetTries();
|
|
585
669
|
}
|
|
586
670
|
}
|
|
587
|
-
class
|
|
588
|
-
constructor(
|
|
589
|
-
super(
|
|
671
|
+
class Ce extends p {
|
|
672
|
+
constructor(t) {
|
|
673
|
+
super(t);
|
|
590
674
|
}
|
|
591
675
|
executeActionOnElement() {
|
|
592
|
-
var
|
|
593
|
-
return (
|
|
676
|
+
var t;
|
|
677
|
+
return (t = this.element) == null ? void 0 : t.click();
|
|
594
678
|
}
|
|
595
679
|
getDescription() {
|
|
596
680
|
return "Click in " + this.getElementName();
|
|
@@ -602,10 +686,10 @@ class we extends d {
|
|
|
602
686
|
};
|
|
603
687
|
}
|
|
604
688
|
}
|
|
605
|
-
class
|
|
689
|
+
class Se extends p {
|
|
606
690
|
constructor(n, s) {
|
|
607
691
|
super(n);
|
|
608
|
-
|
|
692
|
+
r(this, "text");
|
|
609
693
|
this.text = s;
|
|
610
694
|
}
|
|
611
695
|
executeActionOnElement() {
|
|
@@ -624,10 +708,10 @@ class fe extends d {
|
|
|
624
708
|
};
|
|
625
709
|
}
|
|
626
710
|
}
|
|
627
|
-
class
|
|
711
|
+
class Te extends p {
|
|
628
712
|
constructor(n, s) {
|
|
629
713
|
super(n);
|
|
630
|
-
|
|
714
|
+
r(this, "text");
|
|
631
715
|
this.text = s;
|
|
632
716
|
}
|
|
633
717
|
executeActionOnElement() {
|
|
@@ -646,10 +730,10 @@ class Ae extends d {
|
|
|
646
730
|
};
|
|
647
731
|
}
|
|
648
732
|
}
|
|
649
|
-
class
|
|
733
|
+
class ke extends p {
|
|
650
734
|
constructor(n, s) {
|
|
651
735
|
super(n);
|
|
652
|
-
|
|
736
|
+
r(this, "value");
|
|
653
737
|
this.value = s;
|
|
654
738
|
}
|
|
655
739
|
executeActionOnElement() {
|
|
@@ -667,9 +751,9 @@ class xe extends d {
|
|
|
667
751
|
};
|
|
668
752
|
}
|
|
669
753
|
}
|
|
670
|
-
class
|
|
671
|
-
constructor(
|
|
672
|
-
super(
|
|
754
|
+
class Ne extends p {
|
|
755
|
+
constructor(t) {
|
|
756
|
+
super(t);
|
|
673
757
|
}
|
|
674
758
|
executeActionOnElement() {
|
|
675
759
|
if (!!!this.element)
|
|
@@ -685,14 +769,14 @@ class Ce extends d {
|
|
|
685
769
|
};
|
|
686
770
|
}
|
|
687
771
|
}
|
|
688
|
-
class
|
|
689
|
-
constructor(
|
|
690
|
-
super(
|
|
772
|
+
class ve extends p {
|
|
773
|
+
constructor(t) {
|
|
774
|
+
super(t);
|
|
691
775
|
}
|
|
692
776
|
async executeAction() {
|
|
693
|
-
var
|
|
777
|
+
var t;
|
|
694
778
|
try {
|
|
695
|
-
this.element = await
|
|
779
|
+
this.element = await J(this, this.uiElement, 1e3, 5, !0), (t = this.element) == null || t.setAttribute("test-id", this.getElementName()), await a.uiUtils.checkElement(this.element, this.getElementName()), this.executeActionOnElement(), await a.uiUtils.hideCheckElementContainer();
|
|
696
780
|
} catch (n) {
|
|
697
781
|
throw Error(n.message);
|
|
698
782
|
}
|
|
@@ -711,16 +795,16 @@ class Se extends d {
|
|
|
711
795
|
};
|
|
712
796
|
}
|
|
713
797
|
}
|
|
714
|
-
class
|
|
798
|
+
class be extends p {
|
|
715
799
|
constructor(n, s) {
|
|
716
800
|
super(n);
|
|
717
|
-
|
|
801
|
+
r(this, "value");
|
|
718
802
|
this.value = s;
|
|
719
803
|
}
|
|
720
804
|
executeActionOnElement() {
|
|
721
|
-
var s, o,
|
|
805
|
+
var s, o, i, c;
|
|
722
806
|
let n = this.element;
|
|
723
|
-
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((
|
|
807
|
+
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((i = this.element) == null ? void 0 : i.tagName) !== "TEXTAREA" && (n = (c = this.element) == null ? void 0 : c.querySelectorAll("input")[0], !n))
|
|
724
808
|
throw new Error("Input element not found. Not able to type value in element " + this.getElementName());
|
|
725
809
|
n.value = this.value, n.dispatchEvent(new Event("change"));
|
|
726
810
|
}
|
|
@@ -735,16 +819,16 @@ class ke extends d {
|
|
|
735
819
|
};
|
|
736
820
|
}
|
|
737
821
|
}
|
|
738
|
-
class
|
|
822
|
+
class te extends p {
|
|
739
823
|
constructor(n, s) {
|
|
740
824
|
super(n);
|
|
741
|
-
|
|
825
|
+
r(this, "value");
|
|
742
826
|
this.value = s;
|
|
743
827
|
}
|
|
744
828
|
executeActionOnElement() {
|
|
745
|
-
var s, o,
|
|
829
|
+
var s, o, i, c;
|
|
746
830
|
let n = this.element;
|
|
747
|
-
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((
|
|
831
|
+
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((i = this.element) == null ? void 0 : i.tagName) !== "TEXTAREA" && (n = (c = this.element) == null ? void 0 : c.querySelectorAll("input")[0], !n))
|
|
748
832
|
throw new Error("Input element not found. Not able to type value in element " + this.getElementName());
|
|
749
833
|
n.value = this.value, n.dispatchEvent(new Event("change")), n.dispatchEvent(new Event("keyup", { bubbles: !0 })), n.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
750
834
|
}
|
|
@@ -759,16 +843,16 @@ class Y extends d {
|
|
|
759
843
|
};
|
|
760
844
|
}
|
|
761
845
|
}
|
|
762
|
-
class
|
|
846
|
+
class De extends p {
|
|
763
847
|
constructor(n, s) {
|
|
764
848
|
super(n);
|
|
765
|
-
|
|
849
|
+
r(this, "value");
|
|
766
850
|
this.value = s;
|
|
767
851
|
}
|
|
768
852
|
executeActionOnElement() {
|
|
769
|
-
var s, o,
|
|
853
|
+
var s, o, i, c;
|
|
770
854
|
let n = this.element;
|
|
771
|
-
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((
|
|
855
|
+
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((i = this.element) == null ? void 0 : i.tagName) !== "TEXTAREA" && (n = (c = this.element) == null ? void 0 : c.querySelectorAll("input")[0], !n))
|
|
772
856
|
throw new Error("Input element not found. Not able to type value in element " + this.getElementName());
|
|
773
857
|
n.value = this.value, n.dispatchEvent(new Event("change")), n.dispatchEvent(new Event("keyup", { bubbles: !0 })), n.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
774
858
|
}
|
|
@@ -783,13 +867,13 @@ class Te extends d {
|
|
|
783
867
|
};
|
|
784
868
|
}
|
|
785
869
|
}
|
|
786
|
-
class
|
|
787
|
-
constructor(
|
|
788
|
-
super(
|
|
870
|
+
class Oe extends p {
|
|
871
|
+
constructor(t) {
|
|
872
|
+
super(t);
|
|
789
873
|
}
|
|
790
874
|
executeActionOnElement() {
|
|
791
|
-
var
|
|
792
|
-
(
|
|
875
|
+
var t;
|
|
876
|
+
(t = this.element) == null || t.dispatchEvent(
|
|
793
877
|
new KeyboardEvent("keydown", {
|
|
794
878
|
altKey: !1,
|
|
795
879
|
code: "Escape",
|
|
@@ -816,13 +900,13 @@ class ve extends d {
|
|
|
816
900
|
};
|
|
817
901
|
}
|
|
818
902
|
}
|
|
819
|
-
class
|
|
820
|
-
constructor(
|
|
821
|
-
super(
|
|
903
|
+
class Ie extends p {
|
|
904
|
+
constructor(t) {
|
|
905
|
+
super(t);
|
|
822
906
|
}
|
|
823
907
|
executeActionOnElement() {
|
|
824
|
-
var
|
|
825
|
-
(
|
|
908
|
+
var t;
|
|
909
|
+
(t = this.element) == null || t.dispatchEvent(
|
|
826
910
|
new KeyboardEvent("keyup", {
|
|
827
911
|
altKey: !1,
|
|
828
912
|
code: "Down",
|
|
@@ -849,13 +933,13 @@ class Ne extends d {
|
|
|
849
933
|
};
|
|
850
934
|
}
|
|
851
935
|
}
|
|
852
|
-
class
|
|
853
|
-
constructor(
|
|
854
|
-
super(
|
|
936
|
+
class Pe extends p {
|
|
937
|
+
constructor(t) {
|
|
938
|
+
super(t);
|
|
855
939
|
}
|
|
856
940
|
executeActionOnElement() {
|
|
857
|
-
var
|
|
858
|
-
(
|
|
941
|
+
var t;
|
|
942
|
+
(t = this.element) == null || t.dispatchEvent(
|
|
859
943
|
new KeyboardEvent("keydown", {
|
|
860
944
|
altKey: !1,
|
|
861
945
|
code: "Tab",
|
|
@@ -882,13 +966,13 @@ class be extends d {
|
|
|
882
966
|
};
|
|
883
967
|
}
|
|
884
968
|
}
|
|
885
|
-
class
|
|
886
|
-
constructor(
|
|
887
|
-
super(
|
|
969
|
+
class Le extends p {
|
|
970
|
+
constructor(t) {
|
|
971
|
+
super(t);
|
|
888
972
|
}
|
|
889
973
|
executeActionOnElement() {
|
|
890
|
-
var
|
|
891
|
-
(
|
|
974
|
+
var t;
|
|
975
|
+
(t = this.element) == null || t.dispatchEvent(
|
|
892
976
|
new KeyboardEvent("keydown", {
|
|
893
977
|
altKey: !1,
|
|
894
978
|
code: "Enter",
|
|
@@ -915,8 +999,8 @@ class Oe extends d {
|
|
|
915
999
|
};
|
|
916
1000
|
}
|
|
917
1001
|
}
|
|
918
|
-
var
|
|
919
|
-
const
|
|
1002
|
+
var Ue = /* @__PURE__ */ ((e) => (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))(Ue || {});
|
|
1003
|
+
const X = {
|
|
920
1004
|
Escape: 27,
|
|
921
1005
|
Enter: 13,
|
|
922
1006
|
Tab: 9,
|
|
@@ -931,10 +1015,10 @@ const B = {
|
|
|
931
1015
|
Alt: 18,
|
|
932
1016
|
Meta: 91
|
|
933
1017
|
};
|
|
934
|
-
class
|
|
1018
|
+
class Re extends p {
|
|
935
1019
|
constructor(n, s) {
|
|
936
1020
|
super(n);
|
|
937
|
-
|
|
1021
|
+
r(this, "key");
|
|
938
1022
|
this.key = s;
|
|
939
1023
|
}
|
|
940
1024
|
executeActionOnElement() {
|
|
@@ -943,9 +1027,9 @@ class Ie extends d {
|
|
|
943
1027
|
new KeyboardEvent("keydown", {
|
|
944
1028
|
key: this.key,
|
|
945
1029
|
code: this.key,
|
|
946
|
-
keyCode:
|
|
1030
|
+
keyCode: X[this.key],
|
|
947
1031
|
charCode: 0,
|
|
948
|
-
which:
|
|
1032
|
+
which: X[this.key],
|
|
949
1033
|
altKey: !1,
|
|
950
1034
|
ctrlKey: !1,
|
|
951
1035
|
metaKey: !1,
|
|
@@ -967,10 +1051,10 @@ class Ie extends d {
|
|
|
967
1051
|
};
|
|
968
1052
|
}
|
|
969
1053
|
}
|
|
970
|
-
class
|
|
1054
|
+
class $e extends p {
|
|
971
1055
|
constructor(n, s) {
|
|
972
1056
|
super(n);
|
|
973
|
-
|
|
1057
|
+
r(this, "file");
|
|
974
1058
|
this.file = s;
|
|
975
1059
|
}
|
|
976
1060
|
executeActionOnElement() {
|
|
@@ -978,12 +1062,12 @@ class Le extends d {
|
|
|
978
1062
|
s.items.add(this.file);
|
|
979
1063
|
const o = s.files;
|
|
980
1064
|
n.files = o, n.dispatchEvent(new Event("change"));
|
|
981
|
-
function
|
|
982
|
-
var
|
|
983
|
-
return l != null && l.parentElement ? ((
|
|
1065
|
+
function i(l) {
|
|
1066
|
+
var y;
|
|
1067
|
+
return l != null && l.parentElement ? ((y = l.parentElement) == null ? void 0 : y.tagName.toLowerCase()) === "form" ? l.parentElement : i(l.parentElement) : null;
|
|
984
1068
|
}
|
|
985
|
-
const
|
|
986
|
-
|
|
1069
|
+
const c = i(n);
|
|
1070
|
+
c && c.dispatchEvent(new Event("change"));
|
|
987
1071
|
}
|
|
988
1072
|
getDescription() {
|
|
989
1073
|
return `Upload file in ${this.getElementName()}`;
|
|
@@ -995,18 +1079,18 @@ class Le extends d {
|
|
|
995
1079
|
};
|
|
996
1080
|
}
|
|
997
1081
|
}
|
|
998
|
-
class
|
|
1082
|
+
class Je extends p {
|
|
999
1083
|
constructor(n, s) {
|
|
1000
1084
|
super(n);
|
|
1001
|
-
|
|
1085
|
+
r(this, "memorySlotName");
|
|
1002
1086
|
this.memorySlotName = s;
|
|
1003
1087
|
}
|
|
1004
1088
|
executeActionOnElement() {
|
|
1005
|
-
var s, o,
|
|
1089
|
+
var s, o, i, c;
|
|
1006
1090
|
let n = this.element;
|
|
1007
|
-
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((
|
|
1091
|
+
if (((s = this.element) == null ? void 0 : s.tagName) !== "INPUT" && ((o = this.element) == null ? void 0 : o.tagName) !== "SELECT" && ((i = this.element) == null ? void 0 : i.tagName) !== "TEXTAREA" && (n = (c = this.element) == null ? void 0 : c.querySelectorAll("input")[0], !n))
|
|
1008
1092
|
throw new Error("Input element not found. Not able to save value from element " + this.getElementName());
|
|
1009
|
-
|
|
1093
|
+
g.dispatch(d.SAVE_VALUE, {
|
|
1010
1094
|
memorySlotName: this.memorySlotName,
|
|
1011
1095
|
value: n.value
|
|
1012
1096
|
});
|
|
@@ -1022,10 +1106,10 @@ class Pe extends d {
|
|
|
1022
1106
|
};
|
|
1023
1107
|
}
|
|
1024
1108
|
}
|
|
1025
|
-
class
|
|
1109
|
+
class Ke extends E {
|
|
1026
1110
|
constructor(n) {
|
|
1027
1111
|
super();
|
|
1028
|
-
|
|
1112
|
+
r(this, "miliseconds");
|
|
1029
1113
|
this.miliseconds = n;
|
|
1030
1114
|
}
|
|
1031
1115
|
getDescription() {
|
|
@@ -1038,16 +1122,16 @@ class $e extends E {
|
|
|
1038
1122
|
};
|
|
1039
1123
|
}
|
|
1040
1124
|
async executeAction() {
|
|
1041
|
-
await
|
|
1125
|
+
await A(this.miliseconds);
|
|
1042
1126
|
}
|
|
1043
1127
|
resetAction() {
|
|
1044
1128
|
}
|
|
1045
1129
|
}
|
|
1046
|
-
class
|
|
1130
|
+
class Ve extends E {
|
|
1047
1131
|
constructor(n) {
|
|
1048
1132
|
super();
|
|
1049
|
-
|
|
1050
|
-
|
|
1133
|
+
r(this, "uiElement");
|
|
1134
|
+
r(this, "tries");
|
|
1051
1135
|
this.uiElement = n, this.tries = 0;
|
|
1052
1136
|
}
|
|
1053
1137
|
updateTries(n) {
|
|
@@ -1061,7 +1145,7 @@ class Ue extends E {
|
|
|
1061
1145
|
return (n = this.uiElement) == null ? void 0 : n.getElementName();
|
|
1062
1146
|
}
|
|
1063
1147
|
async executeAction() {
|
|
1064
|
-
await
|
|
1148
|
+
await J(this, this.uiElement, 1e3, 10, !0);
|
|
1065
1149
|
}
|
|
1066
1150
|
getDescription() {
|
|
1067
1151
|
return "Wait until " + this.getElementName() + " is removed";
|
|
@@ -1073,7 +1157,7 @@ class Ue extends E {
|
|
|
1073
1157
|
};
|
|
1074
1158
|
}
|
|
1075
1159
|
}
|
|
1076
|
-
class
|
|
1160
|
+
class Me extends E {
|
|
1077
1161
|
constructor() {
|
|
1078
1162
|
super();
|
|
1079
1163
|
}
|
|
@@ -1087,15 +1171,15 @@ class Re extends E {
|
|
|
1087
1171
|
};
|
|
1088
1172
|
}
|
|
1089
1173
|
async executeAction() {
|
|
1090
|
-
await
|
|
1174
|
+
await a.pause();
|
|
1091
1175
|
}
|
|
1092
1176
|
resetAction() {
|
|
1093
1177
|
}
|
|
1094
1178
|
}
|
|
1095
|
-
class
|
|
1179
|
+
class Fe extends E {
|
|
1096
1180
|
constructor(n) {
|
|
1097
1181
|
super();
|
|
1098
|
-
|
|
1182
|
+
r(this, "description");
|
|
1099
1183
|
this.description = n;
|
|
1100
1184
|
}
|
|
1101
1185
|
getDescription() {
|
|
@@ -1108,14 +1192,14 @@ class Je extends E {
|
|
|
1108
1192
|
};
|
|
1109
1193
|
}
|
|
1110
1194
|
async executeAction() {
|
|
1111
|
-
return await
|
|
1112
|
-
|
|
1195
|
+
return await a.uiUtils.showAlert("Waiting manual step..."), new Promise((n, s) => {
|
|
1196
|
+
g.on(d.USER_ACCEPT, async () => (await a.uiUtils.hideAlert(), n(!0))), g.on(d.USER_REJECT, async () => (await a.uiUtils.hideAlert(), s()));
|
|
1113
1197
|
});
|
|
1114
1198
|
}
|
|
1115
1199
|
resetAction() {
|
|
1116
1200
|
}
|
|
1117
1201
|
}
|
|
1118
|
-
class
|
|
1202
|
+
class We extends E {
|
|
1119
1203
|
constructor() {
|
|
1120
1204
|
super();
|
|
1121
1205
|
}
|
|
@@ -1134,437 +1218,269 @@ class Ve extends E {
|
|
|
1134
1218
|
resetAction() {
|
|
1135
1219
|
}
|
|
1136
1220
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
await this.condition(), await this.ifAction.execute();
|
|
1163
|
-
} catch {
|
|
1164
|
-
this.elseAction && await this.elseAction.execute();
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
resetAction() {
|
|
1168
|
-
var n;
|
|
1169
|
-
this.ifAction.reset(), (n = this.elseAction) == null || n.reset();
|
|
1170
|
-
}
|
|
1171
|
-
compileSteps() {
|
|
1172
|
-
var n;
|
|
1173
|
-
this.ifAction.compileSteps(), (n = this.elseAction) == null || n.compileSteps();
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
const U = (t) => t.toLocaleDateString("en-US", { year: "numeric", month: "2-digit", day: "2-digit" }), J = (t) => {
|
|
1177
|
-
const e = /* @__PURE__ */ new Date();
|
|
1178
|
-
return U(new Date(e.setDate(e.getDate() + t)));
|
|
1179
|
-
}, _ = (t) => {
|
|
1180
|
-
const e = /* @__PURE__ */ new Date();
|
|
1181
|
-
return U(new Date(e.setMonth(e.getMonth() + t)));
|
|
1182
|
-
}, Fe = J(1), Me = J(-1), We = J(7), qe = J(-7), Be = _(1), He = _(-1), ht = {
|
|
1183
|
-
formatDate: U,
|
|
1184
|
-
today: U(/* @__PURE__ */ new Date()),
|
|
1185
|
-
tomorrow: Fe,
|
|
1186
|
-
nextWeek: We,
|
|
1187
|
-
nextMonth: Be,
|
|
1188
|
-
yesterday: Me,
|
|
1189
|
-
lastWeek: qe,
|
|
1190
|
-
lastMonth: He
|
|
1191
|
-
};
|
|
1192
|
-
class je {
|
|
1193
|
-
constructor() {
|
|
1194
|
-
i(this, "enabled", !1);
|
|
1195
|
-
}
|
|
1196
|
-
setEnabled(e) {
|
|
1197
|
-
this.enabled = e;
|
|
1198
|
-
}
|
|
1199
|
-
log(...e) {
|
|
1200
|
-
this.enabled && console.log("[tomation]", ...e);
|
|
1201
|
-
}
|
|
1202
|
-
groupCollapsed(...e) {
|
|
1203
|
-
this.enabled && console.groupCollapsed("[tomation]", ...e);
|
|
1204
|
-
}
|
|
1205
|
-
groupEnd() {
|
|
1206
|
-
this.enabled && console.groupEnd();
|
|
1207
|
-
}
|
|
1208
|
-
error(...e) {
|
|
1209
|
-
this.enabled && console.error("[tomation]", ...e);
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
const u = new je(), Xe = (t) => {
|
|
1213
|
-
u.setEnabled(t);
|
|
1214
|
-
}, y = class y {
|
|
1215
|
-
static compileAction(e) {
|
|
1216
|
-
const n = y.currentAction;
|
|
1217
|
-
y.currentAction = e, e.compileSteps(), y.currentAction = n;
|
|
1218
|
-
}
|
|
1219
|
-
static compileConditionalAction(e) {
|
|
1220
|
-
const n = y.currentAction;
|
|
1221
|
-
y.currentAction = e, e.compileSteps(), y.currentAction = n;
|
|
1222
|
-
}
|
|
1223
|
-
static addAction(e) {
|
|
1224
|
-
u.log("Add action: ", e.getDescription()), y.currentAction.addStep(e);
|
|
1225
|
-
}
|
|
1226
|
-
static init(e) {
|
|
1227
|
-
y.currentAction = e, y.isCompiling = !0, u.groupCollapsed("Compile: " + e.getDescription()), e.compileSteps(), y.isCompiling = !1, u.log("Compilation finished"), u.groupEnd();
|
|
1228
|
-
}
|
|
1221
|
+
let k, B;
|
|
1222
|
+
const qe = (e) => {
|
|
1223
|
+
const t = k;
|
|
1224
|
+
k = e, e.compileSteps(), k = t;
|
|
1225
|
+
}, Be = (e) => {
|
|
1226
|
+
u.log("Add action: ", e.getDescription()), k.addStep(e);
|
|
1227
|
+
}, He = (e) => {
|
|
1228
|
+
k = e, B = !0, u.groupCollapsed("Compile: " + e.getDescription()), e.compileSteps(), B = !1, u.log("Compilation finished"), u.groupEnd();
|
|
1229
|
+
}, _e = () => k, je = () => B, h = {
|
|
1230
|
+
init: He,
|
|
1231
|
+
addAction: Be,
|
|
1232
|
+
compileAction: qe,
|
|
1233
|
+
getCurrentAction: _e,
|
|
1234
|
+
getIsCompiling: je
|
|
1235
|
+
}, U = {}, Xe = (e) => {
|
|
1236
|
+
if (U[e])
|
|
1237
|
+
U[e]();
|
|
1238
|
+
else
|
|
1239
|
+
throw console.log("Available Tests:", Object.keys(U)), new Error(`Test with id ${e} not found.`);
|
|
1240
|
+
}, mt = (e, t) => {
|
|
1241
|
+
console.log(`Registering Test: ${e}...`);
|
|
1242
|
+
const n = new ee(e, t);
|
|
1243
|
+
h.init(n), console.log(`Compiled Test: ${e}`), g.dispatch(d.REGISTER_TEST, { id: e, action: n.getJSON() }), console.log(`Registered Test: ${e} in TestsMap`), U[e] = () => {
|
|
1244
|
+
W.start(n);
|
|
1245
|
+
};
|
|
1229
1246
|
};
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
throw u.error("Not able to run test while other test is running."), new Error("Not able to run test while other test is running.");
|
|
1259
|
-
c.status = "Playing", c.runMode = "Normal", u.groupCollapsed("Start Action: ", e.getDescription()), m.dispatch("tomation-test-started", {
|
|
1260
|
-
action: e == null ? void 0 : e.getJSON()
|
|
1247
|
+
function gt(e) {
|
|
1248
|
+
const {
|
|
1249
|
+
matches: t,
|
|
1250
|
+
tests: n = [],
|
|
1251
|
+
speed: s = "NORMAL",
|
|
1252
|
+
debug: o = !1
|
|
1253
|
+
} = e, i = Z();
|
|
1254
|
+
if (console.log(`[tomation] Initializing on URL: ${document.location.href} with session ID: ${i}`), window.postMessage({
|
|
1255
|
+
message: "injectedScript-to-contentScript",
|
|
1256
|
+
sender: "tomation",
|
|
1257
|
+
payload: {
|
|
1258
|
+
cmd: d.SESSION_INIT,
|
|
1259
|
+
params: {
|
|
1260
|
+
sessionId: i
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}), !(typeof t == "string" ? document.location.href.includes(t) : !!document.location.href.match(t))) {
|
|
1264
|
+
console.log(`[tomation] URL "${document.location.href}" does not match "${t}"`), window.postMessage({
|
|
1265
|
+
message: "injectedScript-to-contentScript",
|
|
1266
|
+
sender: "tomation",
|
|
1267
|
+
payload: {
|
|
1268
|
+
cmd: d.URL_MISMATCH,
|
|
1269
|
+
params: {
|
|
1270
|
+
sessionId: i,
|
|
1271
|
+
matches: t,
|
|
1272
|
+
url: document.location.href
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1261
1275
|
});
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1276
|
+
return;
|
|
1277
|
+
}
|
|
1278
|
+
try {
|
|
1279
|
+
console.log("[tomation] Setting up messaging bridge with extension..."), Object.values(d).forEach((l) => {
|
|
1280
|
+
console.log(`[tomation] Setting up listener for event "${l}"`), g.on(l, (y) => {
|
|
1281
|
+
const w = {
|
|
1282
|
+
cmd: l,
|
|
1283
|
+
params: {
|
|
1284
|
+
...y,
|
|
1285
|
+
sessionId: i
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
console.log(`[tomation] Dispatching event "${l}" to extension: `, w), window.postMessage({
|
|
1289
|
+
message: "injectedScript-to-contentScript",
|
|
1290
|
+
sender: "tomation",
|
|
1291
|
+
payload: w
|
|
1292
|
+
});
|
|
1269
1293
|
});
|
|
1270
|
-
}
|
|
1294
|
+
}), window.addEventListener("message", (l) => {
|
|
1295
|
+
try {
|
|
1296
|
+
console.log("[tomation] Received message from extension:", l.data);
|
|
1297
|
+
const { message: y, sender: w, payload: f } = l.data || {}, { cmd: S, params: T } = f || {};
|
|
1298
|
+
if (w !== "web-extension")
|
|
1299
|
+
return;
|
|
1300
|
+
if (y === "contentScript-to-injectedScript") {
|
|
1301
|
+
const x = {
|
|
1302
|
+
"run-test-request": () => Xe(T == null ? void 0 : T.testId),
|
|
1303
|
+
"reload-tests-request": () => _(window, n || []),
|
|
1304
|
+
"pause-test-request": () => a.pause(),
|
|
1305
|
+
"stop-test-request": () => a.stop(),
|
|
1306
|
+
"continue-test-request": () => a.continue(),
|
|
1307
|
+
"next-step-request": () => a.next(),
|
|
1308
|
+
"retry-action-request": () => a.retryAction(),
|
|
1309
|
+
"skip-action-request": () => a.skipAction(),
|
|
1310
|
+
"user-accept-request": () => g.dispatch(d.USER_ACCEPT),
|
|
1311
|
+
"user-reject-request": () => g.dispatch(d.USER_REJECT)
|
|
1312
|
+
}[S];
|
|
1313
|
+
x ? (console.log(`[tomation] Executing command "${S}" from extension`), x()) : console.warn(`[tomation] Unknown command "${S}" from extension`);
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
} catch (y) {
|
|
1317
|
+
console.error("[tomation] Error handling message from extension:", y);
|
|
1318
|
+
}
|
|
1319
|
+
}), _(window, n), a.setDebug(o), a.speed = Q[s], window.postMessage({
|
|
1320
|
+
message: "injectedScript-to-contentScript",
|
|
1321
|
+
sender: "tomation",
|
|
1322
|
+
payload: {
|
|
1323
|
+
cmd: d.SESSION_CONNECTED,
|
|
1324
|
+
params: {
|
|
1325
|
+
speed: a.speed,
|
|
1326
|
+
sessionId: i
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}), console.log("[tomation] Ready ✓");
|
|
1330
|
+
} catch (l) {
|
|
1331
|
+
console.error("[tomation] Initialization failed:", l);
|
|
1271
1332
|
}
|
|
1272
1333
|
}
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
m.dispatch("tomation-register-test", { id: t }), console.log(`Registered Test: ${t} in TestsMap`), P[t] = () => {
|
|
1277
|
-
u.log(`Compilation of Test ${t} starts...`), h.init(n), u.log(`Compilation of Test ${t} Finished.`), u.log(`Start running Test ${t}...`), te.start(n);
|
|
1278
|
-
};
|
|
1279
|
-
}, Ge = (t) => {
|
|
1280
|
-
if (P[t])
|
|
1281
|
-
P[t]();
|
|
1282
|
-
else
|
|
1283
|
-
throw console.log("Available Tests:", Object.keys(P)), new Error(`Test with id ${t} not found.`);
|
|
1284
|
-
}, pt = (t, e) => async (n) => {
|
|
1285
|
-
const s = new Z(t, e);
|
|
1286
|
-
if (s.setParams(n), c.status == "Stopped" && !h.isCompiling)
|
|
1334
|
+
const yt = (e, t) => async (n) => {
|
|
1335
|
+
const s = new ee(e, t);
|
|
1336
|
+
if (s.setParams(n), !W.running && !h.getIsCompiling())
|
|
1287
1337
|
try {
|
|
1288
|
-
u.log(`Compilation of Task ${
|
|
1338
|
+
u.log(`Compilation of Task ${e} starts...`), h.init(s), u.log(`Compilation of Task ${e} Finished.`), u.log(`Start running Task ${e}...`), await W.start(s), u.log(`End of Task ${e}: SUCCESS`);
|
|
1289
1339
|
} catch (o) {
|
|
1290
|
-
u.error("Error running task " +
|
|
1340
|
+
u.error("Error running task " + e + ". " + o.message);
|
|
1291
1341
|
}
|
|
1292
1342
|
else
|
|
1293
|
-
u.log(`Adding action ${
|
|
1294
|
-
},
|
|
1295
|
-
const
|
|
1296
|
-
h.addAction(
|
|
1297
|
-
},
|
|
1298
|
-
textIs: (
|
|
1299
|
-
h.addAction(new
|
|
1343
|
+
u.log(`Adding action ${e} to compilation stack`), h.addAction(s), h.compileAction(s);
|
|
1344
|
+
}, Et = (e) => {
|
|
1345
|
+
const t = new Ce(e);
|
|
1346
|
+
h.addAction(t);
|
|
1347
|
+
}, wt = (e) => ({
|
|
1348
|
+
textIs: (t) => {
|
|
1349
|
+
h.addAction(new Se(e, t));
|
|
1300
1350
|
},
|
|
1301
|
-
containsText: (
|
|
1302
|
-
h.addAction(new
|
|
1351
|
+
containsText: (t) => {
|
|
1352
|
+
h.addAction(new Te(e, t));
|
|
1303
1353
|
},
|
|
1304
|
-
valueIs: (
|
|
1305
|
-
h.addAction(new
|
|
1354
|
+
valueIs: (t) => {
|
|
1355
|
+
h.addAction(new ke(e, t));
|
|
1306
1356
|
},
|
|
1307
1357
|
exists: () => {
|
|
1308
|
-
h.addAction(new
|
|
1358
|
+
h.addAction(new Ne(e));
|
|
1309
1359
|
},
|
|
1310
1360
|
notExists: () => {
|
|
1311
|
-
h.addAction(new
|
|
1312
|
-
}
|
|
1313
|
-
}), yt = (t) => ({
|
|
1314
|
-
in: (e) => {
|
|
1315
|
-
const n = new ke(e, t);
|
|
1316
|
-
h.addAction(n);
|
|
1317
|
-
}
|
|
1318
|
-
}), Et = (t) => ({
|
|
1319
|
-
in: (e) => {
|
|
1320
|
-
const n = new Y(e, t);
|
|
1321
|
-
h.addAction(n);
|
|
1361
|
+
h.addAction(new ve(e));
|
|
1322
1362
|
}
|
|
1323
|
-
}),
|
|
1363
|
+
}), ft = (e) => ({
|
|
1324
1364
|
in: (t) => {
|
|
1325
|
-
const
|
|
1326
|
-
h.addAction(
|
|
1365
|
+
const n = new be(t, e);
|
|
1366
|
+
h.addAction(n);
|
|
1327
1367
|
}
|
|
1328
|
-
}),
|
|
1368
|
+
}), xt = (e) => ({
|
|
1329
1369
|
in: (t) => {
|
|
1330
|
-
|
|
1370
|
+
const n = new te(t, e);
|
|
1371
|
+
h.addAction(n);
|
|
1331
1372
|
}
|
|
1332
1373
|
}), At = () => ({
|
|
1333
|
-
in: (
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
}), xt = () => ({
|
|
1337
|
-
in: (t) => {
|
|
1338
|
-
h.addAction(new be(t));
|
|
1374
|
+
in: (e) => {
|
|
1375
|
+
const t = new te(e, "");
|
|
1376
|
+
h.addAction(t);
|
|
1339
1377
|
}
|
|
1340
1378
|
}), Ct = () => ({
|
|
1341
|
-
in: (
|
|
1342
|
-
h.addAction(new Oe(
|
|
1379
|
+
in: (e) => {
|
|
1380
|
+
h.addAction(new Oe(e));
|
|
1343
1381
|
}
|
|
1344
|
-
}), St = (
|
|
1382
|
+
}), St = () => ({
|
|
1345
1383
|
in: (e) => {
|
|
1346
|
-
h.addAction(new Ie(e
|
|
1384
|
+
h.addAction(new Ie(e));
|
|
1347
1385
|
}
|
|
1348
|
-
}),
|
|
1386
|
+
}), Tt = () => ({
|
|
1349
1387
|
in: (e) => {
|
|
1350
|
-
|
|
1351
|
-
h.addAction(n);
|
|
1388
|
+
h.addAction(new Pe(e));
|
|
1352
1389
|
}
|
|
1353
|
-
}),
|
|
1390
|
+
}), kt = () => ({
|
|
1354
1391
|
in: (e) => {
|
|
1355
|
-
|
|
1392
|
+
h.addAction(new Le(e));
|
|
1393
|
+
}
|
|
1394
|
+
}), Nt = (e) => ({
|
|
1395
|
+
in: (t) => {
|
|
1396
|
+
h.addAction(new Re(t, e));
|
|
1397
|
+
}
|
|
1398
|
+
}), vt = (e) => ({
|
|
1399
|
+
in: (t) => {
|
|
1400
|
+
const n = new De(t, e);
|
|
1356
1401
|
h.addAction(n);
|
|
1357
1402
|
}
|
|
1358
|
-
}),
|
|
1359
|
-
in: (
|
|
1360
|
-
const n = new
|
|
1403
|
+
}), bt = (e) => ({
|
|
1404
|
+
in: (t) => {
|
|
1405
|
+
const n = new $e(t, e);
|
|
1361
1406
|
h.addAction(n);
|
|
1362
1407
|
}
|
|
1363
|
-
}),
|
|
1364
|
-
|
|
1408
|
+
}), Dt = (e) => ({
|
|
1409
|
+
in: (t) => {
|
|
1410
|
+
const n = new Je(e, t);
|
|
1411
|
+
h.addAction(n);
|
|
1412
|
+
}
|
|
1413
|
+
}), ze = (e) => {
|
|
1414
|
+
h.addAction(new Ke(e));
|
|
1365
1415
|
};
|
|
1366
|
-
|
|
1416
|
+
ze.untilElement = (e) => ({
|
|
1367
1417
|
isRemoved: () => {
|
|
1368
|
-
h.addAction(new
|
|
1418
|
+
h.addAction(new Ve(e));
|
|
1369
1419
|
}
|
|
1370
1420
|
});
|
|
1371
|
-
const
|
|
1372
|
-
h.addAction(new
|
|
1373
|
-
},
|
|
1374
|
-
h.addAction(new
|
|
1375
|
-
},
|
|
1376
|
-
h.addAction(new
|
|
1377
|
-
},
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
i(this, "currentActionCallback");
|
|
1394
|
-
i(this, "currentAction");
|
|
1395
|
-
this._document = e.document, this.debug = !0, this._uiUtils = new Ee(e), this.speed = 1e3, this.status = "Stopped", this.runMode = "Normal";
|
|
1396
|
-
}
|
|
1397
|
-
get document() {
|
|
1398
|
-
return this._document;
|
|
1399
|
-
}
|
|
1400
|
-
get uiUtils() {
|
|
1401
|
-
return this._uiUtils;
|
|
1402
|
-
}
|
|
1403
|
-
get isStepByStepMode() {
|
|
1404
|
-
return this.runMode == "Step By Step";
|
|
1405
|
-
}
|
|
1406
|
-
get isStopped() {
|
|
1407
|
-
return this.status == "Stopped";
|
|
1408
|
-
}
|
|
1409
|
-
get isPlaying() {
|
|
1410
|
-
return this.status == "Playing";
|
|
1411
|
-
}
|
|
1412
|
-
get isPaused() {
|
|
1413
|
-
return this.status == "Paused";
|
|
1414
|
-
}
|
|
1415
|
-
pause() {
|
|
1416
|
-
u.log("Pause Test"), this.status = "Paused", m.dispatch(
|
|
1417
|
-
"tomation-test-pause"
|
|
1418
|
-
/* TEST_PAUSE */
|
|
1419
|
-
);
|
|
1420
|
-
}
|
|
1421
|
-
continue() {
|
|
1422
|
-
u.log("Continue Test"), this.status = "Playing", this.runMode = "Normal", m.dispatch(
|
|
1423
|
-
"tomation-test-play"
|
|
1424
|
-
/* TEST_PLAY */
|
|
1425
|
-
), this.currentActionCallback && this.currentAction && (u.log("Continue: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
1426
|
-
}
|
|
1427
|
-
next() {
|
|
1428
|
-
u.log("Continue Test to Next Step..."), this.status = "Paused", this.runMode = "Step By Step", this.currentActionCallback && this.currentAction && (u.log("Next: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
1429
|
-
}
|
|
1430
|
-
stop() {
|
|
1431
|
-
u.log("Stop Test"), this.status = "Stopped", this.currentActionCallback && this.currentAction && (u.log("Stop: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0), m.dispatch(
|
|
1432
|
-
"tomation-test-stop"
|
|
1433
|
-
/* TEST_STOP */
|
|
1434
|
-
);
|
|
1435
|
-
}
|
|
1436
|
-
retryAction() {
|
|
1437
|
-
u.log("Retry current step"), this.status = "Playing", m.dispatch(
|
|
1438
|
-
"tomation-test-play"
|
|
1439
|
-
/* TEST_PLAY */
|
|
1440
|
-
), this.currentActionCallback && this.currentAction && (this.currentAction.resetTries && (u.log("Retry: Resetting tries for current action"), this.currentAction.resetTries()), u.log("Retry: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
1441
|
-
}
|
|
1442
|
-
skipAction() {
|
|
1443
|
-
u.log("Skip current step"), this.status = "Playing", this.currentActionCallback && this.currentAction && (this.currentAction.status = Q.SKIPPED, u.log("Skip: Marked current action as SKIPPED"), E.notifyActionUpdated(this.currentAction), u.log("Skip: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
|
|
1444
|
-
}
|
|
1445
|
-
saveCurrentAction(e, n) {
|
|
1446
|
-
u.log("Save current action"), this.currentActionCallback = e, this.currentAction = n;
|
|
1447
|
-
}
|
|
1448
|
-
setDebug(e) {
|
|
1449
|
-
Xe(e);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
let c;
|
|
1453
|
-
const H = (t, e) => (c = new Ze(t), ie(c.document), e == null || e.forEach((n) => n()), c);
|
|
1454
|
-
function It(t) {
|
|
1455
|
-
const {
|
|
1456
|
-
matches: e,
|
|
1457
|
-
tests: n = [],
|
|
1458
|
-
speed: s = "NORMAL",
|
|
1459
|
-
debug: o = !1
|
|
1460
|
-
} = t;
|
|
1461
|
-
if (!(typeof e == "string" ? document.location.href.includes(e) : !!document.location.href.match(e))) {
|
|
1462
|
-
console.log(`[tomation] URL "${document.location.href}" does not match "${e}"`);
|
|
1463
|
-
return;
|
|
1464
|
-
}
|
|
1465
|
-
try {
|
|
1466
|
-
console.log("[tomation] Setting up messaging bridge with extension..."), Object.values(T).forEach((r) => {
|
|
1467
|
-
console.log(`[tomation] Setting up listener for event "${r}"`), m.on(r, (l) => {
|
|
1468
|
-
console.log(`[tomation] Dispatching event "${r}" to extension`, l), window.postMessage({
|
|
1469
|
-
message: "injectedScript-to-contentScript",
|
|
1470
|
-
sender: "tomation",
|
|
1471
|
-
payload: {
|
|
1472
|
-
cmd: r,
|
|
1473
|
-
params: l
|
|
1474
|
-
}
|
|
1475
|
-
});
|
|
1476
|
-
});
|
|
1477
|
-
}), window.addEventListener("message", (r) => {
|
|
1478
|
-
try {
|
|
1479
|
-
console.log("[tomation] Received message from extension:", r.data);
|
|
1480
|
-
const { message: l, sender: w, payload: C } = r.data || {}, { cmd: g, params: k } = C || {};
|
|
1481
|
-
if (w !== "web-extension")
|
|
1482
|
-
return;
|
|
1483
|
-
if (l === "contentScript-to-injectedScript") {
|
|
1484
|
-
const v = {
|
|
1485
|
-
"run-test-request": () => Ge(k == null ? void 0 : k.testId),
|
|
1486
|
-
"reload-tests-request": () => H(window, n || []),
|
|
1487
|
-
"pause-test-request": () => c.pause(),
|
|
1488
|
-
"stop-test-request": () => c.stop(),
|
|
1489
|
-
"continue-test-request": () => c.continue(),
|
|
1490
|
-
"next-step-request": () => c.next(),
|
|
1491
|
-
"retry-action-request": () => c.retryAction(),
|
|
1492
|
-
"skip-action-request": () => c.skipAction(),
|
|
1493
|
-
"user-accept-request": () => m.dispatch(
|
|
1494
|
-
"tomation-user-accept"
|
|
1495
|
-
/* USER_ACCEPT */
|
|
1496
|
-
),
|
|
1497
|
-
"user-reject-request": () => m.dispatch(
|
|
1498
|
-
"tomation-user-reject"
|
|
1499
|
-
/* USER_REJECT */
|
|
1500
|
-
)
|
|
1501
|
-
}[g];
|
|
1502
|
-
v ? (console.log(`[tomation] Executing command "${g}" from extension`), v()) : console.warn(`[tomation] Unknown command "${g}" from extension`);
|
|
1503
|
-
return;
|
|
1504
|
-
}
|
|
1505
|
-
} catch (l) {
|
|
1506
|
-
console.error("[tomation] Error handling message from extension:", l);
|
|
1507
|
-
}
|
|
1508
|
-
}), window.postMessage({
|
|
1509
|
-
message: "injectedScript-to-contentScript",
|
|
1510
|
-
sender: "tomation",
|
|
1511
|
-
payload: {
|
|
1512
|
-
cmd: "tomation-session-init",
|
|
1513
|
-
params: {
|
|
1514
|
-
sessionId: G()
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
}), H(window, n), c.setDebug(o), c.speed = ee[s], console.log("[tomation] Ready ✓");
|
|
1518
|
-
} catch (r) {
|
|
1519
|
-
console.error("[tomation] Initialization failed:", r);
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1421
|
+
const Ot = () => {
|
|
1422
|
+
h.addAction(new Me());
|
|
1423
|
+
}, It = (e) => {
|
|
1424
|
+
h.addAction(new Fe(e));
|
|
1425
|
+
}, Pt = () => {
|
|
1426
|
+
h.addAction(new We());
|
|
1427
|
+
}, $ = (e) => e.toLocaleDateString("en-US", { year: "numeric", month: "2-digit", day: "2-digit" }), K = (e) => {
|
|
1428
|
+
const t = /* @__PURE__ */ new Date();
|
|
1429
|
+
return $(new Date(t.setDate(t.getDate() + e)));
|
|
1430
|
+
}, ne = (e) => {
|
|
1431
|
+
const t = /* @__PURE__ */ new Date();
|
|
1432
|
+
return $(new Date(t.setMonth(t.getMonth() + e)));
|
|
1433
|
+
}, Ge = K(1), Qe = K(-1), Ze = K(7), Ye = K(-7), et = ne(1), tt = ne(-1), Lt = {
|
|
1434
|
+
formatDate: $,
|
|
1435
|
+
today: $(/* @__PURE__ */ new Date()),
|
|
1436
|
+
tomorrow: Ge,
|
|
1437
|
+
nextWeek: Ze,
|
|
1438
|
+
nextMonth: et,
|
|
1439
|
+
yesterday: Qe,
|
|
1440
|
+
lastWeek: Ye,
|
|
1441
|
+
lastMonth: tt
|
|
1442
|
+
};
|
|
1522
1443
|
export {
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
Ct as
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
yt as
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
Xe as setAutomationLogs,
|
|
1566
|
-
_e as setFilterLogs,
|
|
1567
|
-
ot as titleIs,
|
|
1568
|
-
It as tomation,
|
|
1569
|
-
f as wait
|
|
1444
|
+
Y as ACTION_STATUS,
|
|
1445
|
+
wt as Assert,
|
|
1446
|
+
g as AutomationEvents,
|
|
1447
|
+
a as AutomationInstance,
|
|
1448
|
+
At as ClearValue,
|
|
1449
|
+
Et as Click,
|
|
1450
|
+
Lt as DateUtils,
|
|
1451
|
+
d as EVENT_NAMES,
|
|
1452
|
+
Ue as KEY_MAP,
|
|
1453
|
+
It as ManualTask,
|
|
1454
|
+
Ot as Pause,
|
|
1455
|
+
St as PressDownKey,
|
|
1456
|
+
kt as PressEnterKey,
|
|
1457
|
+
Ct as PressEscKey,
|
|
1458
|
+
Nt as PressKey,
|
|
1459
|
+
Tt as PressTabKey,
|
|
1460
|
+
Pt as ReloadPage,
|
|
1461
|
+
Dt as SaveValue,
|
|
1462
|
+
ft as Select,
|
|
1463
|
+
_ as Setup,
|
|
1464
|
+
yt as Task,
|
|
1465
|
+
mt as Test,
|
|
1466
|
+
Q as TestSpeed,
|
|
1467
|
+
xt as Type,
|
|
1468
|
+
vt as TypePassword,
|
|
1469
|
+
ie as UIElement,
|
|
1470
|
+
bt as UploadFile,
|
|
1471
|
+
ze as Wait,
|
|
1472
|
+
dt as and,
|
|
1473
|
+
ot as classIncludes,
|
|
1474
|
+
st as classIs,
|
|
1475
|
+
gt as default,
|
|
1476
|
+
ut as elementIndexIs,
|
|
1477
|
+
ht as firstChildTextIs,
|
|
1478
|
+
rt as innerTextContains,
|
|
1479
|
+
it as innerTextIs,
|
|
1480
|
+
pt as is,
|
|
1481
|
+
lt as isFirstElement,
|
|
1482
|
+
ct as placeholderIs,
|
|
1483
|
+
at as titleIs,
|
|
1484
|
+
gt as tomation,
|
|
1485
|
+
A as wait
|
|
1570
1486
|
};
|