@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,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load a fixture page into a test document (happy-dom, jsdom or a browser
|
|
3
|
+
* document) the way a browser would parse it, for DOMs that lack two parser
|
|
4
|
+
* features the fixtures use:
|
|
5
|
+
*
|
|
6
|
+
* - declarative shadow DOM: each `<template shadowrootmode>` becomes its
|
|
7
|
+
* parent's shadow root;
|
|
8
|
+
* - `srcdoc` frames: when a frame's document is still empty, the `srcdoc`
|
|
9
|
+
* markup is written into it.
|
|
10
|
+
*
|
|
11
|
+
* Scripts are not run by this helper; a test that needs a page behaviour (the
|
|
12
|
+
* counter of the `ambiguous` page, for example) wires it itself.
|
|
13
|
+
*/
|
|
14
|
+
import { type RpaFixtureName } from './fixtures/index.js';
|
|
15
|
+
/** Write markup into a document and apply the two parser fixes above. */
|
|
16
|
+
export declare function mountHtml(document: Document, html: string): Document;
|
|
17
|
+
/** Load a named fixture page into a document. */
|
|
18
|
+
export declare function mountFixture(document: Document, name: RpaFixtureName): Document;
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDomDriver2
|
|
3
|
+
} from "./index-3f1j8386.js";
|
|
4
|
+
import {
|
|
5
|
+
UiDriverError2,
|
|
6
|
+
createVirtualClock2
|
|
7
|
+
} from "./index-vg8r40y7.js";
|
|
8
|
+
|
|
9
|
+
// src/testing/fixtures/ambiguous.ts
|
|
10
|
+
var AMBIGUOUS_HTML = `<!doctype html>
|
|
11
|
+
<html lang="en">
|
|
12
|
+
<head>
|
|
13
|
+
<meta charset="utf-8">
|
|
14
|
+
<meta name="robots" content="noindex, nofollow">
|
|
15
|
+
<title>Invoice editor - RPA playground</title>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<main>
|
|
19
|
+
<h1>Invoice editor</h1>
|
|
20
|
+
<section id="header-section">
|
|
21
|
+
<h2>Invoice header</h2>
|
|
22
|
+
<label for="customer">Customer</label>
|
|
23
|
+
<input id="customer" name="customer" type="text">
|
|
24
|
+
<button class="save" type="button">Save</button>
|
|
25
|
+
</section>
|
|
26
|
+
<section id="lines-section">
|
|
27
|
+
<h2>Line items</h2>
|
|
28
|
+
<label for="line-1">Line 1</label>
|
|
29
|
+
<input id="line-1" name="line1" type="text">
|
|
30
|
+
<button class="save" type="button">Save</button>
|
|
31
|
+
</section>
|
|
32
|
+
<p>Saved changes: <output id="saved-count" aria-label="Saved changes">0</output></p>
|
|
33
|
+
</main>
|
|
34
|
+
<script>
|
|
35
|
+
for (const button of document.querySelectorAll('button.save')) {
|
|
36
|
+
button.addEventListener('click', () => {
|
|
37
|
+
const counter = document.getElementById('saved-count');
|
|
38
|
+
counter.textContent = String(Number(counter.textContent) + 1);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
// src/testing/fixtures/iframe.ts
|
|
47
|
+
var IFRAME_INNER_HTML = `<!doctype html>
|
|
48
|
+
<html lang="en">
|
|
49
|
+
<head><meta charset="utf-8"><title>Payment</title></head>
|
|
50
|
+
<body>
|
|
51
|
+
<form aria-label="Payment">
|
|
52
|
+
<label for="amount">Amount</label>
|
|
53
|
+
<input id="amount" name="amount" type="text">
|
|
54
|
+
<button id="pay" type="button">Pay now</button>
|
|
55
|
+
</form>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
|
58
|
+
`;
|
|
59
|
+
var IFRAME_HTML = `<!doctype html>
|
|
60
|
+
<html lang="en">
|
|
61
|
+
<head>
|
|
62
|
+
<meta charset="utf-8">
|
|
63
|
+
<meta name="robots" content="noindex, nofollow">
|
|
64
|
+
<title>Checkout - RPA playground</title>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<main>
|
|
68
|
+
<h1>Checkout</h1>
|
|
69
|
+
<button id="pay" type="button">Pay later</button>
|
|
70
|
+
<iframe id="payment-frame" title="Payment" srcdoc="${IFRAME_INNER_HTML.replace(/&/g, "&").replace(/"/g, """)}"></iframe>
|
|
71
|
+
</main>
|
|
72
|
+
</body>
|
|
73
|
+
</html>
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
// src/testing/fixtures/invoices-v2.ts
|
|
77
|
+
var INVOICES_V2_HTML = `<!doctype html>
|
|
78
|
+
<html lang="en">
|
|
79
|
+
<head>
|
|
80
|
+
<meta charset="utf-8">
|
|
81
|
+
<meta name="robots" content="noindex, nofollow">
|
|
82
|
+
<title>Invoices - RPA playground (v2)</title>
|
|
83
|
+
</head>
|
|
84
|
+
<body>
|
|
85
|
+
<div class="shell">
|
|
86
|
+
<aside class="side">
|
|
87
|
+
<ul class="menu" role="list">
|
|
88
|
+
<li><span class="menu-entry" role="link" tabindex="0" data-qa="menu-invoices">Invoices</span></li>
|
|
89
|
+
<li><a class="menu-link" href="/playground/rpa/">Home</a></li>
|
|
90
|
+
<li><a class="menu-link" href="/playground/rpa/settings.html">Settings</a></li>
|
|
91
|
+
</ul>
|
|
92
|
+
</aside>
|
|
93
|
+
<section class="content">
|
|
94
|
+
<h1 class="page-title">Invoices</h1>
|
|
95
|
+
<form class="filters" aria-label="Invoice search" action="/playground/rpa/invoices-v2.html">
|
|
96
|
+
<div class="toolbar">
|
|
97
|
+
<button class="primary-action" data-qa="run-search" type="submit">Search</button>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="field">
|
|
100
|
+
<label for="f-ref">Invoice number</label>
|
|
101
|
+
<input id="f-ref" name="ref" data-qa="ref" type="text">
|
|
102
|
+
</div>
|
|
103
|
+
<div class="field">
|
|
104
|
+
<label for="f-state">Status</label>
|
|
105
|
+
<select id="f-state" name="state">
|
|
106
|
+
<option value="">Any</option>
|
|
107
|
+
<option value="paid">Paid</option>
|
|
108
|
+
<option value="due">Due</option>
|
|
109
|
+
</select>
|
|
110
|
+
</div>
|
|
111
|
+
</form>
|
|
112
|
+
<table class="grid" aria-label="Results">
|
|
113
|
+
<thead><tr><th>Invoice</th><th>Amount</th><th>Status</th><th>File</th></tr></thead>
|
|
114
|
+
<tbody>
|
|
115
|
+
<tr><td>INV-1041</td><td>120.00</td><td>Paid</td><td><a class="dl" href="/playground/rpa/files/INV-1041.pdf">Download</a></td></tr>
|
|
116
|
+
<tr><td>INV-1042</td><td>87.50</td><td>Due</td><td><a class="dl" href="/playground/rpa/files/INV-1042.pdf">Download</a></td></tr>
|
|
117
|
+
</tbody>
|
|
118
|
+
</table>
|
|
119
|
+
</section>
|
|
120
|
+
</div>
|
|
121
|
+
</body>
|
|
122
|
+
</html>
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
// src/testing/fixtures/invoices-v3.ts
|
|
126
|
+
var INVOICES_V3_HTML = `<!doctype html>
|
|
127
|
+
<html lang="en">
|
|
128
|
+
<head>
|
|
129
|
+
<meta charset="utf-8">
|
|
130
|
+
<meta name="robots" content="noindex, nofollow">
|
|
131
|
+
<title>Invoices - RPA playground (v3)</title>
|
|
132
|
+
</head>
|
|
133
|
+
<body>
|
|
134
|
+
<div class="shell">
|
|
135
|
+
<aside class="side">
|
|
136
|
+
<ul class="menu" role="list">
|
|
137
|
+
<li><a class="menu-link" href="/playground/rpa/">Home</a></li>
|
|
138
|
+
<li><span class="menu-entry" role="link" tabindex="0" data-qa="menu-invoices">All invoices</span></li>
|
|
139
|
+
<li><a class="menu-link" href="/playground/rpa/settings.html">Settings</a></li>
|
|
140
|
+
</ul>
|
|
141
|
+
</aside>
|
|
142
|
+
<section class="content">
|
|
143
|
+
<h1 class="page-title">Invoices</h1>
|
|
144
|
+
<form class="filters" aria-label="Invoice search" action="/playground/rpa/invoices-v3.html">
|
|
145
|
+
<div class="toolbar">
|
|
146
|
+
<button class="primary-action" data-qa="run-search" type="submit">Search…</button>
|
|
147
|
+
<button class="secondary-action" data-qa="reset-search" type="reset">Reset filters</button>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="field">
|
|
150
|
+
<label for="f-ref">Invoice number *</label>
|
|
151
|
+
<input id="f-ref" name="ref" data-qa="ref" type="text" required>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="field">
|
|
154
|
+
<label for="f-date">Invoice date</label>
|
|
155
|
+
<input id="f-date" name="date" type="text">
|
|
156
|
+
</div>
|
|
157
|
+
</form>
|
|
158
|
+
<table class="grid" aria-label="Results">
|
|
159
|
+
<thead><tr><th>Invoice</th><th>Amount</th><th>Status</th><th>File</th></tr></thead>
|
|
160
|
+
<tbody>
|
|
161
|
+
<tr><td>INV-1041</td><td>120.00</td><td>Paid</td><td><a class="dl" href="/playground/rpa/files/INV-1041.pdf">Download</a></td></tr>
|
|
162
|
+
<tr><td>INV-1042</td><td>87.50</td><td>Due</td><td><a class="dl" href="/playground/rpa/files/INV-1042.pdf">Download</a></td></tr>
|
|
163
|
+
</tbody>
|
|
164
|
+
</table>
|
|
165
|
+
</section>
|
|
166
|
+
</div>
|
|
167
|
+
</body>
|
|
168
|
+
</html>
|
|
169
|
+
`;
|
|
170
|
+
|
|
171
|
+
// src/testing/fixtures/invoices.ts
|
|
172
|
+
var INVOICES_HTML = `<!doctype html>
|
|
173
|
+
<html lang="en">
|
|
174
|
+
<head>
|
|
175
|
+
<meta charset="utf-8">
|
|
176
|
+
<meta name="robots" content="noindex, nofollow">
|
|
177
|
+
<title>Invoices - RPA playground</title>
|
|
178
|
+
</head>
|
|
179
|
+
<body>
|
|
180
|
+
<header>
|
|
181
|
+
<nav aria-label="Portal menu">
|
|
182
|
+
<a id="nav-home" href="/playground/rpa/">Home</a>
|
|
183
|
+
<a id="nav-invoices" href="/playground/rpa/invoices.html" aria-current="page">Invoices</a>
|
|
184
|
+
<a id="nav-settings" href="/playground/rpa/settings.html">Settings</a>
|
|
185
|
+
</nav>
|
|
186
|
+
</header>
|
|
187
|
+
<main>
|
|
188
|
+
<h1>Invoices</h1>
|
|
189
|
+
<form id="invoice-search" aria-label="Invoice search" action="/playground/rpa/invoices.html">
|
|
190
|
+
<label for="invoice-number">Invoice number</label>
|
|
191
|
+
<input id="invoice-number" name="invoiceNumber" data-testid="invoice-number" type="text">
|
|
192
|
+
<label for="invoice-status">Status</label>
|
|
193
|
+
<select id="invoice-status" name="status" data-testid="invoice-status">
|
|
194
|
+
<option value="">Any</option>
|
|
195
|
+
<option value="paid">Paid</option>
|
|
196
|
+
<option value="due">Due</option>
|
|
197
|
+
</select>
|
|
198
|
+
<button id="search-btn" class="btn search" data-testid="search" type="submit">Search</button>
|
|
199
|
+
</form>
|
|
200
|
+
<table id="results" aria-label="Results">
|
|
201
|
+
<caption>Results</caption>
|
|
202
|
+
<thead><tr><th>Invoice</th><th>Status</th><th>Amount</th><th>File</th></tr></thead>
|
|
203
|
+
<tbody>
|
|
204
|
+
<tr data-invoice="INV-1041"><td>INV-1041</td><td class="status">Paid</td><td>120.00</td><td><a class="download" href="/playground/rpa/files/INV-1041.pdf">Download</a></td></tr>
|
|
205
|
+
<tr data-invoice="INV-1042"><td>INV-1042</td><td class="status">Due</td><td>87.50</td><td><a class="download" href="/playground/rpa/files/INV-1042.pdf">Download</a></td></tr>
|
|
206
|
+
</tbody>
|
|
207
|
+
</table>
|
|
208
|
+
</main>
|
|
209
|
+
</body>
|
|
210
|
+
</html>
|
|
211
|
+
`;
|
|
212
|
+
|
|
213
|
+
// src/testing/fixtures/login.ts
|
|
214
|
+
var LOGIN_HTML = `<!doctype html>
|
|
215
|
+
<html lang="en">
|
|
216
|
+
<head>
|
|
217
|
+
<meta charset="utf-8">
|
|
218
|
+
<meta name="robots" content="noindex, nofollow">
|
|
219
|
+
<title>Sign in - RPA playground</title>
|
|
220
|
+
</head>
|
|
221
|
+
<body>
|
|
222
|
+
<main>
|
|
223
|
+
<h1>Sign in</h1>
|
|
224
|
+
<form aria-label="Sign in" action="/playground/rpa/invoices.html">
|
|
225
|
+
<label for="username">Email</label>
|
|
226
|
+
<input id="username" name="username" type="email" autocomplete="username">
|
|
227
|
+
<label for="password">Password</label>
|
|
228
|
+
<input id="password" name="password" type="password" autocomplete="current-password">
|
|
229
|
+
<label for="otp">One-time code</label>
|
|
230
|
+
<input id="otp" name="otp" type="text" autocomplete="one-time-code" inputmode="numeric">
|
|
231
|
+
<label for="comment">Comment</label>
|
|
232
|
+
<textarea id="comment" name="comment"></textarea>
|
|
233
|
+
<button id="sign-in" type="submit">Sign in</button>
|
|
234
|
+
</form>
|
|
235
|
+
<p data-sensitive>Recovery phrase: <span id="phrase">apple banana cherry</span></p>
|
|
236
|
+
</main>
|
|
237
|
+
</body>
|
|
238
|
+
</html>
|
|
239
|
+
`;
|
|
240
|
+
|
|
241
|
+
// src/testing/fixtures/shadow.ts
|
|
242
|
+
var SHADOW_HTML = `<!doctype html>
|
|
243
|
+
<html lang="en">
|
|
244
|
+
<head>
|
|
245
|
+
<meta charset="utf-8">
|
|
246
|
+
<meta name="robots" content="noindex, nofollow">
|
|
247
|
+
<title>Shadow DOM - RPA playground</title>
|
|
248
|
+
</head>
|
|
249
|
+
<body>
|
|
250
|
+
<main>
|
|
251
|
+
<h1>Invoice card</h1>
|
|
252
|
+
<button type="button">Approve</button>
|
|
253
|
+
<invoice-card id="card">
|
|
254
|
+
<template shadowrootmode="open">
|
|
255
|
+
<h2>INV-1042</h2>
|
|
256
|
+
<label for="note">Note</label>
|
|
257
|
+
<input id="note" name="note" type="text">
|
|
258
|
+
<button type="button" part="approve">Approve</button>
|
|
259
|
+
</template>
|
|
260
|
+
</invoice-card>
|
|
261
|
+
</main>
|
|
262
|
+
</body>
|
|
263
|
+
</html>
|
|
264
|
+
`;
|
|
265
|
+
|
|
266
|
+
// src/testing/fixtures/index.ts
|
|
267
|
+
var RPA_FIXTURES = {
|
|
268
|
+
invoices: INVOICES_HTML,
|
|
269
|
+
"invoices-v2": INVOICES_V2_HTML,
|
|
270
|
+
"invoices-v3": INVOICES_V3_HTML,
|
|
271
|
+
ambiguous: AMBIGUOUS_HTML,
|
|
272
|
+
iframe: IFRAME_HTML,
|
|
273
|
+
shadow: SHADOW_HTML,
|
|
274
|
+
login: LOGIN_HTML
|
|
275
|
+
};
|
|
276
|
+
var RPA_FIXTURE_NAMES = Object.keys(RPA_FIXTURES);
|
|
277
|
+
// src/testing/mount.ts
|
|
278
|
+
function attachDeclarativeShadowRoots(root) {
|
|
279
|
+
for (const template of Array.from(root.querySelectorAll("template[shadowrootmode]"))) {
|
|
280
|
+
const host = template.parentElement;
|
|
281
|
+
const mode = template.getAttribute("shadowrootmode") === "closed" ? "closed" : "open";
|
|
282
|
+
if (!host || host.shadowRoot)
|
|
283
|
+
continue;
|
|
284
|
+
let shadow;
|
|
285
|
+
try {
|
|
286
|
+
shadow = host.attachShadow({ mode });
|
|
287
|
+
} catch {
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
const content = template.content;
|
|
291
|
+
shadow.appendChild(content.cloneNode(true));
|
|
292
|
+
template.remove();
|
|
293
|
+
attachDeclarativeShadowRoots(shadow);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function fillSrcdocFrames(document) {
|
|
297
|
+
for (const frame of Array.from(document.querySelectorAll("iframe[srcdoc]"))) {
|
|
298
|
+
const inner = frame.contentDocument;
|
|
299
|
+
const markup = frame.getAttribute("srcdoc") ?? "";
|
|
300
|
+
if (!inner || inner.body?.childElementCount)
|
|
301
|
+
continue;
|
|
302
|
+
inner.open();
|
|
303
|
+
inner.write(markup);
|
|
304
|
+
inner.close();
|
|
305
|
+
attachDeclarativeShadowRoots(inner);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function mountHtml(document, html) {
|
|
309
|
+
document.open();
|
|
310
|
+
document.write(html);
|
|
311
|
+
document.close();
|
|
312
|
+
attachDeclarativeShadowRoots(document);
|
|
313
|
+
fillSrcdocFrames(document);
|
|
314
|
+
return document;
|
|
315
|
+
}
|
|
316
|
+
function mountFixture(document, name) {
|
|
317
|
+
return mountHtml(document, RPA_FIXTURES[name]);
|
|
318
|
+
}
|
|
319
|
+
// src/testing/fake-web-driver.ts
|
|
320
|
+
function createFakeWebDriver(options) {
|
|
321
|
+
const { document } = options;
|
|
322
|
+
const history = [];
|
|
323
|
+
const visited = [];
|
|
324
|
+
const load = (url) => {
|
|
325
|
+
const html = options.pages[url];
|
|
326
|
+
if (html === undefined)
|
|
327
|
+
throw new UiDriverError2("NAVIGATION_FAILED", "The page could not be loaded");
|
|
328
|
+
mountHtml(document, html);
|
|
329
|
+
visited.push(url);
|
|
330
|
+
options.onPageLoad?.(document, url);
|
|
331
|
+
};
|
|
332
|
+
if (options.startUrl !== undefined) {
|
|
333
|
+
load(options.startUrl);
|
|
334
|
+
history.push(options.startUrl);
|
|
335
|
+
}
|
|
336
|
+
const current = () => history[history.length - 1] ?? "about:blank";
|
|
337
|
+
const driver = createDomDriver2({
|
|
338
|
+
document,
|
|
339
|
+
...options.rectOf ? { rectOf: options.rectOf } : {},
|
|
340
|
+
...options.isVisible ? { isVisible: options.isVisible } : {},
|
|
341
|
+
...options.capabilities ? { capabilities: options.capabilities } : {},
|
|
342
|
+
...options.screenshot ? { screenshot: options.screenshot } : {},
|
|
343
|
+
clock: options.clock ?? createVirtualClock2(Date.UTC(2026, 0, 1)),
|
|
344
|
+
navigation: {
|
|
345
|
+
navigate: (url) => {
|
|
346
|
+
load(url);
|
|
347
|
+
history.push(url);
|
|
348
|
+
},
|
|
349
|
+
goBack: () => {
|
|
350
|
+
if (history.length < 2)
|
|
351
|
+
throw new UiDriverError2("NAVIGATION_FAILED", "There is no page to go back to");
|
|
352
|
+
history.pop();
|
|
353
|
+
load(current());
|
|
354
|
+
},
|
|
355
|
+
reload: () => load(current()),
|
|
356
|
+
closeTab: () => {
|
|
357
|
+
mountHtml(document, "<!doctype html><html><body></body></html>");
|
|
358
|
+
history.length = 0;
|
|
359
|
+
},
|
|
360
|
+
currentUrl: current
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
return Object.assign(driver, { url: current, visited });
|
|
364
|
+
}
|
|
365
|
+
export {
|
|
366
|
+
AMBIGUOUS_HTML,
|
|
367
|
+
IFRAME_HTML,
|
|
368
|
+
IFRAME_INNER_HTML,
|
|
369
|
+
INVOICES_HTML,
|
|
370
|
+
INVOICES_V2_HTML,
|
|
371
|
+
INVOICES_V3_HTML,
|
|
372
|
+
LOGIN_HTML,
|
|
373
|
+
RPA_FIXTURES,
|
|
374
|
+
RPA_FIXTURE_NAMES,
|
|
375
|
+
SHADOW_HTML,
|
|
376
|
+
createFakeWebDriver,
|
|
377
|
+
mountFixture,
|
|
378
|
+
mountHtml
|
|
379
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/ui-engine",
|
|
3
|
-
"version": "2026.1127.
|
|
4
|
-
"description": "Shared, browser-safe UI automation engine: recordings, capture-time masking, target resolution, replay
|
|
3
|
+
"version": "2026.1127.4",
|
|
4
|
+
"description": "Shared, browser-safe UI automation engine: recordings, capture-time masking, target resolution, replay, the UI script v1 contract, the multi-method web target resolver and DOM runtime, and the UI script interpreter for FluidGrids RPA and BotManor Stewards.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Burdenoff Consultancy Services Pvt. Ltd.",
|
|
7
7
|
"repository": {
|
|
@@ -37,6 +37,27 @@
|
|
|
37
37
|
"types": "./dist/script.d.ts",
|
|
38
38
|
"import": "./dist/script.js"
|
|
39
39
|
},
|
|
40
|
+
"./target": {
|
|
41
|
+
"types": "./dist/target.d.ts",
|
|
42
|
+
"import": "./dist/target.js"
|
|
43
|
+
},
|
|
44
|
+
"./dom-runtime": {
|
|
45
|
+
"types": "./dist/dom-runtime.d.ts",
|
|
46
|
+
"import": "./dist/dom-runtime.js"
|
|
47
|
+
},
|
|
48
|
+
"./dom-runtime.iife.js": "./dist/dom-runtime.iife.js",
|
|
49
|
+
"./interpret": {
|
|
50
|
+
"types": "./dist/interpret.d.ts",
|
|
51
|
+
"import": "./dist/interpret.js"
|
|
52
|
+
},
|
|
53
|
+
"./drivers": {
|
|
54
|
+
"types": "./dist/drivers.d.ts",
|
|
55
|
+
"import": "./dist/drivers.js"
|
|
56
|
+
},
|
|
57
|
+
"./testing": {
|
|
58
|
+
"types": "./dist/testing.d.ts",
|
|
59
|
+
"import": "./dist/testing.js"
|
|
60
|
+
},
|
|
40
61
|
"./schema/ui-script-v1.schema.json": "./schema/ui-script-v1.schema.json",
|
|
41
62
|
"./package.json": "./package.json"
|
|
42
63
|
},
|
|
@@ -47,7 +68,7 @@
|
|
|
47
68
|
"LICENSE"
|
|
48
69
|
],
|
|
49
70
|
"scripts": {
|
|
50
|
-
"build": "rm -rf dist && bun build src/index.ts src/recording.ts src/capture.ts src/resolve.ts src/replay.ts src/script.ts --outdir dist --target browser --format esm --splitting --packages external && tsc -p tsconfig.build.json",
|
|
71
|
+
"build": "rm -rf dist && bun build src/index.ts src/recording.ts src/capture.ts src/resolve.ts src/replay.ts src/script.ts src/target.ts src/dom-runtime.ts src/interpret.ts src/drivers.ts src/testing.ts --outdir dist --root src --target browser --format esm --splitting --packages external && bun build src/dom-runtime/iife.ts --outfile dist/dom-runtime.iife.js --target browser --format iife --minify && tsc -p tsconfig.build.json",
|
|
51
72
|
"type:check": "boff gate -- bun check --no-pretty",
|
|
52
73
|
"lint": "eslint .",
|
|
53
74
|
"lint:fix": "eslint . --fix",
|
|
@@ -58,7 +79,8 @@
|
|
|
58
79
|
"sanity:force": "boff sanity --force",
|
|
59
80
|
"audit": "bun audit --audit-level=high",
|
|
60
81
|
"check:browser-safe": "bun run scripts/check-browser-safe.ts",
|
|
61
|
-
"schema:write": "bun run scripts/write-ui-script-schema.ts"
|
|
82
|
+
"schema:write": "bun run scripts/write-ui-script-schema.ts",
|
|
83
|
+
"check:runtime-size": "bun run scripts/check-runtime-size.ts"
|
|
62
84
|
},
|
|
63
85
|
"dependencies": {
|
|
64
86
|
"@noble/hashes": "2.4.0"
|
|
@@ -70,6 +92,7 @@
|
|
|
70
92
|
"@burdenoff/toolchain": "2026.1123.1",
|
|
71
93
|
"@types/bun": "^1.4.4",
|
|
72
94
|
"eslint": "^9.39.5",
|
|
95
|
+
"happy-dom": "21.0.4",
|
|
73
96
|
"typescript": "6.0.3",
|
|
74
97
|
"zod": "4.6.7"
|
|
75
98
|
},
|
|
@@ -90,7 +113,8 @@
|
|
|
90
113
|
"scripts"
|
|
91
114
|
],
|
|
92
115
|
"extra": [
|
|
93
|
-
"check:browser-safe"
|
|
116
|
+
"check:browser-safe",
|
|
117
|
+
"check:runtime-size"
|
|
94
118
|
]
|
|
95
119
|
},
|
|
96
120
|
"coverage": {
|