@rstest/browser 0.10.3 → 0.10.5
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/626.js +2 -1
- package/dist/browser-container/container-static/css/index.0521ff95b1.css +1 -0
- package/dist/browser-container/container-static/js/{27.099feaf1da.js → 854.c59f71483d.js} +5728 -5756
- package/dist/browser-container/container-static/js/854.c59f71483d.js.LICENSE.txt +1 -0
- package/dist/browser-container/container-static/js/{index.be8c8d2626.js → index.fedc31dff3.js} +109 -136
- package/dist/browser-container/container-static/js/{lib-react.5ae9b90ee5.js → lib-react.62b27a21db.js} +21 -21
- package/dist/browser-container/container-static/js/lib-react.62b27a21db.js.LICENSE.txt +1 -0
- package/dist/browser-container/index.html +1 -1
- package/dist/browser.js +4 -4
- package/dist/browserRpcRegistry.d.ts +1 -2
- package/dist/client/api.d.ts +1 -1
- package/dist/client/dispatchTransport.d.ts +18 -1
- package/dist/client/locator.d.ts +2 -3
- package/dist/concurrency.d.ts +5 -3
- package/dist/configValidation.d.ts +2 -2
- package/dist/dispatchCapabilities.d.ts +3 -3
- package/dist/dispatchRouter.d.ts +2 -3
- package/dist/headedSerialTaskQueue.d.ts +5 -5
- package/dist/headlessLatestRerunScheduler.d.ts +2 -3
- package/dist/headlessTransport.d.ts +2 -3
- package/dist/hostController.d.ts +12 -9
- package/dist/index.d.ts +6 -6
- package/dist/index.js +169 -216
- package/dist/protocol.d.ts +78 -55
- package/dist/providers/index.d.ts +18 -20
- package/dist/providers/playwright/dispatchBrowserRpc.d.ts +5 -3
- package/dist/providers/playwright/expectUtils.d.ts +2 -3
- package/dist/providers/playwright/implementation.d.ts +1 -1
- package/dist/providers/playwright/runtime.d.ts +1 -1
- package/dist/rpcProtocol.d.ts +36 -29
- package/dist/runSession.d.ts +3 -5
- package/dist/sessionRegistry.d.ts +2 -3
- package/dist/sourceMap/sourceMapLoader.d.ts +2 -2
- package/dist/viewportPresets.d.ts +7 -3
- package/dist/watchCliShortcuts.d.ts +1 -1
- package/dist/watchRerunPlanner.d.ts +2 -2
- package/package.json +7 -9
- package/src/AGENTS.md +7 -1
- package/src/browserRpcRegistry.ts +2 -2
- package/src/client/dispatchTransport.ts +63 -1
- package/src/client/entry.ts +25 -58
- package/src/client/public.ts +3 -3
- package/src/client/snapshot.ts +24 -22
- package/src/client/sourceMapSupport.ts +1 -1
- package/src/concurrency.ts +7 -21
- package/src/configValidation.ts +2 -2
- package/src/dispatchCapabilities.ts +102 -83
- package/src/env.d.ts +6 -2
- package/src/headedSerialTaskQueue.ts +5 -1
- package/src/hostController.ts +85 -43
- package/src/index.ts +22 -11
- package/src/protocol.ts +66 -22
- package/src/providers/index.ts +8 -1
- package/src/rpcProtocol.ts +34 -21
- package/src/viewportPresets.ts +5 -0
- package/src/watchCliShortcuts.ts +2 -4
- package/dist/browser-container/container-static/css/index.5c72297783.css +0 -1
- package/dist/browser-container/container-static/js/27.099feaf1da.js.LICENSE.txt +0 -1
- package/dist/browser-container/container-static/js/lib-react.5ae9b90ee5.js.LICENSE.txt +0 -1
- package/dist/client/entry.d.ts +0 -4
- package/dist/client/fakeTimersStub.d.ts +0 -25
- package/dist/client/public.d.ts +0 -9
- package/dist/client/snapshot.d.ts +0 -29
- package/dist/client/sourceMapSupport.d.ts +0 -42
package/dist/browser-container/container-static/js/{index.be8c8d2626.js → index.fedc31dff3.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(()=>{
|
|
2
2
|
"use strict";
|
|
3
3
|
var e, t, s, l, r, o, a = {
|
|
4
|
-
|
|
5
|
-
var l = s(
|
|
4
|
+
1617 (e, t, s) {
|
|
5
|
+
var l = s(9793);
|
|
6
6
|
let r = "__rstest_dispatch_response__";
|
|
7
|
-
var o = s(
|
|
7
|
+
var o = s(4472), a = s(6961), i = s(6194), n = s(405), c = s(7541);
|
|
8
8
|
let d = (e)=>{
|
|
9
9
|
let { message: t } = e;
|
|
10
10
|
return (0, l.jsx)("div", {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
})
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
var u = s(
|
|
18
|
+
var u = s(165), p = s(179), h = s(8753), f = s(184), x = s(5676);
|
|
19
19
|
let m = (e, t)=>{
|
|
20
20
|
if (!t) return e;
|
|
21
21
|
let s = t.endsWith("/") ? t.slice(0, -1) : t;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
}, "*"), fetch(`/__open-in-editor?file=${encodeURIComponent(e)}`).catch(()=>{});
|
|
34
34
|
};
|
|
35
|
-
var j = s(
|
|
35
|
+
var j = s(1910), v = s(8366), y = s(4560), _ = s(4484), C = s(7527);
|
|
36
36
|
let w = {
|
|
37
37
|
idle: {
|
|
38
38
|
label: "Idle",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
})
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
var k = s(
|
|
81
|
+
var k = s(4909), S = s(7602), F = s(3106), N = s(1725), A = s(9122), P = s(1687), M = s(7046), z = s(4668);
|
|
82
82
|
let O = {
|
|
83
83
|
iPhoneSE: {
|
|
84
84
|
width: 375,
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
width: t.width,
|
|
193
193
|
height: t.height
|
|
194
194
|
};
|
|
195
|
-
}), U = new Set(E.map((e)=>e.id)),
|
|
195
|
+
}), U = new Set(E.map((e)=>e.id)), T = (e)=>"string" == typeof e && U.has(e), $ = (e)=>{
|
|
196
196
|
let t = E.find((t)=>t.id === e);
|
|
197
197
|
if (!t) throw Error(`Unknown device preset: ${e}`);
|
|
198
198
|
return t;
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
let t;
|
|
219
219
|
return {
|
|
220
220
|
value: e.id,
|
|
221
|
-
label: (t =
|
|
221
|
+
label: (t = $(e.id), `${t.label} (${t.width} x ${t.height})`)
|
|
222
222
|
};
|
|
223
223
|
})
|
|
224
224
|
], []), h = (0, l.jsxs)("div", {
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
size: 14,
|
|
380
380
|
strokeWidth: 2.2
|
|
381
381
|
});
|
|
382
|
-
let t =
|
|
382
|
+
let t = $(e.preset).label;
|
|
383
383
|
return t.startsWith("iPad") || t.startsWith("Surface") || t.startsWith("Nest Hub") || t.includes("Fold") ? (0, l.jsx)(P.A, {
|
|
384
384
|
size: 14,
|
|
385
385
|
strokeWidth: 2.2
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
style: {
|
|
395
395
|
color: t.colorTextSecondary
|
|
396
396
|
},
|
|
397
|
-
children: "full" === s.mode ? "Full" : "responsive" === s.mode ? `${s.width} x ${s.height}` :
|
|
397
|
+
children: "full" === s.mode ? "Full" : "responsive" === s.mode ? `${s.width} x ${s.height}` : $(s.preset).label
|
|
398
398
|
})
|
|
399
399
|
]
|
|
400
400
|
})
|
|
@@ -514,7 +514,7 @@
|
|
|
514
514
|
]
|
|
515
515
|
});
|
|
516
516
|
};
|
|
517
|
-
var D = s(
|
|
517
|
+
var D = s(3401);
|
|
518
518
|
let G = (e)=>{
|
|
519
519
|
let { className: t, style: s, direction: r = "horizontal", children: o, autoSaveId: a, ...i } = e, c = n.Children.toArray(o).filter((e)=>n.isValidElement(e) && e.type === Z), d = n.useCallback(()=>{
|
|
520
520
|
if (!a) return null;
|
|
@@ -567,7 +567,7 @@
|
|
|
567
567
|
children: t
|
|
568
568
|
});
|
|
569
569
|
};
|
|
570
|
-
var L = s(
|
|
570
|
+
var L = s(7795), q = s(7319), H = s(7752);
|
|
571
571
|
let J = (e)=>(0, l.jsxs)("svg", {
|
|
572
572
|
xmlns: "http://www.w3.org/2000/svg",
|
|
573
573
|
fill: "none",
|
|
@@ -1585,7 +1585,7 @@
|
|
|
1585
1585
|
]
|
|
1586
1586
|
});
|
|
1587
1587
|
};
|
|
1588
|
-
var X = s(
|
|
1588
|
+
var X = s(2524), K = s(4333), Y = s(3534), Q = s(5749), ee = s(1695), et = s(1255);
|
|
1589
1589
|
let es = (0, n.memo)((e)=>{
|
|
1590
1590
|
let { counts: t, isRunning: s } = e, r = s && 0 === t.running;
|
|
1591
1591
|
return (0, l.jsx)("div", {
|
|
@@ -1725,13 +1725,17 @@
|
|
|
1725
1725
|
]
|
|
1726
1726
|
});
|
|
1727
1727
|
};
|
|
1728
|
-
var er = s(
|
|
1729
|
-
let ec =
|
|
1728
|
+
var er = s(6530), eo = s(9790), ea = s(2741), ei = s(2669), en = s(6405);
|
|
1729
|
+
let ec = (e)=>`__project__${e}`, ed = (e, t)=>`${e}::suite::${t.join("::")}`, eu = (e, t)=>{
|
|
1730
|
+
let s = e;
|
|
1731
|
+
for(let e = 1; e <= t.length; e++)s = ed(s, t.slice(0, e));
|
|
1732
|
+
return s;
|
|
1733
|
+
}, ep = (e, t)=>`${e}::case::${t}`, eh = [
|
|
1730
1734
|
"pass",
|
|
1731
1735
|
"fail",
|
|
1732
1736
|
"skip"
|
|
1733
|
-
],
|
|
1734
|
-
let { icon: t, iconColor: s, status: r, label: o, caseId: a, onRerun: i, buttonTextColor: c } = e, d = (0, n.useRef)(null), [h, f] = (0, n.useState)(0), x =
|
|
1737
|
+
], ef = (e)=>{
|
|
1738
|
+
let { icon: t, iconColor: s, status: r, label: o, caseId: a, onRerun: i, buttonTextColor: c } = e, d = (0, n.useRef)(null), [h, f] = (0, n.useState)(0), x = eh.includes(r);
|
|
1735
1739
|
return (0, n.useEffect)(()=>{
|
|
1736
1740
|
x && null !== d.current && d.current !== r && f((e)=>e + 1), d.current = r;
|
|
1737
1741
|
}, [
|
|
@@ -1783,11 +1787,11 @@
|
|
|
1783
1787
|
})
|
|
1784
1788
|
]
|
|
1785
1789
|
});
|
|
1786
|
-
},
|
|
1790
|
+
}, ex = [
|
|
1787
1791
|
"pass",
|
|
1788
1792
|
"fail"
|
|
1789
|
-
],
|
|
1790
|
-
let { icon: t, iconColor: s, status: r, relativePath: o, filePath: a, onOpen: i, onRerun: c, textColor: d } = e, h = (0, n.useRef)(null), [f, m] = (0, n.useState)(0), g =
|
|
1793
|
+
], em = (e)=>{
|
|
1794
|
+
let { icon: t, iconColor: s, status: r, relativePath: o, filePath: a, onOpen: i, onRerun: c, textColor: d } = e, h = (0, n.useRef)(null), [f, m] = (0, n.useState)(0), g = ex.includes(r);
|
|
1791
1795
|
return (0, n.useEffect)(()=>{
|
|
1792
1796
|
g && null !== h.current && h.current !== r && m((e)=>e + 1), h.current = r;
|
|
1793
1797
|
}, [
|
|
@@ -1867,12 +1871,12 @@
|
|
|
1867
1871
|
})
|
|
1868
1872
|
]
|
|
1869
1873
|
});
|
|
1870
|
-
},
|
|
1874
|
+
}, eg = [
|
|
1871
1875
|
"pass",
|
|
1872
1876
|
"fail",
|
|
1873
1877
|
"skip"
|
|
1874
|
-
],
|
|
1875
|
-
let { icon: t, iconColor: s, status: r, name: o, fullName: a, onRerun: i, buttonTextColor: c } = e, d = (0, n.useRef)(null), [h, f] = (0, n.useState)(0), x =
|
|
1878
|
+
], ej = (e)=>{
|
|
1879
|
+
let { icon: t, iconColor: s, status: r, name: o, fullName: a, onRerun: i, buttonTextColor: c } = e, d = (0, n.useRef)(null), [h, f] = (0, n.useState)(0), x = eg.includes(r);
|
|
1876
1880
|
return (0, n.useEffect)(()=>{
|
|
1877
1881
|
x && null !== d.current && d.current !== r && f((e)=>e + 1), d.current = r;
|
|
1878
1882
|
}, [
|
|
@@ -1924,7 +1928,7 @@
|
|
|
1924
1928
|
})
|
|
1925
1929
|
]
|
|
1926
1930
|
});
|
|
1927
|
-
},
|
|
1931
|
+
}, ev = (e)=>{
|
|
1928
1932
|
let { testFiles: t, statusMap: s, caseMap: r, rootPath: o, projects: a, loading: i, connected: c, openFiles: d, activeFile: u, token: p, filterText: h, onExpandChange: f, onSelect: x, onRerunFile: j, onRerunTestCase: v } = e, { filteredTestFiles: y, filteredCaseMap: _ } = (0, n.useMemo)(()=>{
|
|
1929
1933
|
if (!h.trim()) return {
|
|
1930
1934
|
filteredTestFiles: t,
|
|
@@ -1985,10 +1989,10 @@
|
|
|
1985
1989
|
}, o = (t, s)=>{
|
|
1986
1990
|
let a = [];
|
|
1987
1991
|
for (let i of t.children.values()){
|
|
1988
|
-
let t = r(i), n = b[t], d =
|
|
1992
|
+
let t = r(i), n = b[t], d = ed(s, i.fullPath), u = i.fullPath.join(" ");
|
|
1989
1993
|
a.push({
|
|
1990
1994
|
key: d,
|
|
1991
|
-
title: (0, l.jsx)(
|
|
1995
|
+
title: (0, l.jsx)(ej, {
|
|
1992
1996
|
icon: n.icon,
|
|
1993
1997
|
iconColor: n.color,
|
|
1994
1998
|
status: t,
|
|
@@ -2006,8 +2010,8 @@
|
|
|
2006
2010
|
for (let r of t.cases){
|
|
2007
2011
|
let t = b[r.status];
|
|
2008
2012
|
a.push({
|
|
2009
|
-
key:
|
|
2010
|
-
title: (0, l.jsx)(
|
|
2013
|
+
key: ep(s, r.id),
|
|
2014
|
+
title: (0, l.jsx)(ef, {
|
|
2011
2015
|
icon: t.icon,
|
|
2012
2016
|
iconColor: t.color,
|
|
2013
2017
|
status: r.status,
|
|
@@ -2038,7 +2042,7 @@
|
|
|
2038
2042
|
let r = e.testPath, a = s[r] ?? "idle", i = w[a], n = m(r, t ?? o), d = Object.values(_[r] ?? {});
|
|
2039
2043
|
return {
|
|
2040
2044
|
key: r,
|
|
2041
|
-
title: (0, l.jsx)(
|
|
2045
|
+
title: (0, l.jsx)(em, {
|
|
2042
2046
|
icon: i.icon,
|
|
2043
2047
|
iconColor: i.color,
|
|
2044
2048
|
status: a,
|
|
@@ -2054,7 +2058,7 @@
|
|
|
2054
2058
|
};
|
|
2055
2059
|
};
|
|
2056
2060
|
return e.length > 1 ? e.map((e)=>{
|
|
2057
|
-
let o = y.filter((t)=>t.projectName === e), a =
|
|
2061
|
+
let o = y.filter((t)=>t.projectName === e), a = ec(e), i = t.get(e), n = o.map((e)=>s[e.testPath] ?? "idle"), c = "idle";
|
|
2058
2062
|
n.some((e)=>"fail" === e) ? c = "fail" : n.some((e)=>"running" === e) ? c = "running" : n.length > 0 && n.every((e)=>"pass" === e) && (c = "pass");
|
|
2059
2063
|
let d = w[c];
|
|
2060
2064
|
return {
|
|
@@ -2165,18 +2169,18 @@
|
|
|
2165
2169
|
children: "Reconnecting..."
|
|
2166
2170
|
})
|
|
2167
2171
|
});
|
|
2168
|
-
},
|
|
2172
|
+
}, ey = (e, t)=>Number.isFinite(e) && e > 0 && Number.isFinite(t) && t > 0, e_ = (e)=>{
|
|
2169
2173
|
if (!e) return {
|
|
2170
2174
|
mode: "full"
|
|
2171
2175
|
};
|
|
2172
|
-
if ("string" == typeof e &&
|
|
2176
|
+
if ("string" == typeof e && T(e)) return {
|
|
2173
2177
|
mode: "preset",
|
|
2174
2178
|
preset: e,
|
|
2175
2179
|
orientation: "portrait"
|
|
2176
2180
|
};
|
|
2177
2181
|
if ("object" == typeof e) {
|
|
2178
2182
|
let t = Number(e.width), s = Number(e.height);
|
|
2179
|
-
if (
|
|
2183
|
+
if (ey(t, s)) return {
|
|
2180
2184
|
mode: "responsive",
|
|
2181
2185
|
width: t,
|
|
2182
2186
|
height: s
|
|
@@ -2185,14 +2189,14 @@
|
|
|
2185
2189
|
return {
|
|
2186
2190
|
mode: "full"
|
|
2187
2191
|
};
|
|
2188
|
-
},
|
|
2192
|
+
}, eC = (e, t, s)=>Math.min(s, Math.max(t, e)), ew = (e)=>{
|
|
2189
2193
|
let { token: t, selection: s, active: r, onResponsiveResize: o, children: a, ...i } = e, c = (0, n.useRef)(null), d = ((e)=>{
|
|
2190
2194
|
if ("full" === e.mode) return null;
|
|
2191
2195
|
if ("responsive" === e.mode) return {
|
|
2192
2196
|
width: e.width,
|
|
2193
2197
|
height: e.height
|
|
2194
2198
|
};
|
|
2195
|
-
let t =
|
|
2199
|
+
let t = $(e.preset);
|
|
2196
2200
|
return "landscape" === e.orientation ? {
|
|
2197
2201
|
width: t.height,
|
|
2198
2202
|
height: t.width
|
|
@@ -2213,7 +2217,7 @@
|
|
|
2213
2217
|
return;
|
|
2214
2218
|
}
|
|
2215
2219
|
if (l.width <= 0 || l.height <= 0) return;
|
|
2216
|
-
let r =
|
|
2220
|
+
let r = eC(Math.round(l.width), 1, 1e4), a = eC(Math.round(l.height), 1, 1e4);
|
|
2217
2221
|
(r !== s.width || a !== s.height) && o({
|
|
2218
2222
|
width: r,
|
|
2219
2223
|
height: a
|
|
@@ -2254,7 +2258,7 @@
|
|
|
2254
2258
|
...i,
|
|
2255
2259
|
children: a
|
|
2256
2260
|
});
|
|
2257
|
-
},
|
|
2261
|
+
}, eb = (e)=>"object" == typeof e && null !== e, ek = (e, t)=>"string" == typeof e[t], eS = (e)=>{
|
|
2258
2262
|
let { filePath: t, test: s, status: l, previousCase: r } = e, o = (s.parentNames ?? []).filter(Boolean), a = [
|
|
2259
2263
|
...o,
|
|
2260
2264
|
s.name
|
|
@@ -2268,7 +2272,7 @@
|
|
|
2268
2272
|
filePath: s.testPath || r?.filePath || t,
|
|
2269
2273
|
location: s.location ?? r?.location
|
|
2270
2274
|
};
|
|
2271
|
-
},
|
|
2275
|
+
}, eF = (e)=>"object" == typeof e && null !== e && "requestId" in e && "string" == typeof e.requestId ? e.requestId : "unknown-request", eN = async (e, t, s)=>{
|
|
2272
2276
|
if (null === s || "function" != typeof s.postMessage) return;
|
|
2273
2277
|
let l = (e)=>{
|
|
2274
2278
|
s.postMessage({
|
|
@@ -2276,8 +2280,8 @@
|
|
|
2276
2280
|
payload: e
|
|
2277
2281
|
}, "*");
|
|
2278
2282
|
};
|
|
2279
|
-
if ("unknown-request" ===
|
|
2280
|
-
requestId:
|
|
2283
|
+
if ("unknown-request" === eF(t)) return void l({
|
|
2284
|
+
requestId: eF(t),
|
|
2281
2285
|
error: "Invalid dispatch request payload: expected an object with string requestId."
|
|
2282
2286
|
});
|
|
2283
2287
|
if (!e) return void l({
|
|
@@ -2292,28 +2296,28 @@
|
|
|
2292
2296
|
error: e instanceof Error ? e.message : String(e)
|
|
2293
2297
|
});
|
|
2294
2298
|
}
|
|
2295
|
-
},
|
|
2299
|
+
}, eA = [
|
|
2296
2300
|
1e3,
|
|
2297
2301
|
2e3,
|
|
2298
2302
|
4e3,
|
|
2299
2303
|
8e3,
|
|
2300
2304
|
16e3,
|
|
2301
2305
|
3e4
|
|
2302
|
-
],
|
|
2306
|
+
], eP = function(e, t, s) {
|
|
2303
2307
|
let l = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], r = arguments.length > 4 ? arguments[4] : void 0, o = new URL("/runner.html", t || window.location.origin);
|
|
2304
2308
|
return o.searchParams.set("testFile", e), s && o.searchParams.set("testNamePattern", s), r && o.searchParams.set("runId", r), l && o.searchParams.set("t", Date.now().toString()), o.toString();
|
|
2305
2309
|
};
|
|
2306
|
-
var
|
|
2307
|
-
let
|
|
2310
|
+
var eM = s(5999);
|
|
2311
|
+
let ez = function() {
|
|
2308
2312
|
for(var e = arguments.length, t = Array(e), s = 0; s < e; s++)t[s] = arguments[s];
|
|
2309
2313
|
window.__RSTEST_BROWSER_OPTIONS__?.debug === !0 && console.log(...t);
|
|
2310
|
-
},
|
|
2314
|
+
}, eO = (e)=>{
|
|
2311
2315
|
try {
|
|
2312
2316
|
return new URL(e.src, window.location.href).searchParams.get("runId") ?? void 0;
|
|
2313
2317
|
} catch {
|
|
2314
2318
|
return;
|
|
2315
2319
|
}
|
|
2316
|
-
},
|
|
2320
|
+
}, eR = (e)=>Array.from(document.querySelectorAll("iframe[data-test-file]")).find((t)=>t.dataset.testFile === e), eE = (e)=>{
|
|
2317
2321
|
let { options: t, theme: s, setTheme: a } = e, { token: i } = o.A.useToken(), [c, u] = (0, n.useState)([]), [p, h] = (0, n.useState)(null), [f, x] = (0, n.useState)({}), [m, g] = (0, n.useState)({}), [j, v] = (0, n.useState)([]), [y, _] = (0, n.useState)(""), [C, w] = (0, n.useState)({}), b = (0, n.useCallback)((e)=>{
|
|
2318
2322
|
let s = 5381;
|
|
2319
2323
|
for(let e = 0; e < t.rootPath.length; e++)s = 33 * s ^ t.rootPath.charCodeAt(e);
|
|
@@ -2332,16 +2336,15 @@
|
|
|
2332
2336
|
};
|
|
2333
2337
|
if ("responsive" === l) {
|
|
2334
2338
|
let e = Number(s.width), t = Number(s.height);
|
|
2335
|
-
|
|
2339
|
+
return ey(e, t) ? {
|
|
2336
2340
|
mode: "responsive",
|
|
2337
2341
|
width: e,
|
|
2338
2342
|
height: t
|
|
2339
|
-
};
|
|
2340
|
-
return null;
|
|
2343
|
+
} : null;
|
|
2341
2344
|
}
|
|
2342
2345
|
if ("preset" === l) {
|
|
2343
2346
|
let e = s.preset, t = s.orientation;
|
|
2344
|
-
if (
|
|
2347
|
+
if (T(e) && ("portrait" === t || "landscape" === t)) return {
|
|
2345
2348
|
mode: "preset",
|
|
2346
2349
|
preset: e,
|
|
2347
2350
|
orientation: t
|
|
@@ -2361,7 +2364,7 @@
|
|
|
2361
2364
|
b
|
|
2362
2365
|
]), [F, N] = (0, n.useState)(()=>{
|
|
2363
2366
|
let e = {};
|
|
2364
|
-
for (let s of t.projects ?? [])e[s.name] = k(s.name) ??
|
|
2367
|
+
for (let s of t.projects ?? [])e[s.name] = k(s.name) ?? e_(s.viewport);
|
|
2365
2368
|
return e;
|
|
2366
2369
|
});
|
|
2367
2370
|
(0, n.useEffect)(()=>{
|
|
@@ -2369,7 +2372,7 @@
|
|
|
2369
2372
|
let s = {
|
|
2370
2373
|
...e
|
|
2371
2374
|
};
|
|
2372
|
-
for (let e of t.projects ?? [])s[e.name] || (s[e.name] = k(e.name) ??
|
|
2375
|
+
for (let e of t.projects ?? [])s[e.name] || (s[e.name] = k(e.name) ?? e_(e.viewport));
|
|
2373
2376
|
return s;
|
|
2374
2377
|
});
|
|
2375
2378
|
}, [
|
|
@@ -2377,9 +2380,9 @@
|
|
|
2377
2380
|
k
|
|
2378
2381
|
]);
|
|
2379
2382
|
let A = (0, n.useCallback)(async (e, s)=>{
|
|
2380
|
-
|
|
2383
|
+
ez("[Container] handleReloadTestFile called:", e, s), h(e);
|
|
2381
2384
|
let l = document.querySelector(`iframe[data-test-file="${e}"]`);
|
|
2382
|
-
if (
|
|
2385
|
+
if (ez("[Container] Found iframe:", l), !l) throw Error(`Cannot reload test file "${e}": iframe not found`);
|
|
2383
2386
|
let r = "function" == typeof globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : `run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
2384
2387
|
w((t)=>({
|
|
2385
2388
|
...t,
|
|
@@ -2398,8 +2401,8 @@
|
|
|
2398
2401
|
[e]: l
|
|
2399
2402
|
};
|
|
2400
2403
|
});
|
|
2401
|
-
let o =
|
|
2402
|
-
return
|
|
2404
|
+
let o = eP(e, t.runnerUrl, s, !1, r);
|
|
2405
|
+
return ez("[Container] Setting iframe.src to:", o), l.src = o, {
|
|
2403
2406
|
runId: r
|
|
2404
2407
|
};
|
|
2405
2408
|
}, [
|
|
@@ -2422,15 +2425,15 @@
|
|
|
2422
2425
|
p.current = e = new WebSocket((h = "https:" === window.location.protocol ? "wss:" : "ws:", `${h}//${window.location.hostname}:${t}`));
|
|
2423
2426
|
let f = new WeakMap, x = {
|
|
2424
2427
|
onTestFileUpdate (e) {
|
|
2425
|
-
|
|
2428
|
+
ez("[Container RPC] onTestFileUpdate called:", e), d.current(e);
|
|
2426
2429
|
},
|
|
2427
2430
|
async reloadTestFile (e, t) {
|
|
2428
|
-
if (
|
|
2431
|
+
if (ez("[Container RPC] reloadTestFile called:", e, t), !u.current) throw Error("reloadTestFile handler is not available");
|
|
2429
2432
|
return u.current(e, t);
|
|
2430
2433
|
}
|
|
2431
2434
|
};
|
|
2432
2435
|
e.onopen = ()=>{
|
|
2433
|
-
i && e && (
|
|
2436
|
+
i && e && (ez("[Container] WebSocket connected"), l = 0, c(!0), r(s = (0, eM.L)(x, {
|
|
2434
2437
|
timeout: -1,
|
|
2435
2438
|
post: (t)=>{
|
|
2436
2439
|
e?.readyState === WebSocket.OPEN && e.send(JSON.stringify(t));
|
|
@@ -2457,13 +2460,13 @@
|
|
|
2457
2460
|
}));
|
|
2458
2461
|
}, e.onclose = ()=>{
|
|
2459
2462
|
if (p.current !== e || !i) return;
|
|
2460
|
-
|
|
2461
|
-
let t =
|
|
2462
|
-
|
|
2463
|
+
ez("[Container] WebSocket disconnected"), s?.$close(Error("Container WebSocket disconnected")), r(null), c(!1);
|
|
2464
|
+
let t = eA[Math.min(l, eA.length - 1)];
|
|
2465
|
+
ez(`[Container] Reconnecting in ${t}ms (attempt ${l + 1})`), l++, o = setTimeout(()=>{
|
|
2463
2466
|
i && n();
|
|
2464
2467
|
}, t);
|
|
2465
2468
|
}, e.onerror = ()=>{
|
|
2466
|
-
i &&
|
|
2469
|
+
i && ez("[Container] WebSocket error");
|
|
2467
2470
|
};
|
|
2468
2471
|
};
|
|
2469
2472
|
return n(), ()=>{
|
|
@@ -2497,7 +2500,7 @@
|
|
|
2497
2500
|
c
|
|
2498
2501
|
]), (0, n.useEffect)(()=>{
|
|
2499
2502
|
P && z && P.onRunnerFramesReady(c.map((e)=>e.testPath)).catch((e)=>{
|
|
2500
|
-
|
|
2503
|
+
ez("[Container RPC] Failed to notify runner frames ready:", e);
|
|
2501
2504
|
});
|
|
2502
2505
|
}, [
|
|
2503
2506
|
P,
|
|
@@ -2507,25 +2510,18 @@
|
|
|
2507
2510
|
let O = (0, n.useCallback)((e)=>"pass" === e ? "pass" : "fail" === e ? "fail" : "skip" === e || "todo" === e ? "skip" : "running", []), R = (0, n.useCallback)((e)=>{
|
|
2508
2511
|
h(e);
|
|
2509
2512
|
}, []), E = (0, n.useCallback)((e, t)=>{
|
|
2510
|
-
let s = (
|
|
2511
|
-
|
|
2512
|
-
t
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2513
|
+
let s = eS({
|
|
2514
|
+
filePath: e,
|
|
2515
|
+
test: t,
|
|
2516
|
+
status: O(t.status)
|
|
2517
|
+
});
|
|
2518
|
+
g((l)=>{
|
|
2519
|
+
let r = l[e] ?? {};
|
|
2516
2520
|
return {
|
|
2517
|
-
...
|
|
2521
|
+
...l,
|
|
2518
2522
|
[e]: {
|
|
2519
|
-
...
|
|
2520
|
-
[t.testId]:
|
|
2521
|
-
id: t.testId,
|
|
2522
|
-
name: t.name,
|
|
2523
|
-
parentNames: s,
|
|
2524
|
-
fullName: l,
|
|
2525
|
-
status: O(t.status),
|
|
2526
|
-
filePath: t.testPath || e,
|
|
2527
|
-
location: t.location
|
|
2528
|
-
}
|
|
2523
|
+
...r,
|
|
2524
|
+
[t.testId]: s
|
|
2529
2525
|
}
|
|
2530
2526
|
};
|
|
2531
2527
|
});
|
|
@@ -2540,7 +2536,7 @@
|
|
|
2540
2536
|
return;
|
|
2541
2537
|
}
|
|
2542
2538
|
let s = l[e.testId];
|
|
2543
|
-
r[e.testId] =
|
|
2539
|
+
r[e.testId] = eS({
|
|
2544
2540
|
filePath: t,
|
|
2545
2541
|
test: e,
|
|
2546
2542
|
status: s?.status ?? "idle",
|
|
@@ -2559,7 +2555,7 @@
|
|
|
2559
2555
|
[e]: r
|
|
2560
2556
|
};
|
|
2561
2557
|
});
|
|
2562
|
-
}, []),
|
|
2558
|
+
}, []), $ = (0, n.useCallback)((e, t)=>{
|
|
2563
2559
|
g((s)=>{
|
|
2564
2560
|
let l = s[e] ?? {};
|
|
2565
2561
|
return {
|
|
@@ -2568,7 +2564,7 @@
|
|
|
2568
2564
|
let { filePath: t, test: s, previousCases: l } = e, r = l[s.testId];
|
|
2569
2565
|
return {
|
|
2570
2566
|
...l,
|
|
2571
|
-
[s.testId]:
|
|
2567
|
+
[s.testId]: eS({
|
|
2572
2568
|
filePath: t,
|
|
2573
2569
|
test: s,
|
|
2574
2570
|
status: "running",
|
|
@@ -2630,27 +2626,17 @@
|
|
|
2630
2626
|
if ("string" == typeof l) {
|
|
2631
2627
|
let t = ((e)=>{
|
|
2632
2628
|
if (e) return Array.from(document.querySelectorAll("iframe[data-test-file]")).find((t)=>t.contentWindow === e);
|
|
2633
|
-
})(e.source) ??
|
|
2629
|
+
})(e.source) ?? eR(l), r = (t ? eO(t) : void 0) ?? C[l], o = "pass" === s.status || "skip" === s.status;
|
|
2634
2630
|
x((e)=>({
|
|
2635
2631
|
...e,
|
|
2636
2632
|
[l]: o ? "pass" : "fail"
|
|
2637
2633
|
})), g((e)=>{
|
|
2638
2634
|
let t = {};
|
|
2639
|
-
for (let e of s.results ?? [])
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
t[e.testId] = {
|
|
2645
|
-
id: e.testId,
|
|
2646
|
-
name: e.name,
|
|
2647
|
-
parentNames: s,
|
|
2648
|
-
fullName: r,
|
|
2649
|
-
status: O(e.status),
|
|
2650
|
-
filePath: e.testPath || l,
|
|
2651
|
-
location: e.location
|
|
2652
|
-
};
|
|
2653
|
-
}
|
|
2635
|
+
for (let e of s.results ?? [])e?.testId && (t[e.testId] = eS({
|
|
2636
|
+
filePath: l,
|
|
2637
|
+
test: e,
|
|
2638
|
+
status: O(e.status)
|
|
2639
|
+
}));
|
|
2654
2640
|
return {
|
|
2655
2641
|
...e,
|
|
2656
2642
|
[l]: t
|
|
@@ -2677,15 +2663,15 @@
|
|
|
2677
2663
|
}
|
|
2678
2664
|
if ("runner" === s.namespace && "case-start" === s.method) {
|
|
2679
2665
|
let e = s.args;
|
|
2680
|
-
"string" == typeof e?.testPath && e.testId &&
|
|
2666
|
+
"string" == typeof e?.testPath && e.testId && $(e.testPath, e);
|
|
2681
2667
|
}
|
|
2682
2668
|
let l = ((e)=>{
|
|
2683
|
-
if (!
|
|
2669
|
+
if (!eb(e) || "browser" !== e.namespace || "rpc" !== e.method) return null;
|
|
2684
2670
|
let t = e.args;
|
|
2685
|
-
return
|
|
2671
|
+
return eb(t) && ek(t, "id") && ek(t, "kind") && ek(t, "method") && ek(t, "testPath") && ek(t, "runId") ? t : null;
|
|
2686
2672
|
})(s);
|
|
2687
2673
|
if (l) {
|
|
2688
|
-
let t =
|
|
2674
|
+
let t = eR(l.testPath), o = t ? eO(t) : void 0;
|
|
2689
2675
|
if (!o || l.runId !== o) {
|
|
2690
2676
|
let t, a;
|
|
2691
2677
|
null !== (t = e.source) && "function" == typeof t.postMessage && e.source.postMessage({
|
|
@@ -2699,7 +2685,7 @@
|
|
|
2699
2685
|
return;
|
|
2700
2686
|
}
|
|
2701
2687
|
}
|
|
2702
|
-
|
|
2688
|
+
eN(P, s, e.source);
|
|
2703
2689
|
}
|
|
2704
2690
|
}
|
|
2705
2691
|
};
|
|
@@ -2711,7 +2697,7 @@
|
|
|
2711
2697
|
P,
|
|
2712
2698
|
C,
|
|
2713
2699
|
U,
|
|
2714
|
-
|
|
2700
|
+
$
|
|
2715
2701
|
]);
|
|
2716
2702
|
let L = (0, n.useMemo)(()=>{
|
|
2717
2703
|
let e = Object.values(m).flatMap((e)=>Object.values(e));
|
|
@@ -2730,25 +2716,12 @@
|
|
|
2730
2716
|
let e = [], t = [
|
|
2731
2717
|
...new Set(c.map((e)=>e.projectName))
|
|
2732
2718
|
];
|
|
2733
|
-
if (t.length > 1) for (let s of t)e.push(
|
|
2719
|
+
if (t.length > 1) for (let s of t)e.push(ec(s));
|
|
2734
2720
|
for (let t of c){
|
|
2735
2721
|
let s = t.testPath;
|
|
2736
|
-
e.push(s)
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
let t = e.parentNames;
|
|
2740
|
-
for(let e = 1; e <= t.length; e++){
|
|
2741
|
-
let s = t.slice(0, e).join("::");
|
|
2742
|
-
r.add(s);
|
|
2743
|
-
}
|
|
2744
|
-
}
|
|
2745
|
-
for (let t of r){
|
|
2746
|
-
let l = t.split("::"), r = s;
|
|
2747
|
-
for(let e = 1; e <= l.length; e++){
|
|
2748
|
-
let t = l.slice(0, e).join("::");
|
|
2749
|
-
r = `${r}::suite::${t}`;
|
|
2750
|
-
}
|
|
2751
|
-
e.push(r);
|
|
2722
|
+
for (let t of (e.push(s), Object.values(m[s] ?? {}))){
|
|
2723
|
+
let { parentNames: l } = t;
|
|
2724
|
+
for(let t = 1; t <= l.length; t++)e.push(eu(s, l.slice(0, t)));
|
|
2752
2725
|
}
|
|
2753
2726
|
}
|
|
2754
2727
|
return [
|
|
@@ -2771,7 +2744,7 @@
|
|
|
2771
2744
|
p,
|
|
2772
2745
|
c,
|
|
2773
2746
|
t.projects
|
|
2774
|
-
]), Q = (0, n.useMemo)(()=>Y ? F[Y] ??
|
|
2747
|
+
]), Q = (0, n.useMemo)(()=>Y ? F[Y] ?? e_(K.get(Y)) : {
|
|
2775
2748
|
mode: "full"
|
|
2776
2749
|
}, [
|
|
2777
2750
|
Y,
|
|
@@ -2846,7 +2819,7 @@
|
|
|
2846
2819
|
style: {
|
|
2847
2820
|
background: i.colorBgContainer
|
|
2848
2821
|
},
|
|
2849
|
-
children: (0, l.jsx)(
|
|
2822
|
+
children: (0, l.jsx)(ev, {
|
|
2850
2823
|
testFiles: c,
|
|
2851
2824
|
statusMap: f,
|
|
2852
2825
|
caseMap: m,
|
|
@@ -2896,12 +2869,12 @@
|
|
|
2896
2869
|
c.map((e)=>{
|
|
2897
2870
|
var s;
|
|
2898
2871
|
let r, o, a, n;
|
|
2899
|
-
return r = e.testPath === p, o = C[e.testPath], a = F[e.projectName] ??
|
|
2872
|
+
return r = e.testPath === p, o = C[e.testPath], a = F[e.projectName] ?? e_(K.get(e.projectName)), (0, l.jsx)("div", {
|
|
2900
2873
|
className: "h-full w-full",
|
|
2901
2874
|
style: {
|
|
2902
2875
|
display: r ? "block" : "none"
|
|
2903
2876
|
},
|
|
2904
|
-
children: (0, l.jsx)(
|
|
2877
|
+
children: (0, l.jsx)(ew, {
|
|
2905
2878
|
token: i,
|
|
2906
2879
|
selection: a,
|
|
2907
2880
|
active: r,
|
|
@@ -2912,14 +2885,14 @@
|
|
|
2912
2885
|
children: (0, l.jsx)("iframe", {
|
|
2913
2886
|
"data-test-file": e.testPath,
|
|
2914
2887
|
title: `Test runner for ${(n = (s = e.testPath).split("/"))[n.length - 1] || s}`,
|
|
2915
|
-
src: o ?
|
|
2888
|
+
src: o ? eP(e.testPath, t.runnerUrl, void 0, !1, o) : "about:blank",
|
|
2916
2889
|
className: "block h-full w-full border-0",
|
|
2917
2890
|
style: {
|
|
2918
2891
|
background: i.colorBgContainer
|
|
2919
2892
|
},
|
|
2920
2893
|
onLoad: (s)=>{
|
|
2921
2894
|
if (!o) return;
|
|
2922
|
-
let l = s.currentTarget, r =
|
|
2895
|
+
let l = s.currentTarget, r = eO(l) ?? o;
|
|
2923
2896
|
l.contentWindow && l.contentWindow.postMessage({
|
|
2924
2897
|
type: "RSTEST_CONFIG",
|
|
2925
2898
|
payload: {
|
|
@@ -2941,7 +2914,7 @@
|
|
|
2941
2914
|
]
|
|
2942
2915
|
})
|
|
2943
2916
|
});
|
|
2944
|
-
},
|
|
2917
|
+
}, eU = ()=>{
|
|
2945
2918
|
let e = window.__RSTEST_BROWSER_OPTIONS__, [t, s] = (0, n.useState)("dark"), [r, c] = (0, n.useState)("dark");
|
|
2946
2919
|
(0, n.useEffect)(()=>{
|
|
2947
2920
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e)=>c(e.matches ? "dark" : "light");
|
|
@@ -2986,20 +2959,20 @@
|
|
|
2986
2959
|
}
|
|
2987
2960
|
},
|
|
2988
2961
|
children: (0, l.jsx)(i.A, {
|
|
2989
|
-
children: (0, l.jsx)(
|
|
2962
|
+
children: (0, l.jsx)(eE, {
|
|
2990
2963
|
options: e,
|
|
2991
2964
|
theme: t,
|
|
2992
2965
|
setTheme: s
|
|
2993
2966
|
})
|
|
2994
2967
|
})
|
|
2995
2968
|
});
|
|
2996
|
-
},
|
|
2969
|
+
}, eT = ()=>{
|
|
2997
2970
|
let e = document.getElementById("root");
|
|
2998
2971
|
e && c.createRoot(e).render((0, l.jsx)(n.StrictMode, {
|
|
2999
|
-
children: (0, l.jsx)(
|
|
2972
|
+
children: (0, l.jsx)(eU, {})
|
|
3000
2973
|
}));
|
|
3001
2974
|
};
|
|
3002
|
-
"loading" === document.readyState ? document.addEventListener("DOMContentLoaded",
|
|
2975
|
+
"loading" === document.readyState ? document.addEventListener("DOMContentLoaded", eT) : eT();
|
|
3003
2976
|
}
|
|
3004
2977
|
}, i = {};
|
|
3005
2978
|
function n(e) {
|
|
@@ -3072,7 +3045,7 @@
|
|
|
3072
3045
|
}, (o = self.rspackChunk_rstest_browser_ui = self.rspackChunk_rstest_browser_ui || []).forEach(r.bind(null, 0)), o.push = r.bind(null, o.push.bind(o));
|
|
3073
3046
|
var c = n.O(void 0, [
|
|
3074
3047
|
"783",
|
|
3075
|
-
"
|
|
3076
|
-
], ()=>n(
|
|
3048
|
+
"854"
|
|
3049
|
+
], ()=>n(1617));
|
|
3077
3050
|
c = n.O(c);
|
|
3078
3051
|
})();
|