@opensteer/engine-playwright 0.8.2 → 0.8.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/dist/index.d.cts CHANGED
@@ -378,6 +378,27 @@ interface BrowserCapabilities {
378
378
  };
379
379
  }
380
380
 
381
+ interface PostLoadTrackerSnapshot {
382
+ readonly lastTrackedNetworkActivityAt: number;
383
+ readonly trackedPendingFetches: number;
384
+ readonly trackedPendingXhrs: number;
385
+ }
386
+
387
+ interface ActionBoundarySnapshot {
388
+ readonly pageRef: PageRef;
389
+ readonly documentRef: DocumentRef;
390
+ readonly url?: string;
391
+ readonly tracker?: PostLoadTrackerSnapshot;
392
+ }
393
+ type ActionBoundarySettleTrigger = "dom-action" | "navigation";
394
+ type ActionBoundaryTimedOutPhase = "bootstrap";
395
+ interface ActionBoundaryOutcome {
396
+ readonly trigger: ActionBoundarySettleTrigger;
397
+ readonly crossDocument: boolean;
398
+ readonly bootstrapSettled: boolean;
399
+ readonly timedOutPhase?: ActionBoundaryTimedOutPhase;
400
+ }
401
+
381
402
  type ConsoleLevel = "debug" | "log" | "info" | "warn" | "error" | "trace";
382
403
  interface StepEventBase {
383
404
  readonly eventId: string;
@@ -675,6 +696,9 @@ interface BrowserExecutor {
675
696
  }
676
697
  interface BrowserInspector {
677
698
  readonly capabilities: Readonly<BrowserCapabilities>;
699
+ drainEvents(input: {
700
+ readonly pageRef: PageRef;
701
+ }): Promise<readonly StepEvent[]>;
678
702
  listPages(input: {
679
703
  readonly sessionRef: SessionRef;
680
704
  }): Promise<readonly PageInfo[]>;
@@ -695,12 +719,22 @@ interface BrowserInspector {
695
719
  readonly frameRef?: FrameRef;
696
720
  readonly documentRef?: DocumentRef;
697
721
  }): Promise<DomSnapshot>;
722
+ getActionBoundarySnapshot(input: {
723
+ readonly pageRef: PageRef;
724
+ }): Promise<ActionBoundarySnapshot>;
698
725
  waitForVisualStability(input: {
699
726
  readonly pageRef: PageRef;
700
727
  readonly timeoutMs?: number;
701
728
  readonly settleMs?: number;
702
729
  readonly scope?: VisualStabilityScope;
703
730
  }): Promise<void>;
731
+ waitForPostLoadQuiet(input: {
732
+ readonly pageRef: PageRef;
733
+ readonly timeoutMs?: number;
734
+ readonly quietMs?: number;
735
+ readonly captureWindowMs?: number;
736
+ readonly signal?: AbortSignal;
737
+ }): Promise<void>;
704
738
  readText(input: NodeLocator): Promise<string | null>;
705
739
  readAttributes(input: NodeLocator): Promise<readonly {
706
740
  readonly name: string;
@@ -753,19 +787,6 @@ interface BrowserInstrumentation {
753
787
  interface BrowserCoreEngine extends BrowserExecutor, BrowserInspector, SessionTransportExecutor, BrowserInstrumentation {
754
788
  }
755
789
 
756
- interface ActionBoundarySnapshot {
757
- readonly pageRef: PageRef;
758
- readonly documentRef: DocumentRef;
759
- }
760
- type ActionBoundarySettleTrigger = "dom-action" | "navigation";
761
- type ActionBoundaryTimedOutPhase = "bootstrap";
762
- interface ActionBoundaryOutcome {
763
- readonly trigger: ActionBoundarySettleTrigger;
764
- readonly crossDocument: boolean;
765
- readonly bootstrapSettled: boolean;
766
- readonly timedOutPhase?: ActionBoundaryTimedOutPhase;
767
- }
768
-
769
790
  declare const opensteerComputerAnnotationNames: readonly ["clickable", "typeable", "scrollable", "grid", "selected"];
770
791
  type OpensteerComputerAnnotation = (typeof opensteerComputerAnnotationNames)[number];
771
792
  type OpensteerComputerMouseButton = "left" | "middle" | "right";
@@ -1099,6 +1120,9 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1099
1120
  listPages(input: {
1100
1121
  readonly sessionRef: SessionRef;
1101
1122
  }): Promise<readonly PageInfo[]>;
1123
+ drainEvents(input: {
1124
+ readonly pageRef: PageRef;
1125
+ }): Promise<readonly StepEvent[]>;
1102
1126
  listFrames(input: {
1103
1127
  readonly pageRef: PageRef;
1104
1128
  }): Promise<readonly FrameInfo[]>;
@@ -1116,12 +1140,22 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1116
1140
  readonly frameRef?: FrameRef;
1117
1141
  readonly documentRef?: DocumentRef;
1118
1142
  }): Promise<DomSnapshot>;
1143
+ getActionBoundarySnapshot(input: {
1144
+ readonly pageRef: PageRef;
1145
+ }): Promise<ActionBoundarySnapshot>;
1119
1146
  waitForVisualStability(input: {
1120
1147
  readonly pageRef: PageRef;
1121
1148
  readonly timeoutMs?: number;
1122
1149
  readonly settleMs?: number;
1123
1150
  readonly scope?: "main-frame" | "visible-frames";
1124
1151
  }): Promise<void>;
1152
+ waitForPostLoadQuiet(input: {
1153
+ readonly pageRef: PageRef;
1154
+ readonly timeoutMs?: number;
1155
+ readonly quietMs?: number;
1156
+ readonly captureWindowMs?: number;
1157
+ readonly signal?: AbortSignal;
1158
+ }): Promise<void>;
1125
1159
  readText(input: NodeLocator): Promise<string | null>;
1126
1160
  readAttributes(input: NodeLocator): Promise<readonly {
1127
1161
  readonly name: string;
@@ -1172,14 +1206,15 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1172
1206
  private handleFrameNavigated;
1173
1207
  private handleNavigatedWithinDocument;
1174
1208
  private handleDocumentUpdated;
1209
+ private handlePageDomContentLoaded;
1175
1210
  private syncFrameTree;
1176
1211
  private refreshFrameBindings;
1177
1212
  private bindPlaywrightFrames;
1178
- private handleConsole;
1213
+ private handleRuntimeConsole;
1179
1214
  private handleDialog;
1180
1215
  private handleDownload;
1181
1216
  private handleFileChooserOpened;
1182
- private handlePageError;
1217
+ private handleRuntimeException;
1183
1218
  private handleUnexpectedPageClose;
1184
1219
  private handleNetworkRequestWillBeSent;
1185
1220
  private handlePlaywrightRequest;
@@ -1222,6 +1257,8 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1222
1257
  private throwBackgroundError;
1223
1258
  private createEvent;
1224
1259
  private queueEvent;
1260
+ private installRuntimeEventRecorder;
1261
+ private drainInstrumentedRuntimeEvents;
1225
1262
  private drainQueuedEvents;
1226
1263
  private createStepResult;
1227
1264
  private withModifiers;
package/dist/index.d.ts CHANGED
@@ -378,6 +378,27 @@ interface BrowserCapabilities {
378
378
  };
379
379
  }
380
380
 
381
+ interface PostLoadTrackerSnapshot {
382
+ readonly lastTrackedNetworkActivityAt: number;
383
+ readonly trackedPendingFetches: number;
384
+ readonly trackedPendingXhrs: number;
385
+ }
386
+
387
+ interface ActionBoundarySnapshot {
388
+ readonly pageRef: PageRef;
389
+ readonly documentRef: DocumentRef;
390
+ readonly url?: string;
391
+ readonly tracker?: PostLoadTrackerSnapshot;
392
+ }
393
+ type ActionBoundarySettleTrigger = "dom-action" | "navigation";
394
+ type ActionBoundaryTimedOutPhase = "bootstrap";
395
+ interface ActionBoundaryOutcome {
396
+ readonly trigger: ActionBoundarySettleTrigger;
397
+ readonly crossDocument: boolean;
398
+ readonly bootstrapSettled: boolean;
399
+ readonly timedOutPhase?: ActionBoundaryTimedOutPhase;
400
+ }
401
+
381
402
  type ConsoleLevel = "debug" | "log" | "info" | "warn" | "error" | "trace";
382
403
  interface StepEventBase {
383
404
  readonly eventId: string;
@@ -675,6 +696,9 @@ interface BrowserExecutor {
675
696
  }
676
697
  interface BrowserInspector {
677
698
  readonly capabilities: Readonly<BrowserCapabilities>;
699
+ drainEvents(input: {
700
+ readonly pageRef: PageRef;
701
+ }): Promise<readonly StepEvent[]>;
678
702
  listPages(input: {
679
703
  readonly sessionRef: SessionRef;
680
704
  }): Promise<readonly PageInfo[]>;
@@ -695,12 +719,22 @@ interface BrowserInspector {
695
719
  readonly frameRef?: FrameRef;
696
720
  readonly documentRef?: DocumentRef;
697
721
  }): Promise<DomSnapshot>;
722
+ getActionBoundarySnapshot(input: {
723
+ readonly pageRef: PageRef;
724
+ }): Promise<ActionBoundarySnapshot>;
698
725
  waitForVisualStability(input: {
699
726
  readonly pageRef: PageRef;
700
727
  readonly timeoutMs?: number;
701
728
  readonly settleMs?: number;
702
729
  readonly scope?: VisualStabilityScope;
703
730
  }): Promise<void>;
731
+ waitForPostLoadQuiet(input: {
732
+ readonly pageRef: PageRef;
733
+ readonly timeoutMs?: number;
734
+ readonly quietMs?: number;
735
+ readonly captureWindowMs?: number;
736
+ readonly signal?: AbortSignal;
737
+ }): Promise<void>;
704
738
  readText(input: NodeLocator): Promise<string | null>;
705
739
  readAttributes(input: NodeLocator): Promise<readonly {
706
740
  readonly name: string;
@@ -753,19 +787,6 @@ interface BrowserInstrumentation {
753
787
  interface BrowserCoreEngine extends BrowserExecutor, BrowserInspector, SessionTransportExecutor, BrowserInstrumentation {
754
788
  }
755
789
 
756
- interface ActionBoundarySnapshot {
757
- readonly pageRef: PageRef;
758
- readonly documentRef: DocumentRef;
759
- }
760
- type ActionBoundarySettleTrigger = "dom-action" | "navigation";
761
- type ActionBoundaryTimedOutPhase = "bootstrap";
762
- interface ActionBoundaryOutcome {
763
- readonly trigger: ActionBoundarySettleTrigger;
764
- readonly crossDocument: boolean;
765
- readonly bootstrapSettled: boolean;
766
- readonly timedOutPhase?: ActionBoundaryTimedOutPhase;
767
- }
768
-
769
790
  declare const opensteerComputerAnnotationNames: readonly ["clickable", "typeable", "scrollable", "grid", "selected"];
770
791
  type OpensteerComputerAnnotation = (typeof opensteerComputerAnnotationNames)[number];
771
792
  type OpensteerComputerMouseButton = "left" | "middle" | "right";
@@ -1099,6 +1120,9 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1099
1120
  listPages(input: {
1100
1121
  readonly sessionRef: SessionRef;
1101
1122
  }): Promise<readonly PageInfo[]>;
1123
+ drainEvents(input: {
1124
+ readonly pageRef: PageRef;
1125
+ }): Promise<readonly StepEvent[]>;
1102
1126
  listFrames(input: {
1103
1127
  readonly pageRef: PageRef;
1104
1128
  }): Promise<readonly FrameInfo[]>;
@@ -1116,12 +1140,22 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1116
1140
  readonly frameRef?: FrameRef;
1117
1141
  readonly documentRef?: DocumentRef;
1118
1142
  }): Promise<DomSnapshot>;
1143
+ getActionBoundarySnapshot(input: {
1144
+ readonly pageRef: PageRef;
1145
+ }): Promise<ActionBoundarySnapshot>;
1119
1146
  waitForVisualStability(input: {
1120
1147
  readonly pageRef: PageRef;
1121
1148
  readonly timeoutMs?: number;
1122
1149
  readonly settleMs?: number;
1123
1150
  readonly scope?: "main-frame" | "visible-frames";
1124
1151
  }): Promise<void>;
1152
+ waitForPostLoadQuiet(input: {
1153
+ readonly pageRef: PageRef;
1154
+ readonly timeoutMs?: number;
1155
+ readonly quietMs?: number;
1156
+ readonly captureWindowMs?: number;
1157
+ readonly signal?: AbortSignal;
1158
+ }): Promise<void>;
1125
1159
  readText(input: NodeLocator): Promise<string | null>;
1126
1160
  readAttributes(input: NodeLocator): Promise<readonly {
1127
1161
  readonly name: string;
@@ -1172,14 +1206,15 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1172
1206
  private handleFrameNavigated;
1173
1207
  private handleNavigatedWithinDocument;
1174
1208
  private handleDocumentUpdated;
1209
+ private handlePageDomContentLoaded;
1175
1210
  private syncFrameTree;
1176
1211
  private refreshFrameBindings;
1177
1212
  private bindPlaywrightFrames;
1178
- private handleConsole;
1213
+ private handleRuntimeConsole;
1179
1214
  private handleDialog;
1180
1215
  private handleDownload;
1181
1216
  private handleFileChooserOpened;
1182
- private handlePageError;
1217
+ private handleRuntimeException;
1183
1218
  private handleUnexpectedPageClose;
1184
1219
  private handleNetworkRequestWillBeSent;
1185
1220
  private handlePlaywrightRequest;
@@ -1222,6 +1257,8 @@ declare class PlaywrightBrowserCoreEngine implements BrowserCoreEngine {
1222
1257
  private throwBackgroundError;
1223
1258
  private createEvent;
1224
1259
  private queueEvent;
1260
+ private installRuntimeEventRecorder;
1261
+ private drainInstrumentedRuntimeEvents;
1225
1262
  private drainQueuedEvents;
1226
1263
  private createStepResult;
1227
1264
  private withModifiers;