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