Skip to content

ci: add Playwright preview testing pipeline#311

Merged
ben-fornefeld merged 14 commits into
mainfrom
test/playwright-preview-testing
May 3, 2026
Merged

ci: add Playwright preview testing pipeline#311
ben-fornefeld merged 14 commits into
mainfrom
test/playwright-preview-testing

Conversation

@ben-fornefeld

@ben-fornefeld ben-fornefeld commented May 3, 2026

Copy link
Copy Markdown
Member

Summary

  • add a Playwright preview E2E pipeline triggered by deployment_status and targeting Vercel preview URLs
  • split preview tests into common, dev, and pr suites with shared baseline coverage for baseURL validation, auth setup, and auth-state reuse
  • make local Playwright runs first-class (localhost default + mode-aware env validation) while keeping PR mode strict
  • consolidate CI workflows into Code Quality and Test, enable colorized logs, and add Bun/Playwright caching
  • migrate Vitest suites to root tests/ (unit, integration, development) and remove unused Vitest E2E setup
  • harden preview CI behavior by checking out github.event.deployment.sha, tightening preview job targeting, and isolating concurrency groups per deployment

Run browser e2e checks against successful Vercel preview deployments so protected staging-backed PR previews are validated before merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings May 3, 2026 03:40
@vercel

vercel Bot commented May 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment May 3, 2026 7:08am
web-juliett Ready Ready Preview, Comment May 3, 2026 7:08am

Request Review

@cursor

cursor Bot commented May 3, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Medium risk because it changes CI workflows and test execution paths (including new deployment_status-triggered Playwright runs), which can cause unexpected CI failures or skipped coverage if misconfigured.

Overview
Adds a new Playwright-based preview E2E pipeline that runs on successful deployment_status events, targets Vercel preview URLs, reuses an authenticated storage state, and uploads Playwright reports/artifacts.

Consolidates CI by replacing separate lint.yml/format.yml with a single code-quality.yml, updates test.yml to use Bun v2 with dependency caching, and extends sync-infra-specs.yml with consistent Bun versioning and caching.

Migrates Vitest suites from src/__test__ to a top-level tests/ layout, updates vitest.config.ts and npm scripts accordingly, removes the old Vitest E2E placeholder + env schema, and introduces scripts/check-playwright-env.ts plus a new playwright.config.ts for mode-aware (dev vs PR) runs.

Reviewed by Cursor Bugbot for commit af46340. Bugbot is set up for automated code reviews on this repo. Configure here.

Apply formatter output to keep the new Playwright env validation file consistent with repository formatting conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a first-pass Playwright preview E2E pipeline for the dashboard repo, aimed at running a lightweight browser check when Vercel preview deployments report a successful deployment_status. It adds the Playwright tooling, environment validation, and a GitHub Actions workflow so preview checks can run alongside the existing Bun/Vitest-based test setup.

Changes:

  • Added Playwright configuration, dependency wiring, package scripts, and ignored output directories.
  • Added a dedicated Playwright environment validation script and a minimal preview smoke spec.
  • Added a GitHub Actions workflow that runs on successful non-production deployment status events and uploads Playwright artifacts.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/check-playwright-env.ts Adds Playwright-specific env validation for preview runs.
playwright.config.ts Defines Playwright test directory, browser project, base URL, and Vercel bypass header support.
package.json Adds Playwright dependency and scripts for browser install and test execution.
e2e/preview-config.spec.ts Introduces the initial preview smoke/harness spec.
bun.lock Locks the new Playwright packages and transitive dependency updates.
.gitignore Ignores Playwright reports and test output artifacts.
.github/workflows/e2e-playwright-preview.yml Adds the preview-deployment workflow that installs dependencies, runs Playwright, and uploads artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/check-playwright-env.ts
Comment thread e2e/preview-config.spec.ts Outdated
Comment thread e2e/preview-config.spec.ts Outdated
Comment thread scripts/check-playwright-env.ts
Comment thread scripts/check-playwright-env.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a1b4fd879

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/e2e.yml Outdated
Comment thread e2e/preview-config.spec.ts Outdated
Comment thread .github/workflows/e2e.yml
Comment thread .github/workflows/e2e.yml
ben-fornefeld and others added 2 commits May 2, 2026 22:46
Separate local development Playwright checks from PR-gated preview checks so agents can add many localhost-focused tests without slowing merge validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run shared validation and auth state bootstrap tests in both dev and PR modes while keeping workflow logs colorized.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread package.json Outdated
Comment thread scripts/check-playwright-env.ts Outdated
Validate the base URL from Playwright project config so regressions in use.baseURL wiring are caught.

Co-authored-by: Cursor <cursoragent@cursor.com>
Standardize workflow naming, move to setup-bun v2, and add Bun/Playwright caches to speed CI runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Combine lint and format into one code-quality workflow with split jobs and include the lint-safe Playwright validation test update.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run all test checks from a single workflow with separate Unit, Integration, and Preview jobs for clearer status grouping.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread .github/workflows/test.yml Outdated
Move Vitest and Playwright suites under tests/*, remove unused vitest e2e placeholder wiring, and update configs/docs/scripts to the new test layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update the proxy integration test import to reference next.config.mjs from the new tests directory structure.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread vitest.config.ts
Ensure Playwright runs with the intended mode and preview jobs check out the deployed SHA, while preventing Vitest from picking up Playwright specs.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c5323ca. Configure here.

Comment thread .github/workflows/test.yml Outdated

@matthewlouisbrockman matthewlouisbrockman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice playwright! i like to have -test in the names but not breaker

Use a stable preview-environment concurrency group so cancel-in-progress can terminate stale preview runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Separate deployment_status Playwright runs from unit and integration CI so each trigger executes only relevant jobs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update integration job dependency to match the renamed unit job id in test workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ben-fornefeld ben-fornefeld changed the title test: add Playwright preview e2e pipeline ci: add Playwright preview testing pipeline May 3, 2026
@ben-fornefeld ben-fornefeld merged commit 4f249ee into main May 3, 2026
12 checks passed
@ben-fornefeld ben-fornefeld deleted the test/playwright-preview-testing branch May 3, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants