VisualQ
Getting Started

Environments

Test the same scenarios against different environments like staging and production.

Environments let you run the same scenarios against different versions of your site — staging, production, development — without duplicating projects or scenarios.

How it works

Each environment defines its own base URL and optional settings (custom headers, user agent). When you run tests against an environment, VisualQ swaps the origin of each scenario URL with the environment's base URL:

Scenario URL:      https://prod.example.com/shoes?color=red
Staging base URL:  https://staging.example.com
Resolved URL:      https://staging.example.com/shoes?color=red

Baselines, test screenshots, diffs, and reports are all stored separately per environment. This means each environment has its own independent visual history.

Default environment

When you create a project, a Production environment is automatically created using the project's base URL. Existing projects get a Production environment on first access.

The default environment cannot be deleted — you must assign a different environment as the default first.

Create an environment

Open project settings

Navigate to your project and click Settings in the tab bar.

Find the Environments section

Scroll down to the Environments card, below General settings.

Add a new environment

Click Add environment and fill in:

  • Name — a descriptive label (e.g., "Staging", "Dev", "QA")
  • Base URL — the root URL for this environment (e.g., https://staging.example.com)
  • Color — a badge color for visual distinction in the UI
  • Custom headers (optional) — HTTP headers sent with every request
  • Custom user agent (optional) — overrides the browser user agent string

Save

Click Save. The new environment appears in the list and in the environment selector.

Select an environment

The environment selector appears in the project header, next to the project name. Click it to switch between environments.

When you select an environment:

  • Run tests — tests execute against that environment's base URL
  • Sync baselines — baselines are captured for that environment
  • View reports — only runs for the selected environment are shown
  • Run history — filtered to show runs from the selected environment

Your selection is remembered per project in your browser.

Environment badges

Each environment has a colored badge that appears:

  • In the environment selector dropdown
  • Next to runs in the test history
  • In CI/CD run responses

This makes it easy to tell at a glance which environment a run belongs to.

Edit or delete an environment

From Settings → Environments:

  • Click the edit icon to change the name, base URL, color, or headers
  • Click the delete icon to remove an environment

Deleting an environment permanently removes its baselines and test history. The default environment cannot be deleted.

Environments in CI/CD

You can target a specific environment from CI pipelines by passing the environment parameter (name or slug):

curl -X POST https://visualq.ai/api/ci/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $VISUALQ_API_KEY" \
  -d '{
    "project": "my-website",
    "environment": "staging",
    "type": "test"
  }'

With the CLI:

visualq run --api-key vq_xxx --project my-website --environment staging

Or with the GitHub Action:

- uses: visualq/visualq-action@v1
  with:
    api-key: ${{ secrets.VISUALQ_API_KEY }}
    project: my-website
    environment: staging

See REST API, GitHub Action, and Other CI systems for full details.

Next step

With your environments configured, let's add your first scenario →

On this page