@unotest/web 0.54.0 → 0.55.0

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.
@@ -1,5 +1,5 @@
1
- import { L as LocatorValue, j as DriverPage, r as DriverDownload, D as DriverContext, W as WebDriver } from '../interfaces-BU-PQbt4.js';
2
- export { s as LocatorStep, t as appendStep, u as describeLocator, v as isLocatorValue, w as rootedAt } from '../interfaces-BU-PQbt4.js';
1
+ import { L as LocatorValue, j as DriverPage, r as DriverDownload, D as DriverContext, b as PageNetworkEntry, W as WebDriver } from '../interfaces-CNvyInrY.js';
2
+ export { s as LocatorStep, t as appendStep, u as describeLocator, v as isLocatorValue, w as rootedAt } from '../interfaces-CNvyInrY.js';
3
3
  import { Matcher, RegexLiteral, JudgeRequest, JudgeVerdict, VisualFailureRecord, SoftFailureRecord, TeardownStateRecord, TeardownFailureRecord } from '@unotest/protocol';
4
4
  import { Browser, SandboxConfig } from '../config/schema.js';
5
5
  import { UnotestError, RuntimeExecState } from '@unotest/core';
@@ -534,6 +534,17 @@ declare class BindableBudgetClock implements BudgetClock {
534
534
  };
535
535
  }
536
536
 
537
+ declare class ResponseWindow {
538
+ private actionAt;
539
+ private readonly taken;
540
+ /** A call that acts on the page starts at `at` (epoch ms). */
541
+ markAction(at: number): void;
542
+ /** When the last page action started; 0 before the first. */
543
+ lastActionAt(): number;
544
+ take(entry: PageNetworkEntry): void;
545
+ isTaken(entry: PageNetworkEntry): boolean;
546
+ }
547
+
537
548
  type KeyModifier = 'Shift' | 'Control' | 'Alt' | 'Meta';
538
549
  declare const NAMED_KEYS: readonly ["Enter", "Tab", "Space", "Backspace", "Escape", "Delete", "Home", "End", "PageUp", "PageDown", "ArrowLeft", "ArrowRight", "ArrowDown", "ArrowUp", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"];
539
550
  type NamedKey = (typeof NAMED_KEYS)[number];
@@ -1034,6 +1045,8 @@ declare class TestRuntime {
1034
1045
  /** What is left of the test's time; the executor binds it for the run.
1035
1046
  * Unbound (explore, bare runtimes) there is no budget to wait within. */
1036
1047
  readonly budget: BindableBudgetClock;
1048
+ /** The window and cursor of `waitForResponse`. */
1049
+ readonly responses: ResponseWindow;
1037
1050
  readonly annotations?: AnnotationSink;
1038
1051
  readonly stepNotes?: StepNotesReader;
1039
1052
  readonly visual?: VisualAssertDeps;
@@ -1318,6 +1331,10 @@ interface DslFunction {
1318
1331
  returnType: DslReturnType;
1319
1332
  /** Some functions tolerate a trailing optional arg (e.g. waitFor timeoutMs). */
1320
1333
  minArgs?: number;
1334
+ /** The call acts on the page and may make it send a request (a click,
1335
+ * a goto, an evaluate). `waitForResponse` takes responses from the start
1336
+ * of the last such call; a read, an assertion or a wait moves nothing. */
1337
+ pageAction?: true;
1321
1338
  /**
1322
1339
  * Implementation. The runtime is passed first; args follow in declaration
1323
1340
  * order. May return a primitive, a LocatorValue, an object, or a Promise of