GuidesUsing Endform
Test Vercel previews
Run your Playwright suite on Endform automatically against every pull request's Vercel preview deployment.
Endform integrates directly with Vercel and GitHub Actions so every pull request waits for its Vercel preview deployment, bypasses Vercel Deployment Protection automatically, runs your Playwright suite in parallel against the preview URL, and reports the result as a Vercel deployment check.


Working with a coding agent? Give it this prompt and it will configure your Playwright config and workflow for you:
Set up Endform to test Vercel preview deployments by following
https://endform.dev/docs/using-endform/vercel-previews.md.
Update playwright.config.ts to read BASE_URL, create
.github/workflows/endform-e2e.yml using run-with-vercel-deployment,
and tell me the GitHub and Vercel connection commands to run.Connect Vercel and run on pull requests
You need a GitHub repository deploying to Vercel, an existing Playwright suite, and a GitHub Actions workflow.
-
Connect GitHub and Vercel to Endform
Install both the Endform GitHub App and the Endform Vercel integration on the same Endform organization:
npx endform@latest connect github npx endform@latest connect vercelYou can also install Endform directly from the Vercel Marketplace and connect GitHub from Settings → Integrations in the Endform dashboard. Make sure the repository deploying to Vercel is selected in the GitHub App installation.
-
Read
BASE_URLinplaywright.config.tsConfigure
use.baseURLto readprocess.env.BASE_URLwhen running against a Vercel preview, and fall back to your local dev server whenBASE_URLis unset:playwright.config.ts import { defineConfig } from "@playwright/test"; const baseURL = process.env.BASE_URL ?? "http://localhost:3000"; export default defineConfig({ webServer: process.env.BASE_URL ? undefined : { command: "npm run dev", url: "http://localhost:3000", reuseExistingServer: !process.env.CI, }, use: { baseURL, }, });With this setup, running
npx endform@latest testlocally still tests against your local server, while CI tests directly against the Vercel preview URL without startingwebServer. -
Add the GitHub Actions workflow
Create
.github/workflows/endform-e2e.ymlusingendformdev/actions/run-with-vercel-deployment. Replaceyour-vercel-project-namewith your exact Vercel project name (also listed in.vercel/project.jsonif linked locally):.github/workflows/endform-e2e.yml name: Endform Vercel Previews on: pull_request: permissions: contents: read id-token: write jobs: e2e: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 22 - name: Install dependencies run: npm ci - name: Wait for Vercel deployment uses: endformdev/actions/run-with-vercel-deployment@main with: project-name: your-vercel-project-name set-url-env-var: BASE_URL - name: Run Playwright suite on Endform run: npx endform@latest testrun-with-vercel-deploymentauthenticates through GitHub OIDC (do not passENDFORM_API_KEY) and injects Vercel's Deployment Protection bypass header into Playwright browser contexts andrequestfixtures automatically.If your test setup or fixtures make direct Node.js
fetchcalls outside Playwright's browser context, addset-vercel-bypass-env-var: VERCEL_BYPASS_TOKENtorun-with-vercel-deploymentand sendx-vercel-protection-bypasson those requests. See Directfetchcalls. -
Open a pull request and check the result
Push your changes on a branch and open a pull request. The GitHub Actions job waits for Vercel to finish building the preview, runs your suite on Endform, and reports:
- A Vercel deployment check on the preview deployment with a link to the Endform run
- A pull request summary comment (and inline comments on failing test lines in the diff) from the Endform GitHub App
For every action input, see the run-with-vercel-deployment reference. For skipped checks, action errors, or testing Vercel previews from another CI provider, see the Vercel FAQ.
Check lifecycle, Marketplace accounts, action inputs, and FAQ.
GitHub appPermissions, webhook events, and managing repository access.
Test against a local serverRun the same suite locally against localhost while iterating on a branch.
Optimize test loadTune concurrency if high parallelism stresses your preview deployment's backend.
Last updated