-
Notifications
You must be signed in to change notification settings - Fork 0
Add Playwright E2E testing with MCP configuration #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for fancy-buttercream-bb99cb failed.
|
There was a problem hiding this 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 end-to-end testing infrastructure using Playwright to the Game of Life project. The changes introduce comprehensive E2E test coverage for the UI, automated testing workflows, and development tooling.
- Adds Playwright E2E testing framework with configuration and browser automation
- Creates 4 test suites covering home page, navigation, game controls, and theme toggling
- Sets up GitHub Actions workflow for automated E2E testing on CI
- Updates project documentation to include E2E testing instructions and MCP configuration
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| playwright.config.ts | Configures Playwright test runner with Chromium browser and dev server settings |
| package.json | Adds Playwright dependency and E2E test npm scripts |
| package-lock.json | Locks Playwright package versions and dependencies |
| e2e/home.spec.ts | Tests home page rendering, canvas, controls, and diagnostics display |
| e2e/game-interactions.spec.ts | Tests navigation between Home/About pages and GitHub link |
| e2e/patterns-and-controls.spec.ts | Tests pattern selection and game control functionality |
| e2e/theme.spec.ts | Tests dark/light theme toggling |
| .gitignore | Adds Playwright test artifacts to ignored files |
| .github/workflows/playwright.yml | Configures CI workflow for running E2E tests |
| .github/mcp.json | Configures Playwright MCP server integration |
| README.md | Documents E2E testing setup, commands, and test organization |
| /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
| use: { | ||
| /* Base URL to use in actions like `await page.goto('/')`. */ | ||
| baseURL: 'http://localhost:5173', |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The baseURL is set to port 5173, but the Vite dev server is configured to run on port 3000 (see packages/app/vite.config.ts). This mismatch will cause E2E tests to fail to connect to the dev server. Update to 'http://localhost:3000'.
| /* Run your local dev server before starting the tests */ | ||
| webServer: { | ||
| command: 'npm run dev', | ||
| url: 'http://localhost:5173', |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The webServer url is set to port 5173, but the Vite dev server is configured to run on port 3000 (see packages/app/vite.config.ts). This mismatch will cause Playwright to incorrectly wait for server readiness. Update to 'http://localhost:3000'.
|
|
||
| - name: Build the application | ||
| run: npm run build | ||
|
|
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow builds the application but the Playwright config is set up to run against the dev server (webServer command: 'npm run dev'). Either remove the build step and rely on the dev server, or configure Playwright to test against the production build using 'npm run preview' instead of 'npm run dev'.
| - name: Start production server | |
| run: npm run preview & | |
| env: | |
| NODE_ENV: production | |
| - name: Wait for production server to be ready | |
| run: npx wait-on http://localhost:4173 | |
|
🚀 Preview deployment ready! View your changes at: https://wintermuted.github.io/game-of-life/pr-85/ This preview will be automatically cleaned up when the PR is closed. |
1 similar comment
|
🚀 Preview deployment ready! View your changes at: https://wintermuted.github.io/game-of-life/pr-85/ This preview will be automatically cleaned up when the PR is closed. |
There was a problem hiding this comment.
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.
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| test('should display pattern selector', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| // Check for pattern selector heading | ||
| const patternHeading = page.getByText('Select a Pattern'); | ||
| await expect(patternHeading).toBeVisible(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update pattern selector assertions to match UI
The tests assert that a heading labeled Select a Pattern exists, but neither Home nor PatternSelector renders that text—the UI exposes “Starter Patterns” and “Custom Pattern” tabs with an unlabeled list. This locator therefore never resolves and the Playwright suite fails immediately. Use an accessible selector that actually exists (e.g., the tabs or the list role) rather than a non-existent string. The same assumption is repeated in patterns-and-controls.spec.ts and will fail for the same reason.
Useful? React with 👍 / 👎.
5259b2c to
10b9bc8
Compare
Co-authored-by: wintermuted <2337325+wintermuted@users.noreply.github.com>
Co-authored-by: wintermuted <2337325+wintermuted@users.noreply.github.com>
Co-authored-by: wintermuted <2337325+wintermuted@users.noreply.github.com>
… strategies Co-authored-by: wintermuted <2337325+wintermuted@users.noreply.github.com>
Co-authored-by: wintermuted <2337325+wintermuted@users.noreply.github.com>
10b9bc8 to
070d6b4
Compare
Implements Playwright end-to-end testing framework and configures Playwright MCP for the repository.
Changes
Test Suite (15 tests across 4 files)
e2e/home.spec.ts- Home page, canvas, controls, diagnosticse2e/game-interactions.spec.ts- Navigation and external linkse2e/patterns-and-controls.spec.ts- Pattern selection and game statee2e/theme.spec.ts- Theme toggleConfiguration
playwright.config.ts- Chromium browser, auto dev server startup.github/mcp.json- MCP server configuration.github/workflows/playwright.yml- CI workflow with artifact uploadPackage Scripts
Test Pattern
Uses proper wait strategies instead of fixed timeouts:
Documentation
Updated README with installation instructions, test organization, and configuration details.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.