Metadata-Version: 2.4
Name: ui-capture
Version: 0.3.0b4
Summary: Local browser screenshot and UI evidence bundles
Author: Kusse Sukuta Bersha
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: playwright<2,>=1.48
Dynamic: license-file

# UI Capture (engineering preview)

Local-first browser UI evidence utility. UI Capture is currently in beta and distributed under the MIT License.

## Setup

From the source directory, use a Python 3.10+ interpreter compatible with Playwright:

```sh
python3 -m venv .venv
.venv/bin/python -m pip install .
.venv/bin/python -m playwright install chromium
.venv/bin/ui-capture --version
.venv/bin/ui-capture --url http://127.0.0.1:3000/ --project example --capture-mode both --zip
```

Install other browser engines via `python -m playwright install firefox webkit` inside the environment. Use `--help` for options. Configurations support devices, browsers, themes, scale, timeout_ms, capture_mode (full, viewport, both), and screens with name, path, ready selector and ordered click, click_if_visible, wait or fill steps. A screen can specify a repository-relative JSON fixture with path and storage_key; use --repo. Each screen receives an isolated browser context. Existing full_page configuration remains supported. CLI capture mode overrides per-screen modes.

## Evidence and limitations

Outputs are stored locally under `~/.ui-capture/runs` by default. The manifest records per-screen error counts, HTTP status counts, request failures, screenshot hashes, fixture hash and whether state was seeded. Use `--repo` with a trusted checkout. Git metadata records its HEAD commit and reports working-tree cleanliness as unknown (`dirty: null`). The served revision is explicitly unverified. Raw console messages, HTTP paths, query strings and exception messages are not recorded. Screenshots may expose confidential data; inspect before sharing. Do not include secrets in configs. Loaded pages can make network requests or change backend data; this tool is not a network or security sandbox. Use trusted apps and disposable data. CSS viewport emulation is not physical-device testing. Capture is not visual regression or accessibility certification. Exit codes: 0 clean, 1 warnings/failures, 2 setup failure.

## Development

`python -m unittest discover -s tests -v` after installation. The included browser test uses system Chromium if available, otherwise Playwright-managed Chromium (install it first); actual macOS and other engine validation remain release gates. The private legacy configurations used during development are excluded from the distributable source archive.


### Browser validation

Install Playwright-managed engines with `python -m playwright install chromium firefox webkit`.
Run the existing capture assertions against each engine on the target macOS machine:

```sh
for browser in chromium firefox webkit; do
  UI_CAPTURE_TEST_MANAGED=1 UI_CAPTURE_TEST_BROWSER="$browser" \
    python -m unittest discover -s tests -v || exit 1
done
```

### Package validation

Build a wheel and source archive with `python -m build` in a development environment
with the `build` frontend installed. In separate fresh virtual environments, install
each artifact with `python -m pip install /path/to/artifact`, run `python -m pip check`
and verify `ui-capture --version` and `ui-capture --help`. The browser installation is
a separate step. Use a private output location you control, including its parent directories. Keep run directories protected from concurrent edits while creating a ZIP. ZIP bundles and screenshots
can contain private UI data and should be reviewed before sharing.
