This project contains UI and API automation test scenarios implemented using Playwright with TypeScript following the Page Object Model (POM) design pattern.
The framework includes end-to-end UI automation, API validation, reusable page classes, test data management, environment-based execution, reporting, and Jenkins CI integration.
- End-to-end web application testing
- Cross-browser testing (Chromium, Firefox, WebKit)
- Page Object Model (POM) implementation
- Reusable page methods and utilities
- Data-driven testing using JSON files
- Parallel test execution
- Environment-based configuration
- Robust locator strategies for reliable execution
- REST API testing using Playwright Request Context
- GET, POST, PUT, PATCH, DELETE request validation
- Response status code validation
- Authentication handling
- JSON schema validation
- Request and response assertions
- Data extraction and chaining between APIs
- Jenkins pipeline integration
- Automated test execution
- Continuous regression testing
- Automated report generation
- Faster feedback for development teams
- Playwright
- TypeScript
- Node.js
- Jenkins
- Git & GitHub
- Dotenv (Environment Variable Management)
This framework follows the Page Object Model (POM) approach for better maintainability, scalability, and reusability.
- Pages → Reusable page classes
- Tests → Test execution logic
- Fixtures → Shared setup and teardown
- Utilities → Common reusable functions
- Test Data → JSON-based test data management
- Environment Variables → Secure configuration using
.env
project-root/
│── tests/
│ ├── ui/
│ ├── api/
│
│── pages/
│ ├── LoginPage.ts
│ ├── DashboardPage.ts
│ ├── BasePage.ts
│
│── fixtures/
│
│── utils/
│
│── test-data/
│ ├── data.json
│
│── reports/
│
│── .env
│── .gitignore
│── package.json
│── playwright.config.ts
│── Jenkinsfile
│── README.mdInstall dependencies:
npm installInstall Playwright browsers:
npx playwright installCreate a .env file in project root and add:
BASE_URL=https://your-application-url.com
USERNAME=testuser
PASSWORD=testpassword
API_BASE_URL=https://api.example.comRun all tests:
npx playwright testRun only UI tests:
npx playwright test tests/uiRun only API tests:
npx playwright test tests/apiRun tests in headed mode:
npx playwright test --headedRun tests in a specific browser:
npx playwright test --project=chromiumThe framework supports automated execution through Jenkins.
- Pull latest code from GitHub
- Install project dependencies
- Install Playwright browsers
- Execute test suite
- Generate reports
- Publish results
npm install
npx playwright install
npx playwright testGenerate and open Playwright HTML Report:
npx playwright show-report- Playwright HTML Reports
- Trace Viewer
- Screenshot capture on failures
- Video recording support
- Detailed execution logs
View traces:
npx playwright show-trace trace.zip- UI & API Automation in a single framework
- Page Object Model (POM)
- Reusable utilities and fixtures
- Environment-based execution
- Data-driven testing
- Cross-browser testing
- Parallel execution
- Jenkins CI integration
- Scalable and maintainable architecture