## Fixture level configuration

Each configuration option is provided by environment variable given as

| Configuration option                             | Environmental variable              | Required |
| ------------------------------------------------ | ----------------------------------- | -------- |
| screenshotValidation.apiKey                      | WOPEE_API_KEY                       | yes      |
| screenshotValidation.projectUuid                 | WOPEE_PROJECT_UUID                  | yes      |
| screenshotValidation.screenshotValidationEnabled | WOPEE_SCREENSHOT_VALIDATION_ENABLED | no       |
| screenshotValidation.apiUrl                      | WOPEE_API_URL                       | no       |
| screenshotValidation.branchName                  | WOPEE_BRANCH_NAME                   | no       |
| screenshotValidation.baselineBranchName          | WOPEE_BASELINE_BRANCH_NAME          | no       |
| screenshotValidation.suiteUuid                   | WOPEE_SUITE_UUID                    | no       |
| screenshotValidation.enableSoftAssert            | WOPEE_ENABLE_SOFT_ASSERT            | no       |
| screenshotValidation.collectPageContent          | WOPEE_COLLECT_PAGE_CONTENT          | no       |
| screenshotValidation.browser                     | WOPEE_BROWSER                       | no       |
| screenshotValidation.comment                     | WOPEE_COMMENT                       | no       |
| screenshotValidation.device                      | WOPEE_DEVICE                        | no       |
| screenshotValidation.os                          | WOPEE_OS                            | no       |
| screenshotValidation.pixelToPixelDiffTolerance   | WOPEE_PIXEL_TO_PIXEL_DIFF_TOLERANCE | no       |
| screenshotValidation.viewport                    | WOPEE_VIEWPORT                      | no       |
| screenshotValidation.customTags                  | WOPEE_CUSTOM_TAGS                   | no       |
| screenshotValidation.maxRetries                  | WOPEE_API_MAX_RETRIES               | no       |
| screenshotValidation.requestTimeoutMs            | WOPEE_API_TIMEOUT_MS                | no       |

where separate values are described in `WopeeOptions` and `ScreenshotValidationOptions` interfaces with default values defined in `DEFAULT_SCREENSHOT_VALIDATION_OPTIONS`,

### Required values

`WOPEE_API_KEY` and `WOPEE_PROJECT_UUID` come from your project at [cmd.wopee.io](https://cmd.wopee.io) — the key from Project Settings → API Keys, the UUID from Project Settings. If either is missing, `new Wopee()` fails immediately with a message naming the variable, rather than failing later inside a test.

`WOPEE_API_URL` is optional and defaults to the SaaS endpoint `https://api.wopee.io`. Set it only for self-hosted instances.

### Timeouts and retries

Calls to the Wopee API carry a screenshot and can be several megabytes, so on a slow or
traffic-inspected link they occasionally time out at a gateway. The SDK bounds each attempt and
retries the ones that look transient; both defaults are usually right and neither variable needs
setting.

`WOPEE_API_TIMEOUT_MS` is the ceiling for a single attempt, default `180000` (3 minutes). `0`
removes the ceiling.

`WOPEE_API_MAX_RETRIES` is how many times a transient failure is retried, default `2` — three
attempts in all, backing off 1 s then 2 s. Only failures that mean the request did not get through
are retried (no response at all, the attempt's own timeout, `408`, `429`, `499`, `502`, `503`,
`504`); a request the API looked at and rejected is not. Set it to `0` to switch retries off, for
example if you would rather a tracking call fail fast than risk a duplicated step record.

### Self-hosted instances and proxies

If your organisation runs its own Wopee instance, `WOPEE_API_URL` points at a host inside the customer network (for example `https://api.acme.wopee.io`). That host is usually **not reachable from a laptop on the public internet** — you need to be on the corporate VPN, behind the corporate proxy, or running the tests from a CI runner inside that network.

Wopee honours the standard proxy variables:

```bash
export HTTPS_PROXY=http://proxy.corp:8080
export NO_PROXY=localhost,127.0.0.1,.internal
```

`NO_PROXY` supports exact hosts, leading-dot suffixes (`.acme.io`), `host:port` entries, CIDR ranges (`10.0.0.0/8`) and `*`.

See [troubleshooting.md](./troubleshooting.md) if a run cannot reach the API.
