How ekanto/ecommerce-test works
Project type and purpose
• This is an automated testing suite (open-source tool) built with Playwright and Node.js, designed to validate the Next.js Commerce demo application.
• It includes E2E, regression, and smoke tests, cross-browser and mobile emulation, CI/CD integration, and rich reporting.
File structure
• Top-level components:
• .github/workflows/test.yml → CI/CD pipeline definition
• playwright.config.js → Test runner configuration
• tests/e2e, tests/regression, tests/smoke → Organized test suites
• pages/* → Page-model abstractions (landingPage.js, productPage.js)
• screenshots/, test-results/ → Artifacts storage
• package.json → Scripts and dependencies
• Patterns:
• Layered architecture separating test orchestration, page abstractions, and CI workflows
• Single test runner (Playwright) driving multiple suites
• External system under test (the live Next.js Commerce app)
README for additional insights
• States baseURL (https://demo.vercel.store), parallel workers, retry strategy
• CI pipeline stages: Smoke → E2E → Regression → Report generation → Artifact upload
• Reporting outputs: HTML, JSON, JUnit, screenshots, video
a. Main components:
1. Test Runner (Playwright)
2. Test Suites (Smoke, E2E, Regression)
3. Page Models (landingPage.js, productPage.js)
4. CI/CD Pipeline (GitHub Actions)
5. Artifact Store (screenshots, videos, HTML reports)
6. Target Application (Next.js Commerce demo)
7. External Services (Browsers: Chromium, Firefox, WebKit)
b. Relationships & interactions:
• CI/CD triggers Playwright test runner on code push or PR
• Playwright reads playwright.config.js & page models, runs tests against the live demo URL
• During each test step, screenshots/videos are captured on failures
• On completion, reports and artifacts are generated and published back to GitHub (Actions tab, PR comments)
c. Architectural patterns & principles:
• Separation of concerns: configuration vs. test logic vs. page models
• Directory-based modularization of test suites
• CI pipeline orchestration with fail-fast on smoke tests, staged testing
• Use of external interfaces (baseURL, environment variables) for flexibility
d. Key technologies & frameworks:
• Node.js & npm for package management
• Playwright for cross-browser automation
• GitHub Actions for CI/CD
• HTML/JSON/JUnit reporters for results