# Buddy Pipelines

Integrate visual tests into Buddy pipelines - select a suite in a build action, add an approval gate, and see complete pipeline examples.

Visual tests are first-class citizens in Buddy pipelines: build actions know about suites, tokens are injected automatically, and a dedicated action can pause the pipeline until the visual changes are approved.

## Adding visual tests to a build action

Build actions such as **Playwright**, **Cypress**, **Node.js**, or **Gradle** have a **Configure visual tests** link next to the commands editor:

1. Click **Configure visual tests**
2. Select the **suite** the comparisons should run in
3. Select the **framework** - Buddy inserts the matching `bdy tests visual session create` command into the action commands

The suite is now bound to the action (the link shows its name) and the token is provided to the action automatically - no `BUDDY_VT_TOKEN` variable needed.

<Hint type="info">
If you enter a suite ID that doesn't exist yet, the suite is created automatically after the first action execution.
</Hint>

For Storybook, use the dedicated **Storybook** action instead - see [Storybook](/docs/tests/visual-tests/storybook.md). For URL-based tests without code, use the **Visual Tests** action - see [Scriptless Testing](/docs/tests/visual-tests/scriptless-testing.md).

## Human-in-the-loop: waiting for session approval

Add the **Approve Visual Tests Session** action after the action that creates the session. It suspends the pipeline until the session is reviewed:

- if you **approve** the changes, the pipeline continues (e.g. proceeds to deployment)
- if you **reject** them, the pipeline stops

This turns visual review into a deployment gate: nothing ships until a human confirms the UI looks right.

<Hint type="info">
The **Visual Tests** action adds the approval action automatically on creation (a checkbox in the action settings controls this).
</Hint>

## Example pipeline

A complete release flow with visual tests as the quality gate between staging and production:

![Pipeline workflow with build, staging deployment, visual tests, approval gate, and production deployment](/docs/tests/visual-tests/pipeline-workflow.png 640x494)

1. **Build** - installs dependencies and builds the app
2. **Deploy to staging** - ships the build to the staging environment
3. **Visual Tests** - captures snapshots of the staging URL and creates a session
4. **Wait for Visual Tests approval** (the Approve Visual Tests Session action) - pauses the pipeline until the session is reviewed
5. **Deploy to production** - runs only after the visual changes are approved

Typical variations:

- **On every push**: build action with `bdy tests visual session create "npx playwright test"` → approval gate → deploy to production
- **Component library CI**: Storybook action on every merge request, with [auto-approve](/docs/tests/visual-tests/reviewing-approvals.md) configured for the default branch


---
Original source: https://buddy.works/docs/tests/visual-tests/running-visual-tests/buddy-pipelines