---
title: How can I run end-to-end tests after my Vercel Preview Deployment?
description: Learn how to use the Vercel CLI in combination with your CI/CD provider to run end-to-end tests for every code change.
url: /kb/guide/how-can-i-run-end-to-end-tests-after-my-vercel-preview-deployment
canonical_url: "https://vercel.com/kb/guide/how-can-i-run-end-to-end-tests-after-my-vercel-preview-deployment"
published: 2025-11-03
last_updated: 2026-01-05
authors: Anthony Shew
related:
  - /docs/deployment-protection
  - /docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation
  - /docs/concepts/git
  - /docs/webhooks
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [GitHub](https://vercel.com/docs/git/vercel-for-github?from=related) — Vercel for GitHub automatically deploys your GitHub projects with Vercel, providing Preview Deployment URLs, and automat
- [Deploy from CLI](https://vercel.com/docs/projects/deploy-from-cli?from=related) — Set up and deploy a Vercel project using the CLI, from linking to production.
- [Deployments](https://vercel.com/docs/deployments?from=related) — Learn how to create and manage deployments on Vercel.
- [Deployment Checks](https://vercel.com/docs/deployment-checks?from=related) — Set conditions that must be met before proceeding to the next phase of the deployment lifecycle.
- [Git Integrations](https://vercel.com/docs/git?from=related) — Vercel allows for automatic deployments on every branch push and merges onto the production branch of your GitHub, GitLa
- [How can I use the Vercel CLI for custom workflows?](https://vercel.com/kb/guide/using-vercel-cli-for-custom-workflows?from=related) — You can use the Vercel CLI to deploy any application, including custom git providers and restricted source code.
- [How can I use CircleCI with Vercel?](https://vercel.com/kb/guide/how-can-i-use-circleci-with-vercel?from=related) — Learn how to use CircleCI to deploy to Vercel with custom CI/CD.
- [Can you deploy based on tags/releases on Vercel?](https://vercel.com/kb/guide/can-you-deploy-based-on-tags-releases-on-vercel?from=related) — Learn how to deploy based on tags/releases on Vercel.
- [How can I use Bitbucket Pipelines with Vercel?](https://vercel.com/kb/guide/how-can-i-use-bitbucket-pipelines-with-vercel?from=related) — Learn how to use Bitbucket Pipelines to deploy to Vercel including support for Bitbucket Data Center.
- [How can I use GitLab Pipelines with Vercel?](https://vercel.com/kb/guide/how-can-i-use-gitlab-pipelines-with-vercel?from=related) — Learn how to use GitLab Pipelines to deploy to Vercel including support for self-managed GitLab.

Full cross-link map for this page: [/kb/guide/how-can-i-run-end-to-end-tests-after-my-vercel-preview-deployment.graph.md](/kb/guide/how-can-i-run-end-to-end-tests-after-my-vercel-preview-deployment.graph.md)
<!-- /docsgraph:related -->


You can run an end-to-end test suite after your Vercel deployment has finished with the following methods:

- [Using GitHub Actions' repository\_dispatch events](#using-github-actions'-repository_dispatch-events)
  
- [Using webhooks with other CI providers](#using-webhooks-for-other-ci-providers)
  

If your project has [Deployment Protection](https://vercel.com/docs/deployment-protection) enabled, ensure you use [Protection Bypass for Automation](https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation) so your test environments can reach your deployments.

## Using GitHub Actions' `repository_dispatch` events

1. Connect your Git repository to your project. For new projects, you can [follow these docs](https://vercel.com/docs/concepts/git#deploying-a-git-repository). For existing projects, visit your Git configuration in the Settings tab of your project dashboard.
   
2. Create a GitHub workflow in `.github/workflows` with the following:
   

```text
name: Playwright Tests

on:
  repository_dispatch:
    types:
      - 'vercel.deployment.success'
jobs:
  run-e2es:
    if: github.event_name == 'repository_dispatch'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.client_payload.git.sha }}
      - name: Install dependencies
        run: npm ci && npx playwright install --with-deps
      - name: Run tests
        run: npx playwright test
        env:
          BASE_URL: ${{ github.event.client_payload.url }}
```

## Using webhooks for other CI providers

1. [Configure a webhook](https://vercel.com/docs/webhooks#configure-a-webhook) for the `deployment.succeeded` event.
   
2. Listen for the webhook to trigger your CI workflow.
   
3. Run end-to-end test suites.