tomation 0.0.13 → 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.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 e = !1, t = (...t) => {
3
- e && console.log("[UIElement Filter]", ...t);
4
- }, n = (e) => (n) => {
5
- let r = n.className == e;
6
- return t(`classIs('${e}') on`, n, "=>", r), r;
7
- }, r = (e) => (n) => {
8
- let r = n.className.split(" ").includes(e);
9
- return t(`classIncludes('${e}') on`, n, "=>", r), r;
10
- }, i = (e) => (n) => {
11
- let r = n.textContent?.trim() == e;
12
- return t(`innerTextIs('${e}') on`, n, "=>", r), r;
13
- }, a = (e) => (n) => {
14
- let r = n.innerText.trim().includes(e);
15
- return t(`innerTextContains('${e}') on`, n, "=>", r), r;
16
- }, o = (e) => (n) => {
17
- let r = n.title == e;
18
- return t(`titleIs('${e}') on`, n, "=>", r), r;
19
- }, s = (e) => (n) => {
20
- let r = n.placeholder === e;
21
- return t(`placeholderIs('${e}') on`, n, "=>", r), r;
22
- }, c = () => (e, n) => {
23
- let r = n === 0;
24
- return t("isFirstElement on", e, "index", n, "=>", r), r;
25
- }, l = (e) => (n, r) => {
26
- let i = r === e;
27
- return t(`elementIndexIs(${e}) on`, n, "elemIndex", r, "=>", i), i;
28
- }, u = (e) => (n) => {
29
- let r = (n?.firstChild).innerText.trim() === e;
30
- return t(`firstChildTextIs('${e}') on`, n, "=>", r), r;
31
- }, d = (e) => (n, r) => {
32
- let i = e.every((e, i) => {
33
- let a = e(n, r);
34
- return t(`and condition[${i}] on`, n, "elemIndex", r, "=>", a), a;
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 t("and final result on", n, "elemIndex", r, "=>", i), i;
37
- }, f = class {
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
- }, p, ee = (e) => {
50
- p = e;
51
- }, m = (e, t) => (n = p, r) => {
52
- n ||= p, console.log("Searching elem from Root = ", n);
53
- let i = [];
54
- n.querySelectorAll(e).forEach((e) => {
55
- e.style.display !== "none" && i.push(e);
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 a;
58
- return t ? (console.log("Applying filter ", t), console.log(" -- to " + i.length + "elements: ", i), a = i.filter((e, n, r) => {
59
- console.log("Apply filter to item " + n + ": ", e);
60
- let i = t(e, n, r);
61
- return console.log(` -> Item ${n} ${i ? "Match" : "Discarded"}`), i;
62
- })[0]) : a = i[0], a && r && (console.log("Apply post process to = ", a), a = r(a)), console.log("Return elem = ", a), a;
63
- }, h = (e, t, n) => ({ as: (r) => new f(r, e, t, n) }), te = (e, t) => ({
64
- ...h(e, t),
65
- postProcess: (n) => ({ ...h(e, t, n) })
66
- }), g = (e) => ({
67
- ...h(e, null),
68
- childOf: (t) => ({ ...te(e, t) }),
69
- postProcess: (t) => ({ ...h(e, null, t) })
70
- }), _ = (e) => ({ where: (t) => g(m(e, t)) }), ne = {
71
- DIV: _("div"),
72
- BUTTON: _("button"),
73
- INPUT: _("input"),
74
- TEXTAREA: _("textarea"),
75
- ELEMENT: (e) => _(e),
76
- identifiedBy: (e) => g(m("#" + e))
77
- }, v = /* @__PURE__ */ function(e) {
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
- }(v || {}), y = new class {
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, []), this.events.get(e)?.push(t);
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
- this.events.has(e) && this.events.set(e, this.events.get(e)?.filter((e) => e !== t) || []);
102
+ let n = this.events.get(e);
103
+ n && (n.delete(t), n.size === 0 && this.events.delete(e));
89
104
  }
90
- dispatch(e, t) {
91
- this.events.has(e) && this.events.get(e)?.forEach((n) => {
92
- console.log(`Dispatch Event ${e}:`, t), n(t);
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
- }(), b = !1, x = {
96
- setEnabled(e) {
97
- b = e;
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
- }, S = (e = 2e3) => new Promise((t) => {
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
- }), C = (e, t) => {
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
- }, re = class {
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 && C(n, t.styles), t.parent && t.parent.appendChild(n)), n;
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 = O.document.createElement("DIV");
225
- t.innerText = e, C(t, {
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 S(4e3), t.style.opacity = "0", await S(4e3), this.devToolsMessageContainer.removeChild(t), await S(1e3);
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 S(200);
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 = O.document.createElement("DIV"), n = O.document.body;
238
- t.innerText = e, C(n, { paddingTop: "30px" }), C(this.devToolsAlertContainer, { display: "flex" }), this.devToolsAlertContainer.appendChild(t);
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
- C(this.devToolsAlertContainer, { display: "none" });
242
- let e = O.document.body;
243
- C(e, { paddingTop: "0" }), this.devToolsAlertContainer.firstChild && this.devToolsAlertContainer.removeChild(this.devToolsAlertContainer.firstChild);
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 S(200), this.devToolsCheckElementContainer.style.display = "none";
260
+ this.devToolsCheckElementContainer.style.opacity = "0", await x(200), this.devToolsCheckElementContainer.style.display = "none";
247
261
  }
248
262
  displayContext(e) {
249
- C(this.contextViewerContainer, {
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", C(t, {
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", C(n, {
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, w(r, e.beforeInputValues);
286
+ r.innerHTML = e.beforeHTML, C(r, e.beforeInputValues);
273
287
  let i = this.document.createElement("DIV");
274
- i.innerHTML = e.afterHTML, w(i, e.afterInputValues), this.contextViewerContainer.appendChild(t), t.appendChild(r), setTimeout(() => {
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), C(this.contextViewerContainer, { display: "none" });
290
+ this.contextViewerContainer.removeChild(n), S(this.contextViewerContainer, { display: "none" });
277
291
  }, 2e3);
278
292
  }, 2e3);
279
293
  }
280
- }, w = (e, t) => {
294
+ }, C = (e, t) => {
281
295
  e.querySelectorAll("input").forEach((e) => {
282
296
  e.value = t[e.getAttribute("input-id") || ""];
283
297
  });
284
- }, T = /* @__PURE__ */ function(e) {
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
- }(T || {}), E = /* @__PURE__ */ function(e) {
300
+ }(w || {}), T = /* @__PURE__ */ function(e) {
287
301
  return e.PLAYING = "Playing", e.STOPPED = "Stopped", e.PAUSED = "Paused", e;
288
- }(E || {}), D = /* @__PURE__ */ function(e) {
302
+ }(T || {}), E = /* @__PURE__ */ function(e) {
289
303
  return e.NORMAL = "Normal", e.STEPBYSTEP = "Step By Step", e;
290
- }(D || {}), ie = class {
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
- constructor(e) {
300
- this._document = e.document, this.debug = !0, this._uiUtils = new re(e), this.speed = T.NORMAL, this.status = E.STOPPED, this.runMode = D.NORMAL;
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 == D.STEPBYSTEP;
324
+ return this.runMode == E.STEPBYSTEP;
310
325
  }
311
326
  get isStopped() {
312
- return this.status == E.STOPPED;
327
+ return this.status == T.STOPPED;
313
328
  }
314
329
  get isPlaying() {
315
- return this.status == E.PLAYING;
330
+ return this.status == T.PLAYING;
316
331
  }
317
332
  get isPaused() {
318
- return this.status == E.PAUSED;
333
+ return this.status == T.PAUSED;
319
334
  }
320
335
  pause() {
321
- x.log("Pause Test"), this.status = E.PAUSED, y.dispatch(v.TEST_PAUSE);
336
+ n.log("Pause Test"), this.status = T.PAUSED, b.dispatch(y.TEST_PAUSE);
322
337
  }
323
338
  continue() {
324
- x.log("Continue Test"), this.status = E.PLAYING, this.runMode = D.NORMAL, y.dispatch(v.TEST_PLAY), this.currentActionCallback && this.currentAction && (x.log("Continue: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
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
- x.log("Continue Test to Next Step..."), this.status = E.PLAYING, this.runMode = D.STEPBYSTEP, y.dispatch(v.TEST_PLAY), this.currentActionCallback && this.currentAction && (x.log("Next: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
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
- x.log("Stop Test"), this.status = E.STOPPED, this.currentActionCallback && this.currentAction && (x.log("Stop: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0), y.dispatch(v.TEST_STOP);
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
- x.log("Retry current step"), this.status = E.PLAYING, y.dispatch(v.TEST_PLAY), this.currentActionCallback && this.currentAction && (this.currentAction.resetTries && (x.log("Retry: Resetting tries for current action"), this.currentAction.resetTries()), x.log("Retry: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
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
- x.log("Skip current step"), this.status = E.PLAYING, this.currentActionCallback && this.currentAction && (this.currentAction.status = L.SKIPPED, x.log("Skip: Marked current action as SKIPPED"), R.notifyActionUpdated(this.currentAction), x.log("Skip: Executing current action callback"), this.currentActionCallback(this.currentAction), this.currentActionCallback = void 0);
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
- x.log("Save current action"), this.currentActionCallback = e, this.currentAction = t;
354
+ n.log("Save current action"), this.currentActionCallback = e, this.currentAction = t;
340
355
  }
341
356
  setDebug(e) {
342
- x.setEnabled(e);
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
- }, O, k = (e, t) => (O = new ie(e), ee(O.document), t?.forEach((e) => e()), O), A = !1;
345
- async function ae(e) {
346
- if (A) throw x.error("Not able to run test while other test is running."), Error("Not able to run test while other test is running.");
347
- A = !0, O.status = E.PLAYING, O.runMode = D.NORMAL, x.groupCollapsed("Start Action: ", e.getDescription()), y.dispatch(v.TEST_STARTED, { action: e?.getJSON() });
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(), y.dispatch(v.TEST_PASSED, { id: e.name });
373
+ await e?.execute(), b.dispatch(y.TEST_PASSED, { id: e.name });
350
374
  } catch (t) {
351
- throw y.dispatch(v.TEST_FAILED, { id: e.name }), O.uiUtils.hideCheckElementContainer(), x.error(`🤖 Error running task ${e.getDescription()}. Reason: ${t.message}`), t;
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
- x.groupEnd(), A = !1, y.dispatch(v.TEST_END, { action: e?.getJSON() });
377
+ n.groupEnd(), k = !1, b.dispatch(y.TEST_END, { action: e?.getJSON() });
354
378
  }
355
379
  }
356
- var j = {
357
- start: ae,
380
+ var A = {
381
+ start: se,
358
382
  get running() {
359
- return A;
383
+ return k;
360
384
  }
361
- }, M = [];
362
- for (let e = 0; e < 256; ++e) M.push((e + 256).toString(16).slice(1));
363
- function oe(e, t = 0) {
364
- 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();
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 se = new Uint8Array(16);
369
- function ce() {
370
- return crypto.getRandomValues(se);
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 N(e, t, n) {
375
- return !t && !e && crypto.randomUUID ? crypto.randomUUID() : le(e, t, n);
398
+ function M(e, t, n) {
399
+ return !t && !e && crypto.randomUUID ? crypto.randomUUID() : de(e, t, n);
376
400
  }
377
- function le(e, t, n) {
401
+ function de(e, t, n) {
378
402
  e ||= {};
379
- let r = e.random ?? e.rng?.() ?? ce();
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 oe(r);
410
+ return ce(r);
387
411
  }
388
412
  //#endregion
389
413
  //#region src/dom/actions.ts
390
- var P = null, F = async (e, t, n, r = 1e3, i = 0, a = 10, o = !1) => {
391
- if (console.log("Automation Status: ", O.status), O.isPaused) return new Promise((s, c) => {
392
- O.saveCurrentAction(async (e) => {
393
- if (e.status == L.SKIPPED) return s(null);
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
- s(await F(e, t, n, r, i, a, o));
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 (O.isStopped) throw Error("Test stopped manually");
402
- if (console.groupCollapsed(`tries ${i}/${a}`), e && (e.updateTries(i), await R.notifyActionUpdated(e)), i === a) throw console.groupEnd(), Error(o ? `UI Element ${t.getElementName() || "UNKNOWN"} still present after 10 tries` : `UI Element ${t.getElementName() || "UNKNOWN"} not found after 10 tries`);
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 s = t.selector(n, t.postProcess);
405
- return console.groupEnd(), s ? o ? (await S(r), await F(e, t, n, r, ++i, a, o)) : (console.log("Element found = ", s), s) : o ? (console.log("Element removed."), P) : (await S(r), await F(e, t, n, r, ++i, a, o));
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
- }, I = async (e, t, n = 1e3, r = 10, i = !1) => {
408
- let a = t?.getElementName();
409
- console.group("Looking for Element: " + a);
410
- let o = null;
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
- console.groupCollapsed("Look for Parent ", t.parent.getElementName()), o = await I(e, t.parent, n, r, i), console.groupEnd();
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 (console.groupEnd(), i && e.message.includes("not found")) return console.log("Parent not found, so element was removed"), console.groupEnd(), P;
415
- throw console.groupEnd(), e;
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
- console.log("Using parent element: ", o);
419
- let a = await F(e, t, o, n, 0, r, i);
420
- return console.groupEnd(), a;
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 (i && e.message.includes("not found")) return console.log("Parent not found, so element was removed"), console.groupEnd(), P;
423
- throw console.groupEnd(), e;
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
- }, L = /* @__PURE__ */ function(e) {
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
- }(L || {}), R = class e {
451
+ }(I || {}), L = class e {
428
452
  status;
429
453
  error;
430
454
  id;
431
455
  context;
432
456
  constructor() {
433
- this.status = L.WAITING, this.error = "", this.id = N(), this.context = {
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 = L.WAITING, this.error = "", this.resetAction();
477
+ this.status = I.WAITING, this.error = "", this.resetAction();
454
478
  }
455
479
  getInputValuesFromPage() {
456
480
  let e = {};
457
- return O.document.querySelectorAll("input").forEach((t, n) => {
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 = L.RUNNING, this.context.beforeInputValues = this.getInputValuesFromPage(), this.context.beforeHTML = O.document.body.innerHTML, await e.notifyActionUpdated(this), console.log("Action: ", this.getDescription()), await this.executeAction(), this.status = L.SUCCESS, this.error = "", O.isStepByStepMode && O.pause();
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 = L.ERROR, this.error = e.message, e.message == "Test stopped manually") throw Error("Error in Action " + this.getDescription() + ". Message: " + e.message);
467
- this.status = L.PAUSED, O.pause();
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 = O.document.body.innerHTML, await e.notifyActionUpdated(this);
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
- y.dispatch(v.ACTION_UPDATE, { action: e.getJSON() });
497
+ b.dispatch(y.ACTION_UPDATE, { action: e.getJSON() });
474
498
  }
475
- }, z = class extends R {
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 (O.isPaused) return new Promise((e, t) => {
506
- O.saveCurrentAction(async (n) => {
507
- if (n.status == L.SKIPPED) return e();
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 (O.isStopped) throw Error("Test stopped manually");
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 S(O.speed), await e.execute(), !O.isPaused) this.index++, await this.continue();
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
- O.saveCurrentAction(async (r) => {
522
- if (r.status == L.SKIPPED) return this.index++, await R.notifyActionUpdated(e), await this.continue(), t();
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
- }, B = class e extends R {
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, n, r = 1e3, i = 10, a = !1) {
572
- let o = n.getElementName();
573
- return new Promise(async (s, c) => {
574
- let l = async (e, r = 1e3, a = 0, s = !1) => {
575
- if (console.groupCollapsed(`tries ${a}/${i}`), t.updateTries(a), await R.notifyActionUpdated(t), a === i) throw console.groupEnd(), Error(s ? `UI Element ${o || "UNKNOWN"} still present after 10 tries` : `UI Element ${o || "UNKNOWN"} not found after 10 tries`);
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 = n.selector(e, n.postProcess);
578
- return console.groupEnd(), t ? s ? (await S(r), await l(e, r, ++a, s)) : (console.log("Element found = ", t), t) : s ? (console.log("Element removed."), null) : (await S(r), await l(e, r, ++a, s));
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
- console.group("[Action On Element] Looking for Element: " + o);
582
- let u = null, d = !0;
583
- if (n.parent) {
584
- console.groupCollapsed("Look for Parent ", n.parent.getElementName());
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
- u = await e.waitForElement(t, n.parent, r, i, a);
647
+ d = await e.waitForElement(t, r.parent, i, a, o);
587
648
  } catch {
588
- d = !1;
649
+ f = !1;
589
650
  } finally {
590
- console.groupEnd();
651
+ n.groupEnd();
591
652
  }
592
653
  }
593
- if (d) {
594
- console.log("using parent element: ", u);
654
+ if (f) {
655
+ n.log("using parent element: ", d);
595
656
  try {
596
- let e = await l(u, r, 0, a);
597
- console.groupEnd(), s(e);
657
+ let e = await u(d, i, 0, o);
658
+ n.groupEnd(), c(e);
598
659
  } catch (e) {
599
- console.groupEnd(), c(Error(e.message));
660
+ n.groupEnd(), l(Error(e.message));
600
661
  }
601
- } else console.groupEnd(), c(/* @__PURE__ */ Error(`Parent ${n.parent?.getElementName()} of UI Element ${n.name || "UNKNOWN"} not found`));
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 I(this, this.uiElement), this.element?.setAttribute("test-id", this.getElementName()), await O.uiUtils.checkElement(this.element, this.getElementName()), this.executeActionOnElement(), await O.uiUtils.hideCheckElementContainer();
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
- }, ue = class extends B {
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
- }, de = class extends B {
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
- }, fe = class extends B {
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
- }, pe = class extends B {
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
- }, me = class extends B {
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
- }, he = class extends B {
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 I(this, this.uiElement, 1e3, 5, !0), this.element?.setAttribute("test-id", this.getElementName()), await O.uiUtils.checkElement(this.element, this.getElementName()), this.executeActionOnElement(), await O.uiUtils.hideCheckElementContainer();
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
- }, ge = class extends B {
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
- }, V = class extends B {
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
- }, _e = class extends B {
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
- }, ve = class extends B {
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
- }, ye = class extends B {
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
- }, be = class extends B {
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
- }, xe = class extends B {
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
- }, H = /* @__PURE__ */ function(e) {
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
- }(H || {}), U = {
902
- [H.ESCAPE]: 27,
903
- [H.ENTER]: 13,
904
- [H.TAB]: 9,
905
- [H.ARROW_DOWN]: 40,
906
- [H.ARROW_UP]: 38,
907
- [H.ARROW_LEFT]: 37,
908
- [H.ARROW_RIGHT]: 39,
909
- [H.BACKSPACE]: 8,
910
- [H.DELETE]: 46,
911
- [H.SHIFT]: 16,
912
- [H.CONTROL]: 17,
913
- [H.ALT]: 18,
914
- [H.META]: 91
915
- }, Se = class extends B {
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: U[this.key],
985
+ keyCode: H[this.key],
925
986
  charCode: 0,
926
- which: U[this.key],
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
- }, Ce = class extends B {
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
- }, we = class extends B {
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
- y.dispatch(v.SAVE_VALUE, {
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
- }, Te = class extends R {
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 S(this.miliseconds);
1068
+ await x(this.miliseconds);
1008
1069
  }
1009
1070
  resetAction() {}
1010
- }, Ee = class extends R {
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 I(this, this.uiElement, 1e3, 10, !0);
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
- }, De = class extends R {
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 O.pause();
1112
+ await D.pause();
1052
1113
  }
1053
1114
  resetAction() {}
1054
- }, Oe = class extends R {
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 O.uiUtils.showAlert("Waiting manual step..."), new Promise((e, t) => {
1070
- y.on(v.USER_ACCEPT, async () => (await O.uiUtils.hideAlert(), e(!0))), y.on(v.USER_REJECT, async () => (await O.uiUtils.hideAlert(), t()));
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
- }, ke = class extends R {
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, K = {
1152
+ }, U, W, G = {
1092
1153
  init: (e) => {
1093
- W = e, G = !0, x.groupCollapsed("Compile: " + e.getDescription()), e.compileSteps(), G = !1, x.log("Compilation finished"), x.groupEnd();
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
- x.log("Add action: ", e.getDescription()), W.addStep(e);
1157
+ n.log("Add action: ", e.getDescription()), U.addStep(e);
1097
1158
  },
1098
1159
  compileAction: (e) => {
1099
- let t = W;
1100
- W = e, e.compileSteps(), W = t;
1160
+ let t = U;
1161
+ U = e, e.compileSteps(), U = t;
1101
1162
  },
1102
- getCurrentAction: () => W,
1103
- getIsCompiling: () => G
1104
- }, q = {}, Ae = (e) => {
1105
- if (q[e]) q[e]();
1106
- else throw console.log("Available Tests:", Object.keys(q)), Error(`Test with id ${e} not found.`);
1107
- }, je = (e, t) => {
1108
- console.log(`Registering Test: ${e}...`);
1109
- let n = new z(e, t);
1110
- K.init(n), console.log(`Compiled Test: ${e}`), y.dispatch(v.REGISTER_TEST, {
1111
- id: e,
1112
- action: n.getJSON()
1113
- }), console.log(`Registered Test: ${e} in TestsMap`), q[e] = () => {
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: n = [], speed: r = "NORMAL", debug: i = !1 } = e, a = N();
1121
- if (console.log(`[tomation] Initializing on URL: ${document.location.href} with session ID: ${a}`), window.postMessage({
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: v.SESSION_INIT,
1126
- params: { sessionId: a }
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
- console.log(`[tomation] URL "${document.location.href}" does not match "${t}"`), window.postMessage({
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: v.URL_MISMATCH,
1192
+ cmd: y.URL_MISMATCH,
1134
1193
  params: {
1135
- sessionId: a,
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
- console.log("[tomation] Setting up messaging bridge with extension..."), Object.values(v).forEach((e) => {
1145
- console.log(`[tomation] Setting up listener for event "${e}"`), y.on(e, (t) => {
1146
- let n = {
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: a
1209
+ sessionId: o
1151
1210
  }
1152
1211
  };
1153
- console.log(`[tomation] Dispatching event "${e}" to extension: `, n), window.postMessage({
1212
+ n.log(`Dispatching event "${e}" to extension: `, r), window.postMessage({
1154
1213
  message: "injectedScript-to-contentScript",
1155
1214
  sender: "tomation",
1156
- payload: n
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
- let e = {
1166
- "run-test-request": () => Ae(o?.testId),
1167
- "reload-tests-request": () => k(window, n || []),
1168
- "pause-test-request": () => O.pause(),
1169
- "stop-test-request": () => O.stop(),
1170
- "continue-test-request": () => O.continue(),
1171
- "next-step-request": () => O.next(),
1172
- "retry-action-request": () => O.retryAction(),
1173
- "skip-action-request": () => O.skipAction(),
1174
- "user-accept-request": () => y.dispatch(v.USER_ACCEPT),
1175
- "user-reject-request": () => y.dispatch(v.USER_REJECT)
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
- e ? (console.log(`[tomation] Executing command "${a}" from extension`), e()) : console.warn(`[tomation] Unknown command "${a}" from extension`);
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
- console.error("[tomation] Error handling message from extension:", e);
1241
+ n.error("Error handling message from extension:", e);
1182
1242
  }
1183
- }), k(window, n), O.setDebug(i), O.speed = T[r], window.postMessage({
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: v.SESSION_CONNECTED,
1247
+ cmd: y.SESSION_CONNECTED,
1188
1248
  params: {
1189
- speed: O.speed,
1190
- sessionId: a
1249
+ speed: D.speed,
1250
+ sessionId: o
1191
1251
  }
1192
1252
  }
1193
- }), console.log("[tomation] Ready ✓");
1253
+ }), n.log("Ready ✓");
1194
1254
  } catch (e) {
1195
- console.error("[tomation] Initialization failed:", e);
1255
+ n.error("Initialization failed:", e);
1196
1256
  }
1197
1257
  }
1198
1258
  //#endregion
1199
1259
  //#region src/dsl/task.ts
1200
- var Me = (e, t) => async (n) => {
1201
- let r = new z(e, t);
1202
- if (r.setParams(n), !j.running && !K.getIsCompiling()) try {
1203
- x.log(`Compilation of Task ${e} starts...`), K.init(r), x.log(`Compilation of Task ${e} Finished.`), x.log(`Start running Task ${e}...`), await j.start(r), x.log(`End of Task ${e}: SUCCESS`);
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
- x.error("Error running task " + e + ". " + t.message);
1265
+ throw n.error(`Error running task ${e}. ${t.message}`), t;
1206
1266
  }
1207
- else x.log(`Adding action ${e} to compilation stack`), K.addAction(r), K.compileAction(r);
1208
- }, Ne = (e) => {
1209
- let t = new ue(e);
1210
- K.addAction(t);
1211
- }, Pe = (e) => ({
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
- K.addAction(new de(e, t));
1273
+ G.addAction(new pe(e, t));
1214
1274
  },
1215
1275
  containsText: (t) => {
1216
- K.addAction(new fe(e, t));
1276
+ G.addAction(new me(e, t));
1217
1277
  },
1218
1278
  valueIs: (t) => {
1219
- K.addAction(new pe(e, t));
1279
+ G.addAction(new he(e, t));
1220
1280
  },
1221
1281
  exists: () => {
1222
- K.addAction(new me(e));
1282
+ G.addAction(new ge(e));
1223
1283
  },
1224
1284
  notExists: () => {
1225
- K.addAction(new he(e));
1226
- }
1227
- }), Fe = (e) => ({ in: (t) => {
1228
- let n = new ge(t, e);
1229
- K.addAction(n);
1230
- } }), Ie = (e) => ({ in: (t) => {
1231
- let n = new V(t, e);
1232
- K.addAction(n);
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
- K.addAction(new ye(e));
1294
+ let t = new B(e, "");
1295
+ G.addAction(t);
1240
1296
  } }), Be = () => ({ in: (e) => {
1241
- K.addAction(new be(e));
1297
+ G.addAction(new be(e));
1242
1298
  } }), Ve = () => ({ in: (e) => {
1243
- K.addAction(new xe(e));
1244
- } }), He = (e) => ({ in: (t) => {
1245
- K.addAction(new Se(t, e));
1246
- } }), Ue = (e) => ({ in: (t) => {
1247
- let n = new _e(t, e);
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
- let n = new Ce(t, e);
1251
- K.addAction(n);
1305
+ G.addAction(new we(t, e));
1252
1306
  } }), Ge = (e) => ({ in: (t) => {
1253
- let n = new we(e, t);
1254
- K.addAction(n);
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
- K.addAction(new Te(e));
1316
+ G.addAction(new De(e));
1257
1317
  };
1258
1318
  Y.untilElement = (e) => ({ isRemoved: () => {
1259
- K.addAction(new Ee(e));
1319
+ G.addAction(new Oe(e));
1260
1320
  } });
1261
- var Ke = () => {
1262
- K.addAction(new De());
1263
- }, qe = (e) => {
1264
- K.addAction(new Oe(e));
1265
- }, X = () => {
1266
- K.addAction(new ke());
1267
- }, Z = (e) => e.toLocaleDateString("en-US", {
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
- }), Q = (e) => {
1331
+ }), Z = (e) => {
1272
1332
  let t = /* @__PURE__ */ new Date();
1273
- return Z(new Date(t.setDate(t.getDate() + e)));
1274
- }, $ = (e) => {
1333
+ return X(new Date(t.setDate(t.getDate() + e)));
1334
+ }, Q = (e) => {
1275
1335
  let t = /* @__PURE__ */ new Date();
1276
- return Z(new Date(t.setMonth(t.getMonth() + e)));
1277
- }, Je = Q(1), Ye = Q(-1), Xe = Q(7), Ze = Q(-7), Qe = $(1), $e = $(-1), et = {
1278
- formatDate: Z,
1279
- today: Z(/* @__PURE__ */ new Date()),
1280
- tomorrow: Je,
1281
- nextWeek: Xe,
1282
- nextMonth: Qe,
1283
- yesterday: Ye,
1284
- lastWeek: Ze,
1285
- lastMonth: $e
1286
- }, tt = J;
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 { L as ACTION_STATUS, Pe as Assert, y as AutomationEvents, O as AutomationInstance, Le as ClearValue, Ne as Click, et as DateUtils, v as EVENT_NAMES, H as KEY_MAP, qe as ManualTask, Ke as Pause, ze as PressDownKey, Ve as PressEnterKey, Re as PressEscKey, He as PressKey, Be as PressTabKey, X as ReloadPage, Ge as SaveValue, Fe as Select, k as Setup, Me as Task, je as Test, T as TestSpeed, Ie as Type, Ue as TypePassword, f as UIElement, We as UploadFile, Y as Wait, d as and, r as classIncludes, n as classIs, tt as default, l as elementIndexIs, u as firstChildTextIs, a as innerTextContains, i as innerTextIs, ne as is, c as isFirstElement, s as placeholderIs, o as titleIs, J as tomation, S as wait };
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 };