@rstest/browser 0.9.10 → 0.10.1

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.
Files changed (37) hide show
  1. package/dist/augmentExpect.d.ts +1 -1
  2. package/dist/browser-container/container-static/js/{102.e63e4aa16d.js → 188.480c3c49b5.js} +4543 -4250
  3. package/dist/browser-container/container-static/js/188.480c3c49b5.js.LICENSE.txt +1 -0
  4. package/dist/browser-container/container-static/js/{index.af52585634.js → index.29fc60be33.js} +10 -10
  5. package/dist/browser-container/container-static/js/{lib-react.9e703e1b29.js → lib-react.5ae9b90ee5.js} +24 -24
  6. package/dist/browser-container/container-static/js/lib-react.5ae9b90ee5.js.LICENSE.txt +1 -0
  7. package/dist/browser-container/index.html +1 -1
  8. package/dist/browser.d.ts +2 -2
  9. package/dist/client/api.d.ts +2 -2
  10. package/dist/client/browserRpc.d.ts +2 -2
  11. package/dist/client/dispatchTransport.d.ts +1 -1
  12. package/dist/client/locator.d.ts +2 -2
  13. package/dist/concurrency.d.ts +1 -1
  14. package/dist/dispatchCapabilities.d.ts +2 -2
  15. package/dist/dispatchRouter.d.ts +1 -1
  16. package/dist/headlessTransport.d.ts +2 -2
  17. package/dist/hostController.d.ts +2 -2
  18. package/dist/index.d.ts +3 -3
  19. package/dist/index.js +205 -23
  20. package/dist/protocol.d.ts +6 -2
  21. package/dist/providers/index.d.ts +1 -1
  22. package/dist/providers/playwright/compileLocator.d.ts +1 -1
  23. package/dist/providers/playwright/dispatchBrowserRpc.d.ts +1 -1
  24. package/dist/providers/playwright/expectUtils.d.ts +1 -1
  25. package/dist/providers/playwright/implementation.d.ts +1 -1
  26. package/dist/providers/playwright/index.d.ts +1 -1
  27. package/dist/providers/playwright/runtime.d.ts +1 -1
  28. package/dist/providers/playwright/textMatcher.d.ts +2 -2
  29. package/dist/sessionRegistry.d.ts +1 -1
  30. package/dist/viewportPresets.d.ts +1 -1
  31. package/dist/watchRerunPlanner.d.ts +1 -1
  32. package/package.json +9 -9
  33. package/src/client/entry.ts +75 -14
  34. package/src/hostController.ts +405 -70
  35. package/src/protocol.ts +4 -0
  36. package/dist/browser-container/container-static/js/102.e63e4aa16d.js.LICENSE.txt +0 -1
  37. package/dist/browser-container/container-static/js/lib-react.9e703e1b29.js.LICENSE.txt +0 -1
@@ -0,0 +1 @@
1
+ /*! LICENSE: 188.480c3c49b5.js.LICENSE.txt */
@@ -2,9 +2,9 @@
2
2
  "use strict";
3
3
  var e, t, s, l, r, o, a = {
4
4
  8179 (e, t, s) {
5
- var l = s(1627);
5
+ var l = s(7080);
6
6
  let r = "__rstest_dispatch_response__", o = "runner";
7
- var a = s(1975), i = s(7221), n = s(998), c = s(1979), d = s(725);
7
+ var a = s(1472), i = s(1488), n = s(1609), c = s(7348), d = s(2303);
8
8
  let u = (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 p = s(5492), h = s(6537), f = s(2025), x = s(1888), m = s(5076);
18
+ var p = s(7533), h = s(7460), f = s(8376), x = s(2419), m = s(3333);
19
19
  let g = (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 v = s(4286), y = s(6342), _ = s(360), C = s(6684), w = s(7375);
35
+ var v = s(4713), y = s(7905), _ = s(2315), C = s(971), w = s(4618);
36
36
  let b = {
37
37
  idle: {
38
38
  label: "Idle",
@@ -78,7 +78,7 @@
78
78
  })
79
79
  }
80
80
  };
81
- var S = s(6589), F = s(6547), N = s(9825), A = s(7477), P = s(5002), M = s(2719), z = s(9582), O = s(36);
81
+ var S = s(7050), F = s(9975), N = s(6206), A = s(2830), P = s(2927), M = s(9492), z = s(2553), O = s(7677);
82
82
  let R = {
83
83
  iPhoneSE: {
84
84
  width: 375,
@@ -514,7 +514,7 @@
514
514
  ]
515
515
  });
516
516
  };
517
- var G = s(9510);
517
+ var G = s(1568);
518
518
  let Z = (e)=>{
519
519
  let { className: t, style: s, direction: r = "horizontal", children: o, autoSaveId: a, ...i } = e, n = c.Children.toArray(o).filter((e)=>c.isValidElement(e) && e.type === L), d = c.useCallback(()=>{
520
520
  if (!a) return null;
@@ -567,7 +567,7 @@
567
567
  children: t
568
568
  });
569
569
  };
570
- var q = s(4395), H = s(1407), J = s(208);
570
+ var q = s(1896), H = s(354), J = s(5779);
571
571
  let V = (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 K = s(3230), Y = s(8021), Q = s(6646), ee = s(4797), et = s(7367), es = s(7239);
1588
+ var K = s(5701), Y = s(796), Q = s(443), ee = s(2612), et = s(2912), es = s(2907);
1589
1589
  let el = (0, c.memo)((e)=>{
1590
1590
  let { counts: t, isRunning: s } = e, r = s && 0 === t.running;
1591
1591
  return (0, l.jsx)("div", {
@@ -1725,7 +1725,7 @@
1725
1725
  ]
1726
1726
  });
1727
1727
  };
1728
- var eo = s(5574), ea = s(815), ei = s(9085), en = s(7557), ec = s(8285);
1728
+ var eo = s(2880), ea = s(9211), ei = s(4768), en = s(1146), ec = s(9384);
1729
1729
  let ed = [
1730
1730
  "pass",
1731
1731
  "fail",
@@ -3069,7 +3069,7 @@
3069
3069
  }, (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));
3070
3070
  var c = n.O(void 0, [
3071
3071
  "783",
3072
- "102"
3072
+ "188"
3073
3073
  ], ()=>n(8179));
3074
3074
  c = n.O(c);
3075
3075
  })();
@@ -1,12 +1,12 @@
1
- /*! LICENSE: lib-react.9e703e1b29.js.LICENSE.txt */
2
- /*! LICENSE: lib-react.9e703e1b29.js.LICENSE.txt */ "use strict";
1
+ /*! LICENSE: lib-react.5ae9b90ee5.js.LICENSE.txt */
2
+ /*! LICENSE: lib-react.5ae9b90ee5.js.LICENSE.txt */ "use strict";
3
3
  (self.rspackChunk_rstest_browser_ui = self.rspackChunk_rstest_browser_ui || []).push([
4
4
  [
5
5
  783
6
6
  ],
7
7
  {
8
- 530 (e, t, n) {
9
- var r, l = n(1099), a = n(1979), o = n(7708);
8
+ 1044 (e, t, n) {
9
+ var r, l = n(1099), a = n(7348), o = n(5542);
10
10
  function i(e) {
11
11
  var t = "https://react.dev/errors/" + e;
12
12
  if (1 < arguments.length) {
@@ -561,7 +561,7 @@
561
561
  for(var l = 0; l < n.length; l++)t["$" + n[l]] = !0;
562
562
  for(n = 0; n < e.length; n++)l = t.hasOwnProperty("$" + e[n].value), e[n].selected !== l && (e[n].selected = l), l && r && (e[n].defaultSelected = !0);
563
563
  } else {
564
- for(l = 0, n = "" + e8(n), t = null; l < e.length; l++){
564
+ for(n = "" + e8(n), t = null, l = 0; l < e.length; l++){
565
565
  if (e[l].value === n) {
566
566
  e[l].selected = !0, r && (e[l].defaultSelected = !0);
567
567
  return;
@@ -3430,7 +3430,7 @@
3430
3430
  }), "hidden" === r.mode) {
3431
3431
  if (0 != (128 & t.flags)) {
3432
3432
  if (a = null !== a ? a.baseLanes | n : n, null !== e) {
3433
- for(l = 0, r = t.child = e.child; null !== r;)l = l | r.lanes | r.childLanes, r = r.sibling;
3433
+ for(r = t.child = e.child, l = 0; null !== r;)l = l | r.lanes | r.childLanes, r = r.sibling;
3434
3434
  r = l & ~a;
3435
3435
  } else r = 0, t.child = null;
3436
3436
  return o_(e, t, a, n, r);
@@ -3628,7 +3628,7 @@
3628
3628
  }
3629
3629
  switch(l){
3630
3630
  case "forwards":
3631
- for(l = null, n = t.child; null !== n;)null !== (e = n.alternate) && null === lW(e) && (l = n), n = n.sibling;
3631
+ for(n = t.child, l = null; null !== n;)null !== (e = n.alternate) && null === lW(e) && (l = n), n = n.sibling;
3632
3632
  null === (n = l) ? (l = t.child, t.child = null) : (l = n.sibling, n.sibling = null), oH(t, !1, l, n, a, r);
3633
3633
  break;
3634
3634
  case "backwards":
@@ -7719,7 +7719,7 @@
7719
7719
  }
7720
7720
  };
7721
7721
  var cA = a.version;
7722
- if ("19.2.5" !== cA) throw Error(i(527, cA, "19.2.5"));
7722
+ if ("19.2.6" !== cA) throw Error(i(527, cA, "19.2.6"));
7723
7723
  if (D.findDOMNode = function(e) {
7724
7724
  var t = e._reactInternals;
7725
7725
  if (void 0 === t) {
@@ -7797,10 +7797,10 @@
7797
7797
  if (!cM.isDisabled && cM.supportsFiber) try {
7798
7798
  ed = cM.inject({
7799
7799
  bundleType: 0,
7800
- version: "19.2.5",
7800
+ version: "19.2.6",
7801
7801
  rendererPackageName: "react-dom",
7802
7802
  currentDispatcherRef: O,
7803
- reconcilerVersion: "19.2.5"
7803
+ reconcilerVersion: "19.2.6"
7804
7804
  }), ep = cM;
7805
7805
  } catch (e) {}
7806
7806
  }
@@ -7814,8 +7814,8 @@
7814
7814
  }, lS(o), t = r, e[eM] = t.current, u7(e), new cF(t);
7815
7815
  };
7816
7816
  },
7817
- 7850 (e, t, n) {
7818
- var r = n(1979);
7817
+ 1816 (e, t, n) {
7818
+ var r = n(7348);
7819
7819
  function l(e) {
7820
7820
  var t = "https://react.dev/errors/" + e;
7821
7821
  if (1 < arguments.length) {
@@ -7926,27 +7926,27 @@
7926
7926
  return u.H.useFormState(e, t, n);
7927
7927
  }, t.useFormStatus = function() {
7928
7928
  return u.H.useHostTransitionStatus();
7929
- }, t.version = "19.2.5";
7929
+ }, t.version = "19.2.6";
7930
7930
  },
7931
- 725 (e, t, n) {
7931
+ 2303 (e, t, n) {
7932
7932
  (function e() {
7933
7933
  if ("u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE) try {
7934
7934
  __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
7935
7935
  } catch (e) {
7936
7936
  console.error(e);
7937
7937
  }
7938
- })(), e.exports = n(530);
7938
+ })(), e.exports = n(1044);
7939
7939
  },
7940
- 7708 (e, t, n) {
7940
+ 5542 (e, t, n) {
7941
7941
  (function e() {
7942
7942
  if ("u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE) try {
7943
7943
  __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
7944
7944
  } catch (e) {
7945
7945
  console.error(e);
7946
7946
  }
7947
- })(), e.exports = n(7850);
7947
+ })(), e.exports = n(1816);
7948
7948
  },
7949
- 2055 (e, t) {
7949
+ 810 (e, t) {
7950
7950
  var n = Symbol.for("react.transitional.element");
7951
7951
  function r(e, t, r) {
7952
7952
  var l = null;
@@ -7962,7 +7962,7 @@
7962
7962
  }
7963
7963
  t.Fragment = Symbol.for("react.fragment"), t.jsx = r, t.jsxs = r;
7964
7964
  },
7965
- 808 (e, t) {
7965
+ 6773 (e, t) {
7966
7966
  var n = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), i = Symbol.for("react.consumer"), u = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), f = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), p = Symbol.for("react.activity"), m = Symbol.iterator, h = {
7967
7967
  isMounted: function() {
7968
7968
  return !1;
@@ -8240,13 +8240,13 @@
8240
8240
  return E.H.useSyncExternalStore(e, t, n);
8241
8241
  }, t.useTransition = function() {
8242
8242
  return E.H.useTransition();
8243
- }, t.version = "19.2.5";
8243
+ }, t.version = "19.2.6";
8244
8244
  },
8245
- 1979 (e, t, n) {
8246
- e.exports = n(808);
8245
+ 7348 (e, t, n) {
8246
+ e.exports = n(6773);
8247
8247
  },
8248
- 1627 (e, t, n) {
8249
- e.exports = n(2055);
8248
+ 7080 (e, t, n) {
8249
+ e.exports = n(810);
8250
8250
  },
8251
8251
  7146 (e, t) {
8252
8252
  function n(e, t) {
@@ -0,0 +1 @@
1
+ /*! LICENSE: lib-react.5ae9b90ee5.js.LICENSE.txt */
@@ -12,7 +12,7 @@
12
12
  <script>
13
13
  window.__RSTEST_BROWSER_OPTIONS__ = __RSTEST_OPTIONS_PLACEHOLDER__;
14
14
  </script>
15
- <script defer src="/container-static/js/lib-react.9e703e1b29.js"></script><script defer src="/container-static/js/102.e63e4aa16d.js"></script><script defer src="/container-static/js/index.af52585634.js"></script><link href="/container-static/css/index.5c72297783.css" rel="stylesheet"></head>
15
+ <script defer src="/container-static/js/lib-react.5ae9b90ee5.js"></script><script defer src="/container-static/js/188.480c3c49b5.js"></script><script defer src="/container-static/js/index.29fc60be33.js"></script><link href="/container-static/css/index.5c72297783.css" rel="stylesheet"></head>
16
16
  <body>
17
17
  <div id="root"></div>
18
18
  </body>
package/dist/browser.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import './augmentExpect';
2
- export * from './client/api';
1
+ import './augmentExpect.js';
2
+ export * from './client/api.js';
@@ -1,3 +1,3 @@
1
- import { Locator, page, setTestIdAttribute } from './locator';
2
- export type { BrowserPage, BrowserSerializable, LocatorBlurOptions, LocatorCheckOptions, LocatorClickOptions, LocatorDblclickOptions, LocatorDispatchEventInit, LocatorFillOptions, LocatorFilterOptions, LocatorFocusOptions, LocatorGetByRoleOptions, LocatorHoverOptions, LocatorKeyboardModifier, LocatorMouseButton, LocatorPosition, LocatorPressOptions, LocatorScrollIntoViewIfNeededOptions, LocatorSelectOptionOptions, LocatorSetInputFilesOptions, LocatorTextOptions, LocatorWaitForOptions, } from './locator';
1
+ import { Locator, page, setTestIdAttribute } from './locator.js';
2
+ export type { BrowserPage, BrowserSerializable, LocatorBlurOptions, LocatorCheckOptions, LocatorClickOptions, LocatorDblclickOptions, LocatorDispatchEventInit, LocatorFillOptions, LocatorFilterOptions, LocatorFocusOptions, LocatorGetByRoleOptions, LocatorHoverOptions, LocatorKeyboardModifier, LocatorMouseButton, LocatorPosition, LocatorPressOptions, LocatorScrollIntoViewIfNeededOptions, LocatorSelectOptionOptions, LocatorSetInputFilesOptions, LocatorTextOptions, LocatorWaitForOptions, } from './locator.js';
3
3
  export { Locator, page, setTestIdAttribute };
@@ -1,2 +1,2 @@
1
- import type { BrowserRpcRequest } from '../rpcProtocol';
2
- export declare const callBrowserRpc: <T>(payload: Omit<BrowserRpcRequest, "id" | "testPath" | "runId">) => Promise<T>;
1
+ import type { BrowserRpcRequest } from '../rpcProtocol.js';
2
+ export declare const callBrowserRpc: <T>(payload: Omit<BrowserRpcRequest, 'id' | 'testPath' | 'runId'>) => Promise<T>;
@@ -1,4 +1,4 @@
1
- import type { BrowserDispatchRequest } from '../protocol';
1
+ import type { BrowserDispatchRequest } from '../protocol.js';
2
2
  export declare const getRpcTimeout: () => number;
3
3
  export declare const createRequestId: (prefix: string) => string;
4
4
  export declare const dispatchRpc: <T>({ requestId, request, timeoutMs, timeoutMessage, staleMessage, }: {
@@ -1,4 +1,4 @@
1
- import type { BrowserLocatorIR, BrowserLocatorText } from '../rpcProtocol';
1
+ import type { BrowserLocatorIR, BrowserLocatorText } from '../rpcProtocol.js';
2
2
  export declare const serializeText: (value: string | RegExp) => BrowserLocatorText;
3
3
  export type LocatorGetByRoleOptions = {
4
4
  name?: string | RegExp;
@@ -110,7 +110,7 @@ export declare class Locator {
110
110
  setInputFiles(files: string | string[], options?: LocatorSetInputFilesOptions): Promise<void>;
111
111
  private callLocator;
112
112
  }
113
- declare const browserPageQueryMethods: readonly ["locator", "getByRole", "getByText", "getByLabel", "getByPlaceholder", "getByAltText", "getByTitle", "getByTestId"];
113
+ declare const browserPageQueryMethods: readonly ['locator', 'getByRole', 'getByText', 'getByLabel', 'getByPlaceholder', 'getByAltText', 'getByTitle', 'getByTestId'];
114
114
  type BrowserPageQueryMethod = (typeof browserPageQueryMethods)[number];
115
115
  export type BrowserPage = Pick<Locator, BrowserPageQueryMethod>;
116
116
  export declare const page: BrowserPage;
@@ -7,6 +7,6 @@ type HeadlessConcurrencyContext = Pick<Rstest, 'command'> & {
7
7
  };
8
8
  };
9
9
  export declare const parseWorkers: (maxWorkers: string | number, numCpus?: number) => number;
10
- export declare const resolveDefaultHeadlessWorkers: (command: HeadlessConcurrencyContext["command"], numCpus?: number) => number;
10
+ export declare const resolveDefaultHeadlessWorkers: (command: HeadlessConcurrencyContext['command'], numCpus?: number) => number;
11
11
  export declare const getHeadlessConcurrency: (context: HeadlessConcurrencyContext, totalTests: number) => number;
12
12
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { Reporter } from '@rstest/core/browser';
2
- import { HostDispatchRouter } from './dispatchRouter';
3
- import type { BrowserClientMessage, BrowserDispatchHandler, SnapshotRpcRequest } from './protocol';
2
+ import { HostDispatchRouter } from './dispatchRouter.js';
3
+ import type { BrowserClientMessage, BrowserDispatchHandler, SnapshotRpcRequest } from './protocol.js';
4
4
  export type HostDispatchRouterOptions = ConstructorParameters<typeof HostDispatchRouter>[0];
5
5
  type RunnerPayload<TType extends BrowserClientMessage['type']> = Extract<BrowserClientMessage, {
6
6
  type: TType;
@@ -1,4 +1,4 @@
1
- import type { BrowserDispatchRequest, BrowserDispatchResponse } from './protocol';
1
+ import type { BrowserDispatchRequest, BrowserDispatchResponse } from './protocol.js';
2
2
  type DispatchHandler = (request: BrowserDispatchRequest) => Promise<unknown>;
3
3
  type HostDispatchRouterOptions = {
4
4
  isRunTokenStale?: (runToken: number) => boolean;
@@ -1,5 +1,5 @@
1
- import type { BrowserClientMessage, BrowserDispatchRequest, BrowserDispatchResponse } from './protocol';
2
- import type { BrowserProviderPage } from './providers';
1
+ import type { BrowserClientMessage, BrowserDispatchRequest, BrowserDispatchResponse } from './protocol.js';
2
+ import type { BrowserProviderPage } from './providers/index.js';
3
3
  type HeadlessRunnerTransportHandlers = {
4
4
  onDispatchMessage: (message: BrowserClientMessage) => Promise<void>;
5
5
  onDispatchRpc: (request: BrowserDispatchRequest) => Promise<BrowserDispatchResponse>;
@@ -16,14 +16,14 @@ type BrowserLazyCompilationConfig = {
16
16
  * `httpServer.address()` to obtain the real bound port.
17
17
  */
18
18
  export declare const resolveListenPort: (listenPort: number, httpServer: {
19
- address: () => ReturnType<import("node:net").Server["address"]>;
19
+ address: () => ReturnType<import('node:net').Server['address']>;
20
20
  } | null) => number;
21
21
  export declare const createBrowserLazyCompilationConfig: (setupFiles: string[]) => BrowserLazyCompilationConfig;
22
22
  export declare const createBrowserRsbuildDevConfig: (_isWatchMode: boolean) => {
23
23
  writeToDisk: boolean;
24
24
  hmr: boolean;
25
25
  client: {
26
- logLevel: "error";
26
+ logLevel: 'error';
27
27
  };
28
28
  };
29
29
  export declare const runBrowserController: (context: Rstest, options?: BrowserTestRunOptions) => Promise<BrowserTestRunResult | void>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { BrowserTestRunOptions, BrowserTestRunResult, Rstest } from '@rstest/core/browser';
2
- import { type ListBrowserTestsResult } from './hostController';
3
- export { validateBrowserConfig } from './configValidation';
4
- export { BROWSER_VIEWPORT_PRESET_DIMENSIONS, BROWSER_VIEWPORT_PRESET_IDS, resolveBrowserViewportPreset, } from './viewportPresets';
2
+ import { type ListBrowserTestsResult } from './hostController.js';
3
+ export { validateBrowserConfig } from './configValidation.js';
4
+ export { BROWSER_VIEWPORT_PRESET_DIMENSIONS, BROWSER_VIEWPORT_PRESET_IDS, resolveBrowserViewportPreset, } from './viewportPresets.js';
5
5
  export declare function runBrowserTests(context: Rstest, options?: BrowserTestRunOptions): Promise<BrowserTestRunResult | void>;
6
6
  export declare function listBrowserTests(context: Rstest): Promise<ListBrowserTestsResult>;
7
7
  export type { BrowserTestRunOptions, BrowserTestRunResult, ListBrowserTestsResult, };