Skip to content

Add E2E test infrastructure with Playwright - #64

Merged
liamgold merged 2 commits into
mainfrom
feature/add-e2e-tests
Sep 30, 2025
Merged

Add E2E test infrastructure with Playwright#64
liamgold merged 2 commits into
mainfrom
feature/add-e2e-tests

Conversation

@liamgold

Copy link
Copy Markdown
Owner

Summary

Adds end-to-end testing infrastructure using Playwright and xUnit, with automated post-deployment smoke tests running against production.

Changes

Test Infrastructure

  • Created tests/Goldfinch.Tests.E2E/ project with Playwright and xUnit
  • Added smoke tests for key pages: Home, Blog List, Blog Detail, About, Speaking
  • Tests are content-agnostic and use dynamic content discovery
  • Blog detail tests fetch the first blog post dynamically to avoid hardcoded dependencies
  • Configured to inherit project standards (ImplicitUsings disabled, Nullable enabled)

CI/CD Integration

  • Added .github/workflows/e2e-tests.yml - separate workflow for post-deployment testing
  • Triggers automatically after successful deployment
  • Waits 60 seconds for Azure to stabilize before running tests
  • Tests run against live production site (https://www.goldfinch.me)
  • Uploads test results as artifacts

Configuration

  • Fixed .gitignore pattern *.e2e**/*.e2e to allow .E2E directory
  • Added test dependencies to Directory.Packages.props:
    • Microsoft.Playwright
    • Microsoft.NET.Test.Sdk
    • xUnit packages
    • coverlet.collector
  • Added test project to solution with proper folder structure

Documentation

  • Updated CLAUDE.md with test commands and CI/CD information
  • Added tests/Goldfinch.Tests.E2E/README.md with local testing instructions

Test Coverage

All tests are structural checks (not content-specific):

  • ✅ Pages return 200 status codes
  • ✅ Pages have titles and headings
  • ✅ Navigation elements exist
  • ✅ Blog posts are displayed
  • ✅ No JavaScript console errors
  • ✅ Pagination exists

Local Testing

# Terminal 1 - Start app
cd src/Goldfinch.Web
dotnet run

# Terminal 2 - Run tests
dotnet test tests/Goldfinch.Tests.E2E/Goldfinch.Tests.E2E.csproj

Production Testing

After merging to main:

  1. Deploy workflow runs and deploys to Azure
  2. E2E workflow automatically triggers
  3. Waits 60s for deployment to stabilize
  4. Runs smoke tests against production
  5. Reports results (visible in Actions tab)

🤖 Generated with Claude Code

- Create E2E test project with xUnit and Playwright
- Add content-agnostic smoke tests for key pages (Home, Blog, About, Speaking)
- Tests dynamically fetch first blog post to avoid hardcoded content dependencies
- Configure tests to inherit project standards (ImplicitUsings disabled, Nullable enabled)
- Fix .gitignore to allow .E2E directory (was matching *.e2e pattern)
- Add test dependencies to Directory.Packages.props
- Create separate GitHub Actions workflow for post-deployment testing
- Tests run against production after successful deployment (60s wait)
- Update CLAUDE.md with test and CI/CD documentation

🤖 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 September 30, 2025 22:27

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 adds comprehensive end-to-end testing infrastructure using Playwright and xUnit, with automated post-deployment smoke tests running against production.

  • Adds E2E test project with Playwright for automated browser testing
  • Creates smoke tests for all key pages (Home, Blog, About, Speaking) with content-agnostic validation
  • Implements CI/CD integration that automatically runs tests after successful deployment

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Goldfinch.Tests.E2E/Goldfinch.Tests.E2E.csproj Test project configuration with Playwright and xUnit dependencies
tests/Goldfinch.Tests.E2E/PlaywrightTestBase.cs Base class providing common browser setup and configuration
tests/Goldfinch.Tests.E2E/Pages/*.cs Page-specific test classes for smoke testing key site functionality
tests/Goldfinch.Tests.E2E/README.md Documentation for local testing and project structure
.github/workflows/e2e-tests.yml GitHub Actions workflow for post-deployment testing
Goldfinch.sln Updated solution file to include test project
Directory.Packages.props Added test-related package versions
CLAUDE.md Updated documentation with testing information

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

Comment thread tests/Goldfinch.Tests.E2E/README.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@liamgold
liamgold merged commit 837dc19 into main Sep 30, 2025
4 checks passed
@liamgold
liamgold deleted the feature/add-e2e-tests branch September 30, 2025 22:31
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