Skip to content

BatchRequestBuilder

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/screenshot-worker/test/helpers/batch-builder.ts

Builder for constructing test batch screenshot requests

Usage: const batch = new BatchRequestBuilder() .withProjectId('test-project') .withScreenshot({ url: 'http://localhost:3000', description: 'Test' }) .build();

Methods

MethodSignatureReturns
withProjectIdwithProjectId(projectId: string)this
withOrganizationIdwithOrganizationId(organizationId: string)this
withCapturedBywithCapturedBy(capturedBy: string)this
withNamewithName(name: string)this
withDescriptionwithDescription(description: string)this
withConfigwithConfig(config: Partial<BatchConfigDto>)this
withAuthwithAuth(auth: Partial<BatchAuthConfigDto>)this
withScreenshotwithScreenshot(screenshot: Partial<BatchScreenshotItemDto>)this
withScreenshotswithScreenshots(screenshots: Partial<BatchScreenshotItemDto>[])this
buildbuild()TakeBatchScreenshotsDto

Where it refuses work

  • BatchRequestBuilder stops the work with Error when !this.request.screenshots || this.request.screenshots.length === 0 — “At least one screenshot is required”.

Was this page helpful?

Download as PDF