GitHub Actions, CI, and Vercel: run Endform in GitHub Actions or another CI system and test Vercel preview deployments # Try the Endform demo in GitHub Actions with a local server > Running the Endform demo Playwright tests with GitHub Actions against a local server ## 1. Connect GitHub Install the Endform GitHub App to enable OIDC authentication in your workflows: [Connect GitHub in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 2. Create workflow file Create `.github/workflows/endform-e2e.yml` in your repository: .github/workflows/endform-e2e.yml ```yaml name: Run end-to-end tests with Endform on: pull_request: branches: - main permissions: contents: read id-token: write # required for authentication with Endform jobs: e2e: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v7 - name: Set up pnpm (or whichever package manager you use) uses: pnpm/action-setup@v6 - name: Install Node uses: actions/setup-node@v7 - name: Install dependencies run: pnpm install # Any other setup needed for your local server to run... - name: Run end-to-end tests with Endform working-directory: . # where your Playwright suite is located run: | npx endform@latest test ``` ## 3. Commit your changes Stage and commit your workflow file: ```bash git add -A && git commit -m "Add Endform GitHub Actions workflow" ``` ## 4. Push to trigger tests Push your changes to trigger the workflow on your next pull request: ```bash git push ``` ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Try the Endform demo in GitHub Actions with a remote server > Running the Endform demo Playwright tests with GitHub Actions against a remote server ## 1. Connect GitHub Install the Endform GitHub App to enable OIDC authentication in your workflows: [Connect GitHub in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 2. Create workflow file Create `.github/workflows/endform-e2e.yml` in your repository: .github/workflows/endform-e2e.yml ```yaml name: Run end-to-end tests with Endform on: pull_request: branches: - main permissions: contents: read id-token: write # required for authentication with Endform jobs: e2e: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v7 - name: Set up pnpm (or whichever package manager you use) uses: pnpm/action-setup@v6 - name: Install Node uses: actions/setup-node@v7 - name: Install dependencies run: pnpm install - name: Run end-to-end tests with Endform working-directory: . # where your Playwright suite is located env: BASE_URL: https://url-to-your-server.com run: | npx endform@latest test ``` ## 3. Commit your changes Stage and commit your workflow file: ```bash git add -A && git commit -m "Add Endform GitHub Actions workflow" ``` ## 4. Push to trigger tests Push your changes to trigger the workflow on your next pull request: ```bash git push ``` ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Try the Endform demo in GitHub Actions on Vercel previews > Running the Endform demo Playwright tests with GitHub Actions against Vercel preview deployments ## 1. Connect GitHub Install the Endform GitHub App to enable OIDC authentication in your workflows: [Connect GitHub in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 2. Connect Vercel Connect your Vercel account to automatically test preview deployments: [Connect Vercel in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 3. Deploy the demo project Deploy our demo repository to your Vercel account. This will automatically configure the project, but you will need to copy over the GitHub workflow files to start running your tests: [Deploy with Vercel →](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fendformdev%2Fplaywright-tutorial\&project-name=endform-playwright-example\&repository-name=endform-playwright-example\&demo-title=Next.JS%2FPlaywright%2FEndform\&demo-description=A%20next.js%20web%20app%20tested%20with%20Playwright%20and%20Endform\&demo-url=https%3A%2F%2Fendform-playwright-tutorial.vercel.app) Once deployed, tests will automatically run. Results will appear in the dashboard shortly. ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Run Playwright tests in GitHub Actions against a local server > Running your existing Playwright tests with Endform using GitHub Actions against a local server ## 1. Connect GitHub Install the Endform GitHub App to enable OIDC authentication in your workflows: [Connect GitHub in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 2. Create workflow file Create `.github/workflows/endform-e2e.yml` in your repository: .github/workflows/endform-e2e.yml ```yaml name: Run end-to-end tests with Endform on: pull_request: branches: - main permissions: contents: read id-token: write # required for authentication with Endform jobs: e2e: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v7 - name: Set up pnpm (or whichever package manager you use) uses: pnpm/action-setup@v6 - name: Install Node uses: actions/setup-node@v7 - name: Install dependencies run: pnpm install # Any other setup needed for your local server to run... - name: Run end-to-end tests with Endform working-directory: . # where your Playwright suite is located run: | npx endform@latest test ``` ## 3. Commit your changes Stage and commit your workflow file: ```bash git add -A && git commit -m "Add Endform GitHub Actions workflow" ``` ## 4. Push to trigger tests Push your changes to trigger the workflow on your next pull request: ```bash git push ``` ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Run Playwright tests in GitHub Actions against a remote server > Running your existing Playwright tests with Endform using GitHub Actions against a remote server ## 1. Connect GitHub Install the Endform GitHub App to enable OIDC authentication in your workflows: [Connect GitHub in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 2. Create workflow file Create `.github/workflows/endform-e2e.yml` in your repository: .github/workflows/endform-e2e.yml ```yaml name: Run end-to-end tests with Endform on: pull_request: branches: - main permissions: contents: read id-token: write # required for authentication with Endform jobs: e2e: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v7 - name: Set up pnpm (or whichever package manager you use) uses: pnpm/action-setup@v6 - name: Install Node uses: actions/setup-node@v7 - name: Install dependencies run: pnpm install - name: Run end-to-end tests with Endform working-directory: . # where your Playwright suite is located env: BASE_URL: https://url-to-your-server.com run: | npx endform@latest test ``` ## 3. Commit your changes Stage and commit your workflow file: ```bash git add -A && git commit -m "Add Endform GitHub Actions workflow" ``` ## 4. Push to trigger tests Push your changes to trigger the workflow on your next pull request: ```bash git push ``` ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Run Playwright tests in GitHub Actions on Vercel previews > Running your existing Playwright tests with Endform using GitHub Actions against Vercel preview deployments ## 1. Connect GitHub Install the Endform GitHub App to enable OIDC authentication in your workflows: [Connect GitHub in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 2. Connect Vercel Connect your Vercel account to automatically test preview deployments: [Connect Vercel in Dashboard →](https://endform.dev/app/docs-link?link=settings-integrations) ## 3. Create workflow file Create `.github/workflows/endform-e2e.yml` in your repository: .github/workflows/endform-e2e.yml ```yaml name: Run end-to-end tests with Endform on: pull_request: # or push: if you want to run on commits to main branches: - main permissions: contents: read id-token: write # required for authentication with Endform jobs: e2e: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v7 - name: Install Node uses: actions/setup-node@v7 - name: Set up pnpm (or whichever package manager you use) uses: pnpm/action-setup@v6 with: run_install: true - 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 # Sets the Vercel preview URL as this environment variable set-vercel-bypass-env-var: VERCEL_BYPASS_TOKEN # Exports a deployment protection bypass token as this env var - name: Run end-to-end tests with Endform working-directory: . # where your Playwright suite is located run: | npx endform@latest test ``` ## 4. Commit your changes Stage and commit your workflow file: ```bash git add -A && git commit -m "Add Endform GitHub Actions workflow" ``` ## 5. Push to trigger tests Push your changes to trigger the workflow on your next pull request: ```bash git push ``` ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Try the Endform demo in any CI with a local server > Running the Endform demo Playwright tests with other CI/CD platforms against a local server ## 1. Generate an API key Create an API key to authenticate your CI pipeline with Endform: [Generate API Key in Dashboard →](https://endform.dev/app/docs-link?link=settings-keys) Set this as the `ENDFORM_API_KEY` environment variable in your CI system. ## 2. Configure Playwright webServer Configure your `playwright.config.ts` to start your dev server in CI: playwright.config.ts ```typescript import { defineConfig } from '@playwright/test'; export default defineConfig({ webServer: { command: 'npm run dev', url: 'http://localhost:3000', reuseExistingServer: !process.env.CI, }, use: { baseURL: 'http://localhost:3000', }, }); ``` ## 3. Configure your CI pipeline Add these steps to your CI configuration. Examples for popular platforms: .gitlab-ci.yml ```yaml e2e-tests: image: node:20 script: - npm ci - npx endform@latest test variables: ENDFORM_API_KEY: $ENDFORM_API_KEY ``` .circleci/config.yml ```yaml version: 2.1 jobs: e2e: docker: - image: cimg/node:20.0 steps: - checkout - run: npm ci - run: npx endform@latest test environment: ENDFORM_API_KEY: $ENDFORM_API_KEY ``` azure-pipelines.yml ```yaml trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: versionSpec: '20.x' - script: npm ci displayName: 'Install dependencies' - script: npx endform@latest test displayName: 'Run E2E tests' env: ENDFORM_API_KEY: $(ENDFORM_API_KEY) ``` bitbucket-pipelines.yml ```yaml pipelines: default: - step: name: E2E Tests image: node:20 script: - npm ci - npx endform@latest test # Set ENDFORM_API_KEY in repository variables ``` ## 4. Run your pipeline Commit and push your CI configuration. Tests will run on your next pipeline execution. ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Try the Endform demo in any CI with a remote server > Running the Endform demo Playwright tests with other CI/CD platforms against a remote server ## 1. Generate an API key Create an API key to authenticate your CI pipeline with Endform: [Generate API Key in Dashboard →](https://endform.dev/app/docs-link?link=settings-keys) Set this as the `ENDFORM_API_KEY` environment variable in your CI system. ## 2. Configure your CI pipeline Add these steps to your CI configuration. Examples for popular platforms: .gitlab-ci.yml ```yaml e2e-tests: image: node:20 script: - npm ci - npx endform@latest test variables: ENDFORM_API_KEY: $ENDFORM_API_KEY BASE_URL: https://your-server.com ``` .circleci/config.yml ```yaml version: 2.1 jobs: e2e: docker: - image: cimg/node:20.0 steps: - checkout - run: npm ci - run: npx endform@latest test environment: ENDFORM_API_KEY: $ENDFORM_API_KEY BASE_URL: https://your-server.com ``` azure-pipelines.yml ```yaml trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: versionSpec: '20.x' - script: npm ci displayName: 'Install dependencies' - script: npx endform@latest test displayName: 'Run E2E tests' env: ENDFORM_API_KEY: $(ENDFORM_API_KEY) BASE_URL: $(BASE_URL) ``` bitbucket-pipelines.yml ```yaml pipelines: default: - step: name: E2E Tests image: node:20 script: - npm ci - npx endform@latest test # Set ENDFORM_API_KEY in repository variables # Also set BASE_URL to your server URL ``` Make sure to set `BASE_URL` to your server's URL in your CI environment variables. ## 3. Run your pipeline Commit and push your CI configuration. Tests will run on your next pipeline execution. ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Run Playwright tests in any CI against a local server > Running your existing Playwright tests with Endform using other CI/CD platforms against a local server ## 1. Generate an API key Create an API key to authenticate your CI pipeline with Endform: [Generate API Key in Dashboard →](https://endform.dev/app/docs-link?link=settings-keys) Set this as the `ENDFORM_API_KEY` environment variable in your CI system. ## 2. Configure Playwright webServer Configure your `playwright.config.ts` to start your dev server in CI: playwright.config.ts ```typescript import { defineConfig } from '@playwright/test'; export default defineConfig({ webServer: { command: 'npm run dev', url: 'http://localhost:3000', reuseExistingServer: !process.env.CI, }, use: { baseURL: 'http://localhost:3000', }, }); ``` ## 3. Configure your CI pipeline Add these steps to your CI configuration. Examples for popular platforms: .gitlab-ci.yml ```yaml e2e-tests: image: node:20 script: - npm ci - npx endform@latest test variables: ENDFORM_API_KEY: $ENDFORM_API_KEY ``` .circleci/config.yml ```yaml version: 2.1 jobs: e2e: docker: - image: cimg/node:20.0 steps: - checkout - run: npm ci - run: npx endform@latest test environment: ENDFORM_API_KEY: $ENDFORM_API_KEY ``` azure-pipelines.yml ```yaml trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: versionSpec: '20.x' - script: npm ci displayName: 'Install dependencies' - script: npx endform@latest test displayName: 'Run E2E tests' env: ENDFORM_API_KEY: $(ENDFORM_API_KEY) ``` bitbucket-pipelines.yml ```yaml pipelines: default: - step: name: E2E Tests image: node:20 script: - npm ci - npx endform@latest test # Set ENDFORM_API_KEY in repository variables ``` ## 4. Run your pipeline Commit and push your CI configuration. Tests will run on your next pipeline execution. ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Run Playwright tests in any CI against a remote server > Running your existing Playwright tests with Endform using other CI/CD platforms against a remote server ## 1. Generate an API key Create an API key to authenticate your CI pipeline with Endform: [Generate API Key in Dashboard →](https://endform.dev/app/docs-link?link=settings-keys) Set this as the `ENDFORM_API_KEY` environment variable in your CI system. ## 2. Configure your CI pipeline Add these steps to your CI configuration. Examples for popular platforms: .gitlab-ci.yml ```yaml e2e-tests: image: node:20 script: - npm ci - npx endform@latest test variables: ENDFORM_API_KEY: $ENDFORM_API_KEY BASE_URL: https://your-server.com ``` .circleci/config.yml ```yaml version: 2.1 jobs: e2e: docker: - image: cimg/node:20.0 steps: - checkout - run: npm ci - run: npx endform@latest test environment: ENDFORM_API_KEY: $ENDFORM_API_KEY BASE_URL: https://your-server.com ``` azure-pipelines.yml ```yaml trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: versionSpec: '20.x' - script: npm ci displayName: 'Install dependencies' - script: npx endform@latest test displayName: 'Run E2E tests' env: ENDFORM_API_KEY: $(ENDFORM_API_KEY) BASE_URL: $(BASE_URL) ``` bitbucket-pipelines.yml ```yaml pipelines: default: - step: name: E2E Tests image: node:20 script: - npm ci - npx endform@latest test # Set ENDFORM_API_KEY in repository variables # Also set BASE_URL to your server URL ``` Make sure to set `BASE_URL` to your server's URL in your CI environment variables. ## 3. Run your pipeline Commit and push your CI configuration. Tests will run on your next pipeline execution. ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Run Playwright tests in any CI on Vercel previews > Running your existing Playwright tests with Endform using other CI/CD platforms against Vercel preview deployments Caution When using Vercel preview deployments with a CI/CD provider other than GitHub Actions, Endform does not automatically insert the correct Vercel preview URL or deployment protection bypass token. ## 1. Generate an API key Create an API key to authenticate your CI pipeline with Endform: [Generate API Key in Dashboard →](https://endform.dev/app/docs-link?link=settings-keys) Set this as the `ENDFORM_API_KEY` environment variable in your CI system. ## 2. Configure your CI pipeline Add these steps to your CI configuration. Examples for popular platforms: .gitlab-ci.yml ```yaml e2e-tests: image: node:20 script: - npm ci - npx endform@latest test variables: ENDFORM_API_KEY: $ENDFORM_API_KEY BASE_URL: https://your-server.com ``` .circleci/config.yml ```yaml version: 2.1 jobs: e2e: docker: - image: cimg/node:20.0 steps: - checkout - run: npm ci - run: npx endform@latest test environment: ENDFORM_API_KEY: $ENDFORM_API_KEY BASE_URL: https://your-server.com ``` azure-pipelines.yml ```yaml trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: versionSpec: '20.x' - script: npm ci displayName: 'Install dependencies' - script: npx endform@latest test displayName: 'Run E2E tests' env: ENDFORM_API_KEY: $(ENDFORM_API_KEY) BASE_URL: $(BASE_URL) ``` bitbucket-pipelines.yml ```yaml pipelines: default: - step: name: E2E Tests image: node:20 script: - npm ci - npx endform@latest test # Set ENDFORM_API_KEY in repository variables # Also set BASE_URL to your server URL ``` Make sure to set `BASE_URL` to your server's URL in your CI environment variables. ## 3. Run your pipeline Commit and push your CI configuration. Tests will run on your next pipeline execution. ## View your results Once your tests complete, results will appear in the [Endform dashboard](https://endform.dev/app). # Vercel integration > Run Endform tests against Vercel preview deployments ![The code change, preview, test, deploy flow on Vercel](/docs/_astro/vercel-test-deploy.CrZuXmgt_Z1HjGVn.webp) [Install Endform from the Vercel Marketplace](https://vercel.com/marketplace/endform). The Endform Vercel integration helps you to run your Playwright end-to-end test suites against your Vercel deployments. It allows you to: * wait for the correct Vercel preview deployment to be ready * run with deployment protection bypass automatically enabled * register your test run result as a Vercel check The Endform Vercel integration works best with our Github app and Github actions. If you use a different CI provider and would like to run your tests against Vercel, follow [this guide](/docs/guides/getting-started/other-ci/existing/vercel). ## Pages [Installing the Vercel integration](/docs/guides/vercel-integration/installing-the-vercel-integration)Connect GitHub and Vercel, add the workflow step, and configure Playwright. [Frequently asked questions](/docs/guides/vercel-integration/frequently-asked-questions)Answers to common questions about the Vercel integration. # Frequently asked questions > Answers to common questions about the Vercel integration ## How do I log into the Endform dashboard? Go to the Vercel integration settings page for your installation and click **Open in Endform** in the top-right corner. ## What code hosting platforms are supported? The Vercel integration supports [GitHub](/docs/guides/getting-started). If you use another CI/CD provider, follow the [getting started guide for other CI/CD providers](/docs/guides/getting-started/other-ci/existing/vercel). ## Can I run endform locally? Yes. Run the Endform CLI in the standard way: ```sh npx endform@latest test ``` This supports tests against both local dev servers and remote servers. See the [local CLI getting started guide for local dev servers](/docs/guides/getting-started/local-cli/existing/local) or the [local CLI getting started guide for remote servers](/docs/guides/getting-started/local-cli/existing/remote). # Installing the Vercel integration > Connect GitHub and Vercel, add the workflow step, and configure Playwright 1. ### Connect GitHub and Vercel Before adding the workflow, connect both integrations from your organization settings: * [Install the Endform Vercel integration](https://vercel.com/marketplace/endform) so Endform can find Vercel deployments and create Vercel checks. * [Install the Endform GitHub app](https://endform.dev/app/docs-link?link=settings-integrations) for authentication and commit pairing. Your GitHub Actions workflow also needs `id-token: write` in `permissions`. 2. ### Add the workflow step Add `endformdev/actions/run-with-vercel-deployment` before `npx endform@latest test`: .github/workflows/endform-e2e.yml ```yaml name: Run end-to-end tests with Endform on: pull_request: # or push: if you want to run on commits to main branches: - main permissions: contents: read id-token: write # required for authentication with Endform jobs: e2e: runs-on: ubuntu-latest steps: # Your usual setup steps, adjust them to match your project - name: Checkout repository uses: actions/checkout@v7 - name: Install Node uses: actions/setup-node@v7 - name: Set up pnpm (or whichever package manager you use) uses: pnpm/action-setup@v6 with: run_install: true - 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 # Export the preview URL for your playwright.config.ts to pick up - name: Run end-to-end tests with Endform run: npx endform@latest test ``` You can find more documentation of the configuration options for the `run-with-vercel-deployment` action [here](https://github.com/endformdev/actions). 3. ### Configure Playwright Point Playwright at the URL exported by the workflow step: ```ts import { defineConfig } from "@playwright/test"; export default defineConfig({ use: { baseURL: process.env.BASE_URL || "https://your-project.vercel.app", }, }); ``` ## How it works When the workflow runs, Endform matches the GitHub workflow run to the Vercel deployment for the same commit. The action then: * waits until the Vercel deployment is ready * exports the deployment URL as `BASE_URL`, or whichever variable you set with `set-url-env-var` * configures Endform with a Vercel deployment protection bypass token (through [extra headers](/docs/reference/endform-config-ts#extrahttpheaders)) When `npx endform@latest test` starts, Endform creates a Vercel deployment check for that workflow job. The check is marked as running while tests execute, then completed with the test result and a link back to the Endform dashboard. ## Notes * The workflow must include `endformdev/actions/run-with-vercel-deployment` for Endform to connect the Vercel deployment to the test run. * The deployment must come from a Git commit that Endform can match to the GitHub workflow. * Vercel deployment checks created by Endform are currently non-blocking.