Vision-driven UI Testing Framework
Project description
vizQA: Vision-Driven Web UI Testing Framework
vizQA is a lightweight, next-generation UI testing framework that "sees" and interacts with your application like a human does. By combining Playwright's robust automation with advanced visual perception and semantic search, vizQA lets you write tests in natural language without brittle CSS selectors or XPath. It is not an LLM-based test runner: execution is rule-driven, CPU-friendly, and designed for repeatable, idempotent regression.
👁️ Why Vision-Driven?
Modern UI automation has moved beyond brittle selectors and test-only frontend instrumentation. In many teams, the hard part is no longer writing assertions, but keeping locators, hooks, and page models aligned with a UI that changes constantly.
vizQA treats the UI the way users experience it:
- More Powerful by Default: Targets what is actually visible and interactable, not just what happens to exist in the DOM.
- Flow-Oriented Testing: Lets you describe user flows in plain language instead of maintaining large locator maps, page objects, or test-only abstractions.
- Less Setup Overhead: No need to add
data-testidattributes everywhere or rely on an automation specialist to instrument every flow before it can be tested. - Better for Real Failures: Helps catch issues involving hidden, off-screen, obstructed, overlapping, or otherwise non-visible elements that selector-based tests can miss.
- Better Across Screen Sizes: Useful for debugging and validating responsive behavior across different viewports, resolutions, and layout breakpoints.
- Better for Debugging: Makes it easier to understand what was actually rendered at the time of failure, especially with transient UI, overlays, and state that only appears in certain conditions.
Key Features
- Natural Language Steps: Define your test flow in simple YAML instructions.
- Not LLM-Based: Uses deterministic parsing, semantic matching, and ranking rather than live LLM calls during test execution.
- Advanced Interactions: Supports
click,hover,type,scroll, and evendrag and drop. - Visual Assertions: Verify UI state and visibility.
- Multi-Viewport Runs: Test multiple window sizes in parallel to catch responsive issues faster.
- Artifact Variables: Load strings, file contents, or paths as variables (e.g.,
{user_name}) for dynamic test data. - Test Pre-requisites: Chain setup flows with
requiresand reuse artifacts/browser state across related tests. - Repeatable Test Runs: Optimized for stable, idempotent YAML test cases that can be run consistently in CI and local workflows.
- Lightweight & Fast: CPU-only execution with a minimal ~250 MB memory footprint and sub-second latency.
🚀 Getting Started
Prerequisites
-
Python 3.11+
-
Playwright
-
UI Perception Backend: vizQA requires a perception backend. You can run the official lightweight UI-Atlas docker image for fully local operation:
docker run -d -p 8228:8000 --name ui-atlas tinyreasonlabs/ui-atlas:latest
Learn more about UI-Atlas on Dockerhub
vizQA connects to the backend using the
PERCEPTION_BACKENDenvironment variable (normalized tohttp://…; defaultlocalhost:8228, i.e.http://localhost:8228).- Examples:
export PERCEPTION_BACKEND=localhost:8228 # bash / zsh
- Examples:
Installation
pip install vizqa
vizqa install
vizqa install installs Playwright browser binaries and model weights under vizQA/weights, and refreshes the local weights metadata used by the CLI.
You can inspect both the package version and installed weights revision with:
vizqa --version
📝 Usage
Define a Test (login_test.yaml)
name: "User Login Flow"
url: "https://example.com/login"
steps:
- action: "Type 'admin' into the username field"
expect: "Username field contains 'admin'"
- action: "Type 'password123' into the password field"
- action: "Click the 'Login' button"
expect: "dashboard"
YAML string values support environment-variable interpolation with ${VAR}. If a referenced variable is not set, vizQA raises a test-definition error when loading the file.
For the full YAML format and authoring guide, see docs/test_cases.md.
Run the Test
# Run all YAML tests in a directory (recursively; .yaml / .yml)
vizqa tests/
# Equivalent explicit subcommand
vizqa run tests/
Use As a Library
You can also embed vizQA inside an existing Playwright test and mix DOM-based and visual steps:
from vizQA import attach
async def test_login(page):
vizqa = attach(page)
await page.get_by_label("Email").fill("analyst.user@example.com")
await page.get_by_label("Password").fill("AnalystPass!23")
await vizqa.click("Sign in button")
await vizqa.verify("Overview dashboard")
Library usage is artifact-light by default. If you want persistent screenshots for debugging, pass debug_dir=... when attaching.
For the full library guide, see docs/library_api.md.
CLI Arguments
| Argument | Description | Default |
|---|---|---|
paths |
One or more paths to test files or directories. | Required for a run (omit to print help). |
--headless / --no-headless |
Run browser in headless mode. | True |
-s, --silent |
Use the compact terminal reporter instead of the default rich live view. | False |
--debug-log |
Keep the same terminal UI, but write richer DEBUG diagnostics to .vizQA/run_*.log. |
False |
-x, --interactive |
Run in interactive mode; stop at the first failing test. | False |
--viewport |
Repeatable built-in viewport name (mobile, tablet, desktop, widescreen), custom configured profile name, or raw WIDTHxHEIGHT size such as 390x844. Specify it multiple times to run several sizes in parallel. |
Configured default viewports, otherwise desktop |
The default CLI output is now the verbose terminal reporter. Use --silent when you want a compact summary-oriented view. --debug-log only affects the .vizQA log files; it does not change the terminal layout.
If you do not define your own viewport profiles, vizQA includes these built-in sizes:
mobile:390x844tablet:768x1024desktop:1440x900widescreen:1728x1117
Configuration
vizQA supports global and per-test configuration, including custom HTTP headers for authentication or specialized testing.
For the broader configuration reference, including environment variables see docs/configuration.md.
Global Configuration
You can define global headers and reusable viewport profiles in your pyproject.toml or a .ini file in the current working directory: pytest.ini, tox.ini, setup.cfg, or vizqa.ini.
pyproject.toml
[tool.vizqa.headers]
Authorization = "Bearer global-api-token"
X-Custom-Header = "GlobalValue"
[tool.vizqa.viewports]
app = "1280x720"
mobile = "390x844"
pytest.ini / tox.ini / setup.cfg / vizqa.ini
[vizqa.headers]
Authorization = Bearer global-api-token
X-Custom-Header = GlobalValue
[vizqa.viewports]
app = 1280x720
mobile = 390x844
Built-in viewport profile names:
mobiletabletdesktopwidescreen
If you define viewport profiles for your app, vizqa run ... uses them by default when --viewport is omitted.
Per-Test Overrides
You can specify or override headers directly in your test YAML file. These take precedence over global settings.
my_test.yaml
name: "Protected API Test"
url: "https://example.com/api"
headers:
Authorization: "Bearer test-specific-token"
steps:
- action: "Open the dashboard"
expect: "A welcome message should appear"
Methodology
vizQA follows a three-stage execution cycle for every step:
- Perception: Takes a screenshot and sends it to the Perception API to identify all visual elements and their properties (bounds, text, color, state).
- Planning: Uses semantic matching to understand intent and internally breaks down high-level instructions into atomic
find,do, andverifycommands to handle complex interactions. - Execution: Performs the interaction via Playwright using precise pixel coordinates, ensuring we interact exactly with what was "seen."
Contributing
We welcome contributions! Please see our CONTRIBUTING.md for details on setting up the environment and submitting PRs.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vizqa-0.3.1.tar.gz.
File metadata
- Download URL: vizqa-0.3.1.tar.gz
- Upload date:
- Size: 118.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3c30f9bdc17d6b3dfcf2f1be9b11833bc355bb4903cb7d6e6fe7d681fe67215
|
|
| MD5 |
09c90bedcf2995736b76150faba17451
|
|
| BLAKE2b-256 |
cf09db1767720ba906847fef852db687e97d4c6e9c79bbf67e416f77b4253560
|
Provenance
The following attestation bundles were made for vizqa-0.3.1.tar.gz:
Publisher:
release.yml on TinyReasonLabs/vizQA
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vizqa-0.3.1.tar.gz -
Subject digest:
e3c30f9bdc17d6b3dfcf2f1be9b11833bc355bb4903cb7d6e6fe7d681fe67215 - Sigstore transparency entry: 1614752350
- Sigstore integration time:
-
Permalink:
TinyReasonLabs/vizQA@e8f75f42c9198c8e80b0c8bc66d7eaaf306d2810 -
Branch / Tag:
refs/heads/release/0.3.1 - Owner: https://github.com/TinyReasonLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e8f75f42c9198c8e80b0c8bc66d7eaaf306d2810 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vizqa-0.3.1-py3-none-any.whl.
File metadata
- Download URL: vizqa-0.3.1-py3-none-any.whl
- Upload date:
- Size: 140.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac0b26f1360426c5d68b4a5ea0d49f7b9169ed378967e0fc652096611f1ace13
|
|
| MD5 |
a17c85def2ec95eb2d17a849f854019a
|
|
| BLAKE2b-256 |
6af9620ed3d4b1d5ff6fee19a4358f2424ab33b10cd66a76bc541689f91abea2
|
Provenance
The following attestation bundles were made for vizqa-0.3.1-py3-none-any.whl:
Publisher:
release.yml on TinyReasonLabs/vizQA
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vizqa-0.3.1-py3-none-any.whl -
Subject digest:
ac0b26f1360426c5d68b4a5ea0d49f7b9169ed378967e0fc652096611f1ace13 - Sigstore transparency entry: 1614752396
- Sigstore integration time:
-
Permalink:
TinyReasonLabs/vizQA@e8f75f42c9198c8e80b0c8bc66d7eaaf306d2810 -
Branch / Tag:
refs/heads/release/0.3.1 - Owner: https://github.com/TinyReasonLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e8f75f42c9198c8e80b0c8bc66d7eaaf306d2810 -
Trigger Event:
workflow_dispatch
-
Statement type: