@dev-blinq/bvt-playwright-js 1.0.0-dev.4.staging.146.1 → 1.0.0-dev.4.staging.166.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.
package/index.d.mts CHANGED
@@ -277,6 +277,7 @@ declare const elementAssertionSchema: z.ZodDiscriminatedUnion<[
277
277
  type: z.ZodLiteral<"toHaveProperty">;
278
278
  name: z.ZodString;
279
279
  operator: z.ZodOptional<z.ZodEnum<{
280
+ regex: "regex";
280
281
  equals: "equals";
281
282
  notEquals: "notEquals";
282
283
  contains: "contains";
@@ -2021,6 +2022,7 @@ declare const CommandSchema: z.ZodDiscriminatedUnion<[
2021
2022
  type: z.ZodLiteral<"toHaveProperty">;
2022
2023
  name: z.ZodString;
2023
2024
  operator: z.ZodOptional<z.ZodEnum<{
2025
+ regex: "regex";
2024
2026
  equals: "equals";
2025
2027
  notEquals: "notEquals";
2026
2028
  contains: "contains";
@@ -5031,6 +5033,7 @@ declare const StepDefinitionSchema: z.ZodObject<{
5031
5033
  type: z.ZodLiteral<"toHaveProperty">;
5032
5034
  name: z.ZodString;
5033
5035
  operator: z.ZodOptional<z.ZodEnum<{
5036
+ regex: "regex";
5034
5037
  equals: "equals";
5035
5038
  notEquals: "notEquals";
5036
5039
  contains: "contains";
@@ -7441,10 +7444,26 @@ type ExecutionStatusUpdateEventData = {
7441
7444
  result: ExecResult;
7442
7445
  resolvedChosenSelectorIndex?: number;
7443
7446
  recovery?: RecoveryMetadata;
7447
+ /**
7448
+ * Deterministic S3 keys for the before/after screenshots captured around
7449
+ * this command. Present only when screenshot capture is enabled for the
7450
+ * run; keys reflect the intended upload location (upload happens at the
7451
+ * end of the testcase).
7452
+ */
7453
+ screenshots?: {
7454
+ before?: string;
7455
+ after?: string;
7456
+ };
7444
7457
  } | RecoveryStatusEvent;
7445
7458
  type ExecutionCompletedEventData = {
7446
7459
  type: "execution_completed";
7447
7460
  result: ExecResult;
7461
+ /**
7462
+ * True when before/after command screenshots were captured and at least one
7463
+ * was successfully uploaded to S3 for this run. Forwarded by the client into
7464
+ * `reports.onFinishTestCase` so it persists onto the testcase document.
7465
+ */
7466
+ screenshotsAvailable?: boolean;
7448
7467
  };
7449
7468
  type ExecutionStartedEventData = {
7450
7469
  type: "execution_started";
@@ -9083,6 +9102,25 @@ type TraceUploadRequestInput = {
9083
9102
  testCaseId: string;
9084
9103
  projectId: string;
9085
9104
  };
9105
+ type ScreenshotUploadPhase = "before" | "after";
9106
+ type ScreenshotUploadFileDescriptor = {
9107
+ stepId: string;
9108
+ commandId: string;
9109
+ phase: ScreenshotUploadPhase;
9110
+ };
9111
+ type ScreenshotUploadRequestInput = {
9112
+ reportId: string;
9113
+ testCaseId: string;
9114
+ projectId: string;
9115
+ files: ScreenshotUploadFileDescriptor[];
9116
+ };
9117
+ type ScreenshotUploadTarget = {
9118
+ stepId: string;
9119
+ commandId: string;
9120
+ phase: ScreenshotUploadPhase; /** S3 object key the file will live at (deterministic convention). */
9121
+ key: string; /** Presigned PUT URL for uploading the screenshot. */
9122
+ url: string;
9123
+ };
9086
9124
  type ReplayOrchestratorResult = {
9087
9125
  classification: {
9088
9126
  label: string;
@@ -9098,6 +9136,9 @@ type TesterApiClient = {
9098
9136
  getPresignedUrlForTraceUpload: {
9099
9137
  query(input: TraceUploadRequestInput): Promise<string>;
9100
9138
  };
9139
+ getPresignedUrlsForScreenshotUpload: {
9140
+ query(input: ScreenshotUploadRequestInput): Promise<ScreenshotUploadTarget[]>;
9141
+ };
9101
9142
  };
9102
9143
  project: {
9103
9144
  getProjectSettings: {
@@ -9260,6 +9301,15 @@ type TesterSession = {
9260
9301
  token?: string;
9261
9302
  trace?: TesterTraceConfig;
9262
9303
  runWithAiRecovery?: boolean;
9304
+ /**
9305
+ * When enabled, a viewport JPEG is captured before and after every
9306
+ * command and the set is uploaded to S3 at the end of the testcase.
9307
+ * Off by default — capture adds latency to every command.
9308
+ */
9309
+ screenshots?: {
9310
+ enabled: boolean;
9311
+ };
9312
+ deterministicRecoveryMode?: "new-tour-maintenance";
9263
9313
  };
9264
9314
  type ExecuteStepsInput = {
9265
9315
  recorderSteps: {
@@ -9276,6 +9326,7 @@ type ExecuteStepsOptions = {
9276
9326
  onFinish?: () => Promise<void>;
9277
9327
  onError?: (error: Error) => Promise<void>;
9278
9328
  abortController?: AbortController;
9329
+ recoveryAbortController?: AbortController;
9279
9330
  };
9280
9331
  type GetAPIClient = (sessionToken: string) => TesterApiClient;
9281
9332
  declare class Tester {
@@ -9299,6 +9350,19 @@ declare class Tester {
9299
9350
  private sessionToken;
9300
9351
  private activeBrowserContext;
9301
9352
  private reportId;
9353
+ private tempPathForAssets;
9354
+ /**
9355
+ * Per-testcase log of before/after command screenshots captured on disk,
9356
+ * pending batch upload to S3 at the end of the run. Reset in onTestCaseStart.
9357
+ */
9358
+ private capturedScreenshots;
9359
+ /**
9360
+ * Per-testcase screenshot counters (reset in onTestCaseStart) used purely for
9361
+ * observability — how many commands were eligible for capture and how many
9362
+ * capture attempts failed. Upload counters are derived at upload time.
9363
+ */
9364
+ private screenshotCommandsConsidered;
9365
+ private screenshotCaptureFailures;
9302
9366
  constructor(getAPIClient?: GetAPIClient, observabilityOrOptions?: AgentObservabilityInput | TesterOptions, optionsArg?: TesterOptions);
9303
9367
  setContext(context: ResolutionContext): void;
9304
9368
  setStepTraceChunkCallbacks(callbacks: StepTraceChunkCallbacks | undefined): void;
@@ -9309,6 +9373,22 @@ declare class Tester {
9309
9373
  private summarizeErrorForExecutionLog;
9310
9374
  private summarizeSessionForExecutionLog;
9311
9375
  private getCommandText;
9376
+ private screenshotsEnabled;
9377
+ /**
9378
+ * Deterministic S3 key for a command screenshot. Must match the convention
9379
+ * used by the server's `getPresignedUrlsForScreenshotUpload` route so the
9380
+ * keys recorded on the command report point at the uploaded objects.
9381
+ */
9382
+ private buildScreenshotKey;
9383
+ private getScreenshotTempDir;
9384
+ /**
9385
+ * Captures a viewport JPEG of the active page for the given command/phase,
9386
+ * writes it to the per-testcase temp dir, and records it for later upload.
9387
+ * Best-effort: any failure (no page, screenshot error) is logged and yields
9388
+ * `undefined` so command execution is never affected.
9389
+ */
9390
+ private captureCommandScreenshot;
9391
+ private toScreenshotRefs;
9312
9392
  private onCommandStart;
9313
9393
  private onCommandPass;
9314
9394
  private onCommandFail;
@@ -9320,6 +9400,12 @@ declare class Tester {
9320
9400
  private isRunSession;
9321
9401
  private isRecordingReplaySession;
9322
9402
  private shouldAttemptAiRecovery;
9403
+ private isNewTourMaintenanceRecoverySession;
9404
+ private shouldUseNewTourMaintenanceRecovery;
9405
+ private inferNewTourGenderOption;
9406
+ private buildNewTourGenderRadioCommand;
9407
+ private buildNewTourGenderRepairPlan;
9408
+ private recoverNewTourMaintenanceGenderCommand;
9323
9409
  private isSupportedRepairContext;
9324
9410
  private shouldUploadTrace;
9325
9411
  private resolveTraceOutputPath;
@@ -9330,6 +9416,16 @@ declare class Tester {
9330
9416
  private wait;
9331
9417
  private uploadFile;
9332
9418
  private uploadTraceFile;
9419
+ private putFileWithRetries;
9420
+ private cleanupScreenshotTempDir;
9421
+ /**
9422
+ * Batch-uploads all command screenshots captured during the run to S3.
9423
+ * Fetches a presigned PUT URL per file in a single round-trip, then uploads
9424
+ * each with retries. Best-effort: returns true when at least one screenshot
9425
+ * was uploaded, false otherwise (or when there is nothing/no token). Always
9426
+ * cleans up the on-disk temp files. Never throws.
9427
+ */
9428
+ private uploadScreenshots;
9333
9429
  private onTestCaseFail;
9334
9430
  private isBrowserDerivedCommand;
9335
9431
  private buildFailureContext;