-
Notifications
You must be signed in to change notification settings - Fork 678
feat(tests): Enhance Playwright test suite #231
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
feat(tests): Enhance Playwright test suite #231
Conversation
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 introduces comprehensive traffic simulation tests for the Playwright test suite, significantly expanding test coverage with security testing, multiple test categories, and TypeScript support. The changes standardize configuration management across all tests and add realistic user behavior simulations.
Key changes include:
- Added comprehensive traffic simulation tests (casual browsers, single-item buyers, malicious buyers)
- Implemented TypeScript support with centralized configuration management
- Enhanced test structure with organized e2e tests and documentation
- Added security testing capabilities including SQL injection, XSS, and URL manipulation protection
Reviewed Changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/traffic/single-item-buyer.spec.ts | New traffic simulation tests for focused purchasing behaviors |
| tests/traffic/malicious-buyer.spec.ts | Security testing suite with various attack simulations |
| tests/traffic/casual-browser.spec.ts | Browsing behavior simulation with retry logic |
| tests/traffic/README.md | Comprehensive documentation for traffic simulation tests |
| tests/test-config.ts | TypeScript configuration module for shared test settings |
| tests/test-config.js | JavaScript configuration module for test environments |
| tests/playwright.config.ts | Updated Playwright configuration with new test patterns |
| tests/package.json | Enhanced package dependencies and npm scripts |
Files not reviewed (1)
- tests/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)
tests/package.json:10
- TypeScript version 5.8.3 does not exist. The latest TypeScript version as of January 2025 was 5.x series but 5.8.3 is not a valid version. Consider using a stable release like "^5.6.0" or "^5.7.0".
"typescript": "^5.8.3"
tests/package.json:15
- @types/node version 22.16.5 appears to be non-existent. Node.js types typically follow semantic versioning but this specific patch version may not exist. Consider using a verified version like "^22.15.0" or "^22.16.0".
"@types/node": "^22.16.5"
|
/test-e2e |
|
🚀 @pauldotyu Starting E2E tests... Workflow Run: 16631284349 |
|
❌ @pauldotyu E2E tests failed! Workflow Run: 16631284349 Please check the workflow logs for details and try again. |
|
Looking at the test run logs, it looks like the UI either isn't loading the product data or the product data isn't being returned in time - https://playwright.microsoft.com/workspaces/westus3_f54d59c1-c74e-441a-9a9a-5fdbcf7deb1c/runs/56879c61c54dd4c69f035def50a229e16833342e/tests/7b8b2e36-4e07-44dc-8575-77e8fb745ab5 |
|
For CI, if you'd like, we could strip it back to the basic test runs (which would be closer to the previous test coverage) for both the store-front and store-admin and leave the other tests for local usage. |
… simulations - Added TypeScript support and updated dependencies in package.json. - Introduced detailed test configurations for store admin and storefront. - Created a structured test suite for traffic simulations, including: - Casual Browser tests simulating various shopper behaviors. - Malicious Buyer tests to validate security against common vulnerabilities. - Single Item Buyer tests for focused purchasing scenarios. - Implemented retry logic for navigation and interactions to improve test reliability. - Documented test categories and usage instructions in README files. - Ensured graceful handling of non-existent products and malicious inputs.
cd7d276 to
6c8ffcc
Compare
|
/test-e2e |
|
🚀 @smurawski Starting E2E tests... Workflow Run: 16657664455 |
|
✅ @smurawski E2E tests completed successfully! Workflow Run: 16657664455 All tests passed and resources have been cleaned up. |
pauldotyu
left a comment
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.
Nice @smurawski! This is extremely useful.
Co-authored-by: Copilot <[email protected]>
with comprehensive traffic simulations
Purpose
Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
What to Check
Verify that the following are valid
Other Information