End-to-end test automation suite for the Henckels e-commerce platform, built with CodeceptJS and Playwright. This project covers checkout flows, payment methods, promo codes, and more, with support for multi-device and multi-environment testing.
- Features
- Prerequisites
- Setup
- Usage
- Test Structure
- Environment Variables
- Reporting
- Contributing
- License
- Page Object Model for maintainable test code
- Multi-environment support (
next
,staging
,prod
) - Multi-device/browser testing (desktop, tablet, mobile)
- Allure reporting integration
- Email and data helpers (MailSlurp, Faker)
- Docker support for CI/CD
- Node.js (v16 or later recommended)
- npm or yarn
- Docker (optional, for containerized runs)
- MailSlurp account (for email testing)
-
Clone the repository:
git clone https://github.com/your-org/henckels-automation.git cd henckels-automation/henckels-automation
-
Install dependencies:
npm install # or yarn install
-
Configure environment variables:
Copy
.env.example
to.env
and fill in the required values:cp .env.example .env
Example
.env
values:NODE_ENV=staging HEADLESS=true BROWSER=chromium MAILSLURP_API_KEY=your-mailslurp-api-key
-
Smoke tests:
npm run test:smoke
-
Regression tests:
npm run test:regression
-
Environment-specific:
npm run test:next npm run test:staging npm run test:prod
-
Device-specific:
npm run test:mobile npm run test:tablet npm run test:desktop
-
Parallel execution:
npm run test:parallel
-
Multi-device execution:
npm run test:multi-device
-
Headless mode:
npm run test:headless
-
Dockerized run:
npm run test:docker
-
Generate report:
npm run report:generate
-
Open report:
npm run report:open
pages/
— Page Object Models (e.g.,CheckoutPage.js
)tests/
— Test suites (*_test.js
)helpers/
— Custom helpers (e.g.,DataHelper.js
,MailSlurpHelper.js
)components/
— Shared UI componentsoutput/
— Test artifacts (screenshots, logs)allure-results/
— Allure raw results
Set these in your .env
file:
Variable | Description |
---|---|
NODE_ENV | Test environment (next , staging , prod ) |
HEADLESS | Run browser in headless mode (true /false ) |
BROWSER | Browser to use (chromium , firefox , webkit ) |
SCREEN_SIZE | Device size (desktop , tablet , mobile ) |
MAILSLURP_API_KEY | API key for MailSlurp email testing |
- Fork the repository
- Create a new branch
git checkout -b feature/your-feature
- Make your changes
- Write or update tests
- Run tests locally
npm test
- Commit and push
git commit -m "Describe your change"
git push origin feature/your-feature
- Open a Pull Request on GitHub
Code style:
- Follow existing patterns and naming conventions.
- Use async/await for asynchronous operations.
- Prefer data-test or data-testid attributes for selectors.