# Wopee.io Visual Testing for Playwright

Catch visual regressions in your [Playwright](https://playwright.dev/) tests with AI-powered autonomous test maintenance by [Wopee.io](https://wopee.io).

[![npm version](https://img.shields.io/npm/v/@wopee-io/wopee.pw)](https://www.npmjs.com/package/@wopee-io/wopee.pw)
[![license](https://img.shields.io/npm/l/@wopee-io/wopee.pw)](https://www.npmjs.com/package/@wopee-io/wopee.pw)

## Installation

```bash
npm install @wopee-io/wopee.pw
```

## Quick Start

```typescript
import { test } from '@playwright/test';
import { Wopee } from '@wopee-io/wopee.pw';

const wopee = new Wopee();

test.beforeAll(async () => {
  await wopee.startSuite('My Suite');
});

test('visual check', async ({ page }) => {
  await page.goto('https://example.com');
  await wopee.trackFullPage({ page, stepName: 'Homepage' });
});
```

## Configuration

Two environment variables are required. Get both from your project at [cmd.wopee.io](https://cmd.wopee.io) — the key from Project Settings → API Keys, the UUID from Project Settings:

```bash
export WOPEE_API_KEY=<your api key>
export WOPEE_PROJECT_UUID=<your project uuid>
```

Set them in your shell, in a `.env` file next to your Playwright config, or as CI secrets. If either is missing, `new Wopee()` fails immediately with a message naming the variable.

Self-hosted instances also set `WOPEE_API_URL`, and are typically reachable only from the customer network — see [docs/configuration.md](./docs/configuration.md) for the full variable list and proxy support, and [docs/troubleshooting.md](./docs/troubleshooting.md) if a run cannot reach the API.

## Features

- **Visual regression testing** — pixel-level and AI-powered comparison
- **Autonomous test maintenance** — AI automatically updates baselines when intended changes are detected
- **Playwright integration** — works with your existing Playwright test suite
- **Full page and element screenshots** — flexible capture options
- **CI/CD ready** — integrates into any pipeline

## Links

- [Documentation](https://docs.wopee.io/playwright-visual-testing/) — setup guides and API reference
- [Wopee.io Platform](https://cmd.wopee.io) — manage baselines, review results
- [Wopee.io Website](https://wopee.io) — learn more about visual testing
