@bugbug-io/sdk
    Preparing search index...

    Class VisualRegressionModule

    Visual regression module — manage reference screenshots that anchor element/page visual-regression steps.

    A reference screenshot represents the "expected" pixels for a step; the runner compares each run's screenshot against the active reference.

    Index

    Constructors

    Methods

    • List reference screenshots for a given step.

      Parameters

      • options: { stepId: string; cursor?: string; pageSize?: number } & RequestOptions
        • stepId: string

          UUID of the visual-regression step (required).

        • Optionalcursor?: string

          Opaque cursor returned as nextToken by the previous page.

        • OptionalpageSize?: number

          Items per page.

      Returns Promise<VisualRegressionRefScreenshotsListResponse>

    • Fetch a single reference screenshot.

      Parameters

      Returns Promise<
          {
              id: string;
              stepId: string;
              projectArtifactId: string
              | null;
              screenshotUrl: string | null;
              browserName: string | null;
              osName: string | null;
              screenSizeType: string | null;
              runProfileId: string | null;
              runProfileName: string;
              runMode: "recording" | "server" | "local" | null;
              created: string;
              modified: string;
          },
      >

      When no reference screenshot matches id.

    • Create a new reference screenshot for a visual-regression step.

      Parameters

      • data: {
            stepId: string;
            screenshot: string;
            browserName?: string | null;
            osName?: string | null;
            screenSizeType?: "" | "desktop" | "mobile" | "custom" | null;
            runProfileId?: string | null;
            runMode?: "" | "recording" | "server" | "local" | null;
        }
        • stepId: string

          Format: uuid

        • screenshot: string

          Format: uri

        • OptionalbrowserName?: string | null
        • OptionalosName?: string | null
        • OptionalscreenSizeType?: "" | "desktop" | "mobile" | "custom" | null
          • desktop - Desktop
            • mobile - Mobile
            • custom - Custom
        • OptionalrunProfileId?: string | null

          Format: uuid

        • OptionalrunMode?: "" | "recording" | "server" | "local" | null
          • server - cloud
            • local - local
            • recording - recording
      • options: RequestOptions = {}

      Returns Promise<
          {
              id: string;
              stepId: string;
              projectArtifactId: string
              | null;
              screenshotUrl: string | null;
              browserName: string | null;
              osName: string | null;
              screenSizeType: string | null;
              runProfileId: string | null;
              runProfileName: string;
              runMode: "recording" | "server" | "local" | null;
              created: string;
              modified: string;
          },
      >

      On invalid payload.

    • Patch a reference screenshot.

      Parameters

      • id: string
      • data: { screenshot?: string }
        • Optionalscreenshot?: string

          Format: uri

      • options: RequestOptions = {}

      Returns Promise<
          {
              id: string;
              stepId: string;
              projectArtifactId: string
              | null;
              screenshotUrl: string | null;
              browserName: string | null;
              osName: string | null;
              screenSizeType: string | null;
              runProfileId: string | null;
              runProfileName: string;
              runMode: "recording" | "server" | "local" | null;
              created: string;
              modified: string;
          },
      >

      When the reference screenshot does not exist.

      On invalid payload.

    • Delete a reference screenshot.

      Parameters

      Returns Promise<void>

      When the reference screenshot does not exist.

    • Resolve failed visual-regression checks.

      Parameters

      • options: { type: VisualRegressionResolutionType; testRunId?: string; stepRunId?: string } & RequestOptions
        • type: VisualRegressionResolutionType

          set_new_reference accepts the observed screenshot as the new baseline; set_new_max_difference raises the step's allowed difference to just above the observed value. The value is computed server-side and cannot be supplied.

        • OptionaltestRunId?: string

          Resolve every failed visual-regression step in a test run.

          Provide exactly one of stepRunId or testRunId.

        • OptionalstepRunId?: string

          Resolve a single step run.

      Returns Promise<VisualRegressionResolveResponse>