A comprehensive test suite for API and E2E testing using Playwright.
- 📡 API Testing
- 🌐 E2E Testing
- 📊 HTML Reports
- 🔄 Retry Mechanism
- 🧩 Modular Structure
- 🧹 Code Formatting (Prettier)
- 🔍 Code Linting (ESLint)
- �� Git Hooks (Husky)
- 🤖 CI/CD (GitHub Actions)
- Node.js (v16 or higher)
- npm or yarn
- Git
# Install dependencies
npm install
# or
yarn install
# Initialize Git hooks
npm run preparesuber-tests/
├── src/
│ ├── api/ # API-specific code
│ │ ├── factories.ts
│ │ └── users.ts
│ ├── e2e/ # E2E-specific code
│ └── core/ # Shared code
│ └── user.ts
├── tests/ # Test files
│ ├── api/
│ └── e2e/
├── .github/ # GitHub Actions workflows
├── .husky/ # Git hooks
├── playwright.config.ts
├── .eslintrc.json # ESLint configuration
├── .prettierrc # Prettier configuration
└── package.json
# Run all tests
npm test
# Run API tests
npm run test:api
# Run E2E tests
npm run test:e2e
# Generate report
npm run report# Run ESLint
npm run lint
# Fix ESLint issues
npm run lint:fix
# Format code with Prettier
npm run formatThe project uses Husky and lint-staged to ensure code quality before commits:
- Pre-commit hook runs linting and formatting on staged files
- Automatically fixes formatting issues
- Prevents commits with linting errors
The project uses GitHub Actions to ensure code quality:
- Runs on every Pull Request to master branch
- Checks for linting errors
- Verifies code formatting
- Fails if code doesn't meet quality standards
Environment variables:
API_BASE_URL: Base URL for API tests (default: http://localhost:3030)UI_BASE_URL: Base URL for E2E tests (default: http://localhost:3000)
Test reports are generated in the playwright-report directory. To view them:
npm run report- For API tests: Add files in
tests/api/ - For E2E tests: Add files in
tests/e2e/
- API-specific utilities:
src/api/ - E2E-specific utilities:
src/e2e/ - Shared utilities:
src/core/
This project is licensed under the ISC License.