This project is a comprehensive test automation framework built using Playwright and TypeScript. It supports both API and UI testing with a well-structured architecture.
├── apis/ # API endpoints implementation
│ ├── books-api.ts
│ └── index.ts
├── constants/ # Constant values and methods
│ ├── constants.ts
│ └── methods.ts
├── fixtures/ # Test fixtures for API and UI tests
│ ├── api-fixtures.ts
│ └── test-fixtures.ts
├── helpers/ # Helper utilities
│ └── api-client/
│ └── api-client.ts
├── models/ # Data models
│ ├── books-model.ts
│ └── cred-model.ts
├── pages/ # Page Object Models
│ ├── cred-page.ts
│ ├── login-page.ts
│ └── manager-page.ts
└── tests/ # Test suites
├── api-tests/
│ └── books-api.spec.ts
└── ui-tests/
├── login-page.spec.ts
└── manager-page.spec.ts
- TypeScript Support: Fully typed codebase for better maintainability
- API Testing: Dedicated structure for API automation testing
- UI Testing: Page Object Model implementation for UI testing
- Parallel Execution: Tests can run in parallel for faster execution
- HTML Reports: Built-in HTML reporter for better test results visualization
- Fixtures: Custom fixtures for both API and UI tests
- Modular Architecture: Well-organized code structure with separation of concerns
- Node.js (Latest LTS version recommended)
- npm or yarn package manager
- Clone the repository
- Install dependencies:
npm installTo run all tests:
npx playwright testTo run specific test files:
npx playwright test tests/api-tests/books-api.spec.tsTo run UI tests:
npx playwright test tests/ui-tests/The project uses playwright.config.ts for configuration with the following key settings:
- Parallel test execution enabled
- HTML reporter
- Retry mechanism for CI environment
- Custom timeout settings
- Custom API client implementation
- Response models and types
- API endpoints segregation
- API fixtures for better test organization
- Page Object Model implementation
- Reusable page components
- UI test fixtures
- Login and manager page tests
Test reports are generated in HTML format and can be found in:
playwright-report/index.html
- Use TypeScript for all new code
- Follow the existing project structure for new tests
- Utilize the provided helpers and utilities
- Implement proper page objects for new UI tests
- Use models for API response handling
Private repository - All rights reserved