## Service level configuration

```typescript
/**
 * Options for configuring the Wopee Service.
 */
export interface WopeeServiceOptions {
  /**
   * Options for permanent storage of screenshots.
   */
  permanentStorage?: LocalSaveScreenshotAdapterOptions;

  /**
   * Options for screenshot validation using VRT (Visual Regression Testing).
   */
  screenshotValidation?: VrtAdapterOptions;

  /**
   * Image processing options.
   */
  imageProcessing?: ImageProcessingOptions;

  /**
   * Landscape or portrait.
   */
  isLandscape: boolean;

  /**
   * Save or not screenshot locally.
   */
  saveScreenshot: boolean;

  /**
   * Track or not screenshot to Wopee platform.
   */
  validateScreenshot: boolean;
}
```

where `LocalSaveScreenshotAdapterOptions` is defined as

```typescript
/**
 * Configuration options for the local screenshot tracking adapter.
 */
export interface LocalSaveScreenshotAdapterOptions {
  /**
   * The root folder where the screenshots will be saved.
   */
  rootFolder?: string;

  /**
   * The format string used to generate image names.
   */
  formatImageName?: string;
}
```

with default values of

```typescript
/**
 * Default options for the local screenshot saving adapter.
 * These options are used to configure how screenshots are saved locally.
 */
export const DEFAULT_LOCAL_SAVE_SCREENSHOT_OPTIONS: Partial<LocalSaveScreenshotAdapterOptions> = {
  rootFolder: './.tmp/',
  formatImageName: '{name}-{browserName}-{width}x{height}-dpr-{dpr}',
};
```

with options for `formatImageName` generated on the fly from running session, except from `name` which is given to tracking function as mandatory argument, being

```typescript
/**
 * Options for formatting file names associated with browser screenshots.
 */
export interface FormatFileOptions {
  /**
   * The name of the browser.
   */
  browserName: string;

  /**
   * The version of the browser.
   */
  browserVersion: string;

  /**
   * The device's pixel ratio (DPR).
   */
  dpr: number;

  /**
   * The screen height in pixels.
   */
  height: number;

  /**
   * A descriptive name associated with the instance.
   */
  name: string;

  /**
   * The screen width in pixels.
   */
  width: number;
}
```

and `VrtAdapterOptions` defined as

```typescript
/**
 * Configuration options for the Visual Regression Testing (VRT) Adapter.
 */
export interface VrtAdapterOptions {
  /**
   * The API key required for authentication with the VRT service.
   */
  apiKey: string;

  /**
   * The URL of the VRT service's API endpoint.
   */
  apiUrl: string;

  /**
   * The Universally Unique Identifier (UUID) of the VRT project.
   */
  projectUuid: string;

  /**
   * Optional: The name of the branch being used in the VRT.
   */
  branchName?: string;

  /**
   * Optional: The baseline branch name of the branch being used in the VRT.
   */
  baselineBranchName?: string;

  /**
   * Optional: Whether to enable soft assertion mode for VRT.
   * Soft assertions allow tests to continue running after visual differences are detected.
   */
  enableSoftAssert?: boolean;

  /**
   * Optional: The identifier for the CI/CD build associated with the testing process.
   * This helps track and associate groups of tests as specific collections or suites.
   */
  ciBuildId?: string;

  /**
   * Optional: The name of the browser.
   */
  browser?: string;

  /**
   * Optional: A comment or description for the validation.
   */
  comment?: string;

  /**
   * Optional: The name of the device.
   */
  device?: string;

  /**
   * Optional: The name of the operating system.
   */
  os?: string;

  /**
   * Optional: Tolerance level for pixel-to-pixel differences during validation.
   */
  pixelToPixelDiffTolerance?: number;

  /**
   * Optional: The viewport information.
   */
  viewport?: string;

  /**
   * Optional: Custom tags for additional metadata.
   */
  customTags?: string;
}
```

with default values of

```typescript
/**
 * Default configuration options for the screenshot tracking adapter.
 */
export const DEFAULT_VRT_ADAPTER_OPTIONS: Partial<VrtAdapterOptions> = {
  branchName: 'master',
  ciBuildId: 'init',
  enableSoftAssert: true,
  pixelToPixelDiffTolerance: 0.0,
};
```

and

```typescript
interface ImageProcessingOptions {
  maskColor: z.string().default('black'),
  mode: z.enum(['masking', 'cropping', 'none']).default('none'),
  xLeft: z.number().default(0),
  xRight: z.number().default(0),
  yBottom: z.number().default(0),
  yTop: z.number().default(0),
}
```

## WebdriverIO level configuration

Simple add `wopee` service with respective confutation described in section [Service level configuration](#service-level-configuration)

```
services: [
    [
        'wopee',
        {
            screenshotValidation: {
                apiUrl: process.env.apiUrl,
                apiKey: process.env.apiKey,
                projectUuid: process.env.project,
            },
            isLandscape: true,
        },
    ],
],
```
