@burdenoff/ui-engine 2026.1127.2 → 2026.1127.4
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/README.md +74 -4
- package/dist/capture.js +3 -2
- package/dist/dom-runtime/actions.d.ts +65 -0
- package/dist/dom-runtime/iife.d.ts +1 -0
- package/dist/dom-runtime/index.d.ts +7 -0
- package/dist/dom-runtime/runtime.d.ts +79 -0
- package/dist/dom-runtime.d.ts +2 -0
- package/dist/dom-runtime.iife.js +1 -0
- package/dist/dom-runtime.js +30 -0
- package/dist/drivers/dom-driver.d.ts +44 -0
- package/dist/drivers/index.d.ts +7 -0
- package/dist/drivers/snapshot-driver.d.ts +59 -0
- package/dist/drivers.d.ts +2 -0
- package/dist/drivers.js +170 -0
- package/dist/{index-n5amgh31.js → index-2kgsgn1c.js} +1 -1
- package/dist/index-3f1j8386.js +334 -0
- package/dist/index-3jymbm5t.js +315 -0
- package/dist/index-5k26keah.js +815 -0
- package/dist/index-77pcz6n3.js +303 -0
- package/dist/index-895kscx3.js +741 -0
- package/dist/{index-phd8yhyg.js → index-bnvmt4wf.js} +7 -5
- package/dist/{index-c6pmt2rg.js → index-cs6acyjn.js} +6 -59
- package/dist/index-ct2xctrq.js +229 -0
- package/dist/index-h88y5qgv.js +400 -0
- package/dist/index-mgztm37r.js +57 -0
- package/dist/{index-tqffkt91.js → index-pm13mvvc.js} +26 -1009
- package/dist/index-vg8r40y7.js +220 -0
- package/dist/index-ycs2bz1a.js +589 -0
- package/dist/index-zzhysbkj.js +1731 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +130 -42
- package/dist/interpret/compile.d.ts +58 -0
- package/dist/interpret/driver.d.ts +171 -0
- package/dist/interpret/errors.d.ts +194 -0
- package/dist/interpret/events.d.ts +73 -0
- package/dist/interpret/expr.d.ts +35 -0
- package/dist/interpret/index.d.ts +13 -0
- package/dist/interpret/run.d.ts +77 -0
- package/dist/interpret.d.ts +2 -0
- package/dist/interpret.js +84 -0
- package/dist/recording.js +1 -1
- package/dist/replay.js +2 -2
- package/dist/script/adapters/browser-action-contract.d.ts +5 -2
- package/dist/script/limits.d.ts +2 -0
- package/dist/script.js +44 -38
- package/dist/target/aria.d.ts +31 -0
- package/dist/target/dom.d.ts +35 -0
- package/dist/target/index.d.ts +13 -0
- package/dist/target/markers.d.ts +18 -0
- package/dist/target/methods.d.ts +52 -0
- package/dist/target/resolve.d.ts +63 -0
- package/dist/target/snapshot.d.ts +57 -0
- package/dist/target/text.d.ts +23 -0
- package/dist/target/types.d.ts +88 -0
- package/dist/target.d.ts +2 -0
- package/dist/target.js +96 -0
- package/dist/testing/fake-web-driver.d.ts +28 -0
- package/dist/testing/fixtures/ambiguous.d.ts +7 -0
- package/dist/testing/fixtures/iframe.d.ts +6 -0
- package/dist/testing/fixtures/index.d.ts +26 -0
- package/dist/testing/fixtures/invoices-v2.d.ts +8 -0
- package/dist/testing/fixtures/invoices-v3.d.ts +7 -0
- package/dist/testing/fixtures/invoices.d.ts +6 -0
- package/dist/testing/fixtures/login.d.ts +6 -0
- package/dist/testing/fixtures/shadow.d.ts +7 -0
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/mount.d.ts +18 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +379 -0
- package/package.json +29 -5
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// src/interpret/errors.ts
|
|
2
|
+
var UI_ERROR_FAMILIES2 = [
|
|
3
|
+
"DEPENDENCY",
|
|
4
|
+
"TRANSIENT",
|
|
5
|
+
"VALIDATION",
|
|
6
|
+
"AUTHORIZATION",
|
|
7
|
+
"DISPATCH_FAILED",
|
|
8
|
+
"CANCELLED"
|
|
9
|
+
];
|
|
10
|
+
var UI_ERROR_CODES2 = {
|
|
11
|
+
ELEMENT_NOT_FOUND: {
|
|
12
|
+
family: "DEPENDENCY",
|
|
13
|
+
preflight: false,
|
|
14
|
+
meaning: "No target method found the element within the wait, or the frame chain could not be followed"
|
|
15
|
+
},
|
|
16
|
+
ELEMENT_AMBIGUOUS: {
|
|
17
|
+
family: "DEPENDENCY",
|
|
18
|
+
preflight: false,
|
|
19
|
+
meaning: "More than one element matched and the target states no rule to choose; nothing was acted on"
|
|
20
|
+
},
|
|
21
|
+
ELEMENT_NOT_INTERACTABLE: {
|
|
22
|
+
family: "TRANSIENT",
|
|
23
|
+
preflight: false,
|
|
24
|
+
meaning: "The element was found but stayed disabled, hidden, covered or off screen for the whole wait"
|
|
25
|
+
},
|
|
26
|
+
WINDOW_NOT_FOUND: {
|
|
27
|
+
family: "DEPENDENCY",
|
|
28
|
+
preflight: false,
|
|
29
|
+
meaning: "The application window or page is not open"
|
|
30
|
+
},
|
|
31
|
+
APPLICATION_NOT_RESPONDING: {
|
|
32
|
+
family: "TRANSIENT",
|
|
33
|
+
preflight: false,
|
|
34
|
+
meaning: "The application or page stopped responding"
|
|
35
|
+
},
|
|
36
|
+
UNEXPECTED_WINDOW: {
|
|
37
|
+
family: "DEPENDENCY",
|
|
38
|
+
preflight: false,
|
|
39
|
+
meaning: "A pop-up with no handler blocks the target"
|
|
40
|
+
},
|
|
41
|
+
VERIFY_FAILED: {
|
|
42
|
+
family: "TRANSIENT",
|
|
43
|
+
preflight: false,
|
|
44
|
+
meaning: "The step's expected outcome did not occur within its wait"
|
|
45
|
+
},
|
|
46
|
+
DESK_UNAVAILABLE: {
|
|
47
|
+
family: "DISPATCH_FAILED",
|
|
48
|
+
preflight: false,
|
|
49
|
+
meaning: "The desk has no usable session (no browser tab, screen locked, capability switched off)"
|
|
50
|
+
},
|
|
51
|
+
ROBOT_LOST: {
|
|
52
|
+
family: "TRANSIENT",
|
|
53
|
+
preflight: false,
|
|
54
|
+
meaning: "The desk disconnected while the script ran"
|
|
55
|
+
},
|
|
56
|
+
UNSUPPORTED_ON_DESK: {
|
|
57
|
+
family: "VALIDATION",
|
|
58
|
+
preflight: true,
|
|
59
|
+
meaning: "The desk cannot run a step, target method or option the script uses"
|
|
60
|
+
},
|
|
61
|
+
NAVIGATION_TIMEOUT: {
|
|
62
|
+
family: "TRANSIENT",
|
|
63
|
+
preflight: false,
|
|
64
|
+
meaning: "A navigation, back, or reload did not finish loading within its wait"
|
|
65
|
+
},
|
|
66
|
+
NAVIGATION_FAILED: {
|
|
67
|
+
family: "TRANSIENT",
|
|
68
|
+
preflight: false,
|
|
69
|
+
meaning: "A navigation failed: a network error, or the page could not be loaded"
|
|
70
|
+
},
|
|
71
|
+
WAIT_TIMEOUT: {
|
|
72
|
+
family: "TRANSIENT",
|
|
73
|
+
preflight: false,
|
|
74
|
+
meaning: "A wait for text, a URL, or an element to disappear did not end within its wait"
|
|
75
|
+
},
|
|
76
|
+
ACTION_FAILED: {
|
|
77
|
+
family: "DEPENDENCY",
|
|
78
|
+
preflight: false,
|
|
79
|
+
meaning: "The element was found once but the action does not apply to it (not editable, not a list, no such option, a handler cancelled the change); the desk problem is in detail.problem"
|
|
80
|
+
},
|
|
81
|
+
SENSITIVE_ELEMENT: {
|
|
82
|
+
family: "VALIDATION",
|
|
83
|
+
preflight: false,
|
|
84
|
+
meaning: "A read of a password, one-time code, card or secret field was refused by design"
|
|
85
|
+
},
|
|
86
|
+
URL_NOT_ALLOWED: {
|
|
87
|
+
family: "VALIDATION",
|
|
88
|
+
preflight: false,
|
|
89
|
+
meaning: "A navigation URL is not http or https, or the desk URL guard refused it"
|
|
90
|
+
},
|
|
91
|
+
SECRET_UNAVAILABLE: {
|
|
92
|
+
family: "DEPENDENCY",
|
|
93
|
+
preflight: false,
|
|
94
|
+
meaning: "The desk could not type a secret: the reference is missing or the page origin is not the expected one"
|
|
95
|
+
},
|
|
96
|
+
LOGIN_FAILED: {
|
|
97
|
+
family: "AUTHORIZATION",
|
|
98
|
+
preflight: false,
|
|
99
|
+
meaning: "The sign-in through the Browser Login connection did not reach its success element"
|
|
100
|
+
},
|
|
101
|
+
EXPRESSION_ERROR: {
|
|
102
|
+
family: "VALIDATION",
|
|
103
|
+
preflight: false,
|
|
104
|
+
meaning: "An expression could not be evaluated (a value of the wrong type, division by zero, a result too large)"
|
|
105
|
+
},
|
|
106
|
+
INTERRUPTED: {
|
|
107
|
+
family: "TRANSIENT",
|
|
108
|
+
preflight: false,
|
|
109
|
+
meaning: "The script was cut off (a worker restart) after some steps ran; the last completed step is reported"
|
|
110
|
+
},
|
|
111
|
+
DRIVER_ERROR: {
|
|
112
|
+
family: "TRANSIENT",
|
|
113
|
+
preflight: false,
|
|
114
|
+
meaning: "The desk failed in an unexpected way while running a step"
|
|
115
|
+
},
|
|
116
|
+
INVALID_SCRIPT: {
|
|
117
|
+
family: "VALIDATION",
|
|
118
|
+
preflight: true,
|
|
119
|
+
meaning: "The script does not parse, is not compiled (an unresolved element or a call not inlined), or a step needs a value it does not have; the parse code is in detail.engineCode"
|
|
120
|
+
},
|
|
121
|
+
INVALID_INPUT: {
|
|
122
|
+
family: "VALIDATION",
|
|
123
|
+
preflight: true,
|
|
124
|
+
meaning: "A required script input is missing, or a supplied input does not have its declared type"
|
|
125
|
+
},
|
|
126
|
+
INVALID_STEP_RANGE: {
|
|
127
|
+
family: "VALIDATION",
|
|
128
|
+
preflight: true,
|
|
129
|
+
meaning: "A step range names a step path the script does not have, ends before it starts, or never reaches its start (a block around it was disabled or ran no pass), so no step ran"
|
|
130
|
+
},
|
|
131
|
+
CANCELLED: {
|
|
132
|
+
family: "CANCELLED",
|
|
133
|
+
preflight: false,
|
|
134
|
+
meaning: "The run was cancelled; the clean-up steps ran"
|
|
135
|
+
},
|
|
136
|
+
STOPPED_BY_USER: {
|
|
137
|
+
family: "CANCELLED",
|
|
138
|
+
preflight: false,
|
|
139
|
+
meaning: "A person sent STOP to a paused TEST run; the clean-up steps ran"
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
var UI_ERROR_CODE_LIST2 = Object.keys(UI_ERROR_CODES2);
|
|
143
|
+
function isUiErrorCode2(value) {
|
|
144
|
+
return typeof value === "string" && Object.hasOwn(UI_ERROR_CODES2, value);
|
|
145
|
+
}
|
|
146
|
+
function errorFamilyOf2(code) {
|
|
147
|
+
return UI_ERROR_CODES2[code].family;
|
|
148
|
+
}
|
|
149
|
+
function isRetryableInScript2(code) {
|
|
150
|
+
const family = errorFamilyOf2(code);
|
|
151
|
+
return family !== "VALIDATION" && family !== "CANCELLED" && family !== "AUTHORIZATION";
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
class UiRunError2 extends Error {
|
|
155
|
+
code;
|
|
156
|
+
family;
|
|
157
|
+
detail;
|
|
158
|
+
constructor(code, message, detail) {
|
|
159
|
+
super(message);
|
|
160
|
+
this.name = "UiRunError";
|
|
161
|
+
this.code = code;
|
|
162
|
+
this.family = errorFamilyOf2(code);
|
|
163
|
+
this.detail = detail;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
class UiDriverError2 extends Error {
|
|
168
|
+
code;
|
|
169
|
+
detail;
|
|
170
|
+
constructor(code, message, detail) {
|
|
171
|
+
super(message);
|
|
172
|
+
this.name = "UiDriverError";
|
|
173
|
+
this.code = code;
|
|
174
|
+
this.detail = detail;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// src/interpret/driver.ts
|
|
179
|
+
function abortError() {
|
|
180
|
+
const error = new Error("The run was cancelled");
|
|
181
|
+
error.name = "AbortError";
|
|
182
|
+
return error;
|
|
183
|
+
}
|
|
184
|
+
var realClock2 = {
|
|
185
|
+
now: () => Date.now(),
|
|
186
|
+
sleep: (ms, signal) => new Promise((resolve, reject) => {
|
|
187
|
+
if (signal?.aborted) {
|
|
188
|
+
reject(abortError());
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const timer = setTimeout(() => {
|
|
192
|
+
signal?.removeEventListener("abort", onAbort);
|
|
193
|
+
resolve();
|
|
194
|
+
}, Math.max(0, ms));
|
|
195
|
+
const onAbort = () => {
|
|
196
|
+
clearTimeout(timer);
|
|
197
|
+
reject(abortError());
|
|
198
|
+
};
|
|
199
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
200
|
+
})
|
|
201
|
+
};
|
|
202
|
+
function createVirtualClock2(start = 0) {
|
|
203
|
+
let time = start;
|
|
204
|
+
return {
|
|
205
|
+
now: () => time,
|
|
206
|
+
sleep: async (ms, signal) => {
|
|
207
|
+
if (signal?.aborted)
|
|
208
|
+
throw abortError();
|
|
209
|
+
time += Math.max(0, ms);
|
|
210
|
+
await Promise.resolve();
|
|
211
|
+
if (signal?.aborted)
|
|
212
|
+
throw abortError();
|
|
213
|
+
},
|
|
214
|
+
advance: (ms) => {
|
|
215
|
+
time += Math.max(0, ms);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { UI_ERROR_FAMILIES2, UI_ERROR_CODES2, UI_ERROR_CODE_LIST2, isUiErrorCode2, errorFamilyOf2, isRetryableInScript2, UiRunError2, UiDriverError2, realClock2, createVirtualClock2 };
|