Skip to content

Add GitHub Actions workflow for Playwright E2E tests#174

Merged
TheEagleByte merged 2 commits intomainfrom
feature/add-e2e-ci-workflow
Oct 3, 2025
Merged

Add GitHub Actions workflow for Playwright E2E tests#174
TheEagleByte merged 2 commits intomainfrom
feature/add-e2e-ci-workflow

Conversation

@TheEagleByte
Copy link
Copy Markdown
Owner

@TheEagleByte TheEagleByte commented Oct 3, 2025

Summary

This PR adds automated Playwright E2E testing to the CI/CD pipeline, ensuring tests run on every pull request before merging.

Changes

  • ✅ Created .github/workflows/e2e.yml workflow file
  • ✅ Configured to run on PRs to main and develop branches
  • ✅ Tests run on Chromium browser for fast feedback (~5-10 minutes)
  • ✅ Caches npm dependencies and Playwright browsers for performance
  • ✅ Uploads test artifacts (screenshots, videos, traces, HTML report) on failure
  • ✅ Uses GitHub secrets for Supabase configuration
  • ✅ Manual workflow dispatch trigger available

Setup Required ⚙️

Before merging, add the following secrets in GitHub repository settings (Settings → Secrets and variables → Actions):

  1. NEXT_PUBLIC_SUPABASE_URL - Your Supabase project URL
  2. NEXT_PUBLIC_SUPABASE_ANON_KEY - Your Supabase anonymous key

These should point to a test/staging Supabase project, not production.

Benefits 🎯

  • Catch regressions early - Tests run before code is merged
  • Automated testing - No manual E2E testing needed for PRs
  • Fast feedback - Chromium-only tests complete in 5-10 minutes
  • Easy debugging - Test artifacts (screenshots, videos, traces) uploaded on failure
  • PR annotations - Test results appear directly in PR checks

Future Enhancements 🚀

This can be expanded later to:

  • Run full cross-browser suite (Firefox, WebKit, Mobile) on merge to main
  • Add scheduled nightly runs for comprehensive testing
  • Run different test suites based on PR labels
  • Add performance benchmarking

Test Plan

  • Workflow file follows GitHub Actions best practices
  • Uses proper caching for speed optimization
  • Playwright config already optimized for CI (forbidOnly, retries, GitHub reporter)
  • Test users are created dynamically (no pre-seeding needed)
  • Verify workflow runs successfully on this PR (requires secrets configuration)

Recommended: Branch Protection

Consider requiring this workflow to pass before merging:

  1. Go to Settings → Branches → Branch protection rules
  2. Add rule for main (and develop)
  3. Check "Require status checks to pass before merging"
  4. Select "Playwright E2E Tests" from the status checks list

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Runs automated end-to-end Chromium browser tests on PRs to main/develop and via manual trigger.
    • Test runs produce preserved artifacts and reports for 7 days to aid troubleshooting.
  • Chores

    • CI optimized with dependency and browser caching to speed runs (cache keyed to OS + lockfile).
    • Environment variables supplied via secure secrets for test execution.
    • Removed prior HTML report artifact step.

Add automated E2E testing to CI/CD pipeline that runs on pull requests.

Changes:
- Create .github/workflows/e2e.yml workflow
- Run Playwright tests on PRs to main/develop branches
- Test on Chromium browser for fast feedback (~5-10 min)
- Cache npm dependencies and Playwright browsers
- Upload test artifacts (screenshots, videos, traces) on failure
- Use GitHub secrets for Supabase configuration

Setup Required:
Add the following secrets in GitHub repository settings:
- NEXT_PUBLIC_SUPABASE_URL
- NEXT_PUBLIC_SUPABASE_ANON_KEY

Benefits:
- Catches regressions before merge
- Automated browser testing on every PR
- Test results annotated in PR checks
- Debug artifacts available when tests fail

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 3, 2025 20:04
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 3, 2025

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

Project Deployment Preview Comments Updated (UTC)
scrumkit Ready Ready Preview Comment Oct 3, 2025 8:10pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 3, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds/updates a GitHub Actions workflow to run Playwright end-to-end tests on PRs to main/develop and via manual dispatch. Configures Node.js 20, installs dependencies, caches Playwright browsers, conditionally installs Chromium browsers/deps, runs Chromium-only tests with CI and Supabase secrets, and uploads artifacts on failure.

Changes

Cohort / File(s) Summary
CI/CD: E2E Playwright Workflow
\.github/workflows/e2e.yml
Adds/updates an e2e workflow triggered by PRs to main/develop and workflow_dispatch. Sets up Node 20 with npm cache, runs npm ci, caches Playwright browsers (keyed by OS + lockfile), installs Chromium browsers on cache miss or deps on cache hit, runs npm run test:e2e --project=chromium with CI, SUPABASE_URL, and SUPABASE_ANON_KEY from secrets, and uploads playwright-report/ and test-results/ on failure (7-day retention). Removes prior HTML report artifact step.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant Job as e2e-tests (ubuntu-latest)
  participant PW as Playwright (chromium)
  participant Art as Artifacts

  Dev->>GH: Open PR to main/develop or manual dispatch
  GH->>Job: Start workflow (timeout 20m)

  Job->>Job: Checkout repository
  Job->>Job: Setup Node.js 20.x (npm cache)
  Job->>Job: npm ci
  Job->>Job: Restore Playwright browser cache
  alt Cache miss
    Job->>PW: Install Chromium browsers
  else Cache hit
    Job->>PW: Install Chromium deps only
  end
  Job->>PW: Run tests (npm run test:e2e --project=chromium) with CI + Supabase secrets

  alt Tests fail
    Job->>Art: Upload `playwright-report/` & `test-results/` (7 days)
  else Tests pass
    Job->>GH: Mark job success
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through commits with a testing cheer,
Chromium carrots lined up near.
Cache my browsers, skip the stall,
Reports collect if tests should fall.
A rabbit thumbs the PR clear. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly summarizes the primary change by indicating the addition of a GitHub Actions workflow specifically for Playwright end-to-end tests, matching the contents and objectives of the PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dac88f7 and ce8da33.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yml (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds automated Playwright E2E testing to the CI/CD pipeline through a GitHub Actions workflow, ensuring end-to-end tests run on every pull request to provide early regression detection before code is merged.

  • Created GitHub Actions workflow for automated E2E testing on pull requests
  • Configured Chromium-only testing for fast feedback with caching optimizations
  • Added test artifact uploads and GitHub secrets integration for Supabase configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a1db61 and dac88f7.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Playwright E2E Tests

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TheEagleByte TheEagleByte merged commit 4343b98 into main Oct 3, 2025
4 of 5 checks passed
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.

2 participants