Skip to content

Introduce Playwright E2E testing infrastructure#29

Merged
mahata merged 3 commits intomainfrom
copilot/fix-28
Jul 10, 2025
Merged

Introduce Playwright E2E testing infrastructure#29
mahata merged 3 commits intomainfrom
copilot/fix-28

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jul 9, 2025

This PR introduces comprehensive end-to-end (E2E) testing infrastructure using Playwright to ensure the application works correctly from a user's perspective.

Changes Made

🧪 E2E Testing Setup

  • Added Playwright dependency: Installed @playwright/test as a dev dependency
  • Created E2E test directory: Added e2e/ directory with initial test suite
  • Playwright configuration: Added playwright.config.ts with optimized settings for CI/CD
  • Test script: Added pnpm test:e2e command for easy test execution

📋 Test Coverage

The E2E test (e2e/app.spec.ts) verifies core functionality:

  • ✅ Application renders correctly at root URL
  • ✅ "Hello, world!" heading is displayed prominently
  • ✅ Page title shows "MLack - Real-time Chat"
  • ✅ Chat interface elements are present and visible (message input, send button, messages area)

🔧 CI/CD Integration

  • GitHub Actions workflow: Added dedicated E2E test job that runs on every push/PR
  • Browser installation: Automated Chromium browser setup in CI
  • Test artifacts: Configured automatic collection of screenshots and traces on failure
  • Parallel execution: Unit tests and E2E tests run in separate jobs for efficiency

📚 Configuration Updates

  • Vitest exclusion: Updated vitest.config.ts to exclude E2E tests from unit test runs
  • Git ignore: Added Playwright test artifacts to .gitignore
  • Documentation: Updated README.md with comprehensive testing section and project structure

🖼️ Application Preview

MLack Homepage

Usage

# Run E2E tests locally
pnpm test:e2e

# Run unit tests (unchanged)
pnpm test:run

# All tests pass and maintain existing functionality

Benefits

  • Quality assurance: Automated verification that the application works from user perspective
  • Regression prevention: E2E tests catch issues that unit tests might miss
  • CI confidence: Every PR is automatically tested end-to-end
  • Developer experience: Easy local testing with artifacts for debugging failures

The infrastructure is minimal, focused, and follows the project's existing patterns using pnpm, TypeScript, and Biome for consistency.

Fixes #28.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@mahata mahata marked this pull request as ready for review July 9, 2025 14:38
Copilot AI and others added 2 commits July 9, 2025 14:41
Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
Copilot AI changed the title [WIP] Introduce Playwright E2E testing infrastructure Introduce Playwright E2E testing infrastructure Jul 9, 2025
Copilot AI requested a review from mahata July 9, 2025 14:52
Copilot finished work on behalf of mahata July 9, 2025 14:52
@mahata mahata merged commit 4503085 into main Jul 10, 2025
4 checks passed
@mahata mahata deleted the copilot/fix-28 branch July 10, 2025 01:30
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.

Introduce Playwright E2E testing infrastructure

2 participants