-
Notifications
You must be signed in to change notification settings - Fork 0
feat(dev/preact): add Playwright testing setup with e2e test coverage #367
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: main
Are you sure you want to change the base?
Conversation
Co-authored-by: maijalintunokka <[email protected]>
| @@ -0,0 +1,76 @@ | |||
|
|
|||
|
|
|||
| <!DOCTYPE html> | |||
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.
@copilot Why is this here? The reports should be excluded from git completely. Update .gitignore.
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.
You're absolutely right! I've removed the Playwright report files from git tracking and updated the .gitignore to exclude /playwright-report/ and /test-results/ directories. These are generated files that should never be committed to version control. Fixed in commit 472cfb9.
dev/preact/PLAYWRIGHT_SETUP.md
Outdated
| @@ -0,0 +1,82 @@ | |||
| # Playwright Testing Setup for dev/preact | |||
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.
@copilot Drop this entire file. It's useless.
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.
Removed the PLAYWRIGHT_SETUP.md file. Fixed in commit 99d9770.
dev/preact/playwright.config.ts
Outdated
| ...devices['Desktop Chrome'], | ||
| // Use system chromium path | ||
| launchOptions: { | ||
| executablePath: '/usr/bin/chromium' |
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.
@copilot Let Playwright install its own browsers, do not rely on the user setup having something available. Chrome may not be installed, or it may be installed at a different path.
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.
Updated the Playwright configuration to remove the hardcoded chromium path. Playwright will now install and manage its own browsers automatically, making it work reliably across different environments. Fixed in commit 99d9770.
Co-authored-by: maijalintunokka <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
…n browsers Co-authored-by: maijalintunokka <[email protected]>
This PR adds a complete Playwright testing setup to the
dev/preactapplication, providing end-to-end test coverage for the Preact-based development environment.What's Added
Testing Infrastructure
playwright.config.ts) with automatic dev server integrationtests/e2e/) separate from unit teststest:e2e,test:e2e:ui)Test Coverage
A comprehensive home page test that validates:
/)Configuration Updates
vite.config.tsto exclude Playwright tests from vitest runner@playwright/testto dev dependenciesplaywright-report/andtest-results/to.gitignoreto prevent generated files from being trackedKey Features
🚀 Zero-configuration testing: Tests automatically start the dev server, run tests, and clean up
🔧 CI/CD ready: Uses Playwright-managed browsers, works reliably in containerized environments
📊 Rich reporting: HTML test reports with screenshots and traces on failures
🔄 Developer friendly: UI mode available for interactive test development
Usage
The setup ensures that both testing frameworks coexist without conflicts, providing comprehensive coverage from unit level to full user workflows. The test validates that the Preact application correctly renders the welcome page with all expected content and interactive elements.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.