A modern testing framework built with Playwright for end-to-end testing of web applications with comprehensive reporting capabilities.
- Visual Testing - Screenshot comparison and visual regression testing
- API Testing - RESTful API endpoint testing with validation
- Mobile Testing - Responsive design and mobile device simulation
- Parallel Execution - Run tests concurrently for faster feedback
- Rich Reporting - HTML, JSON, and JUnit reports
- CI/CD Integration - GitHub Actions workflow included
- Playwright - Modern web testing framework
- TypeScript - Type-safe test development
- Node.js - Runtime environment
- HTML Reports - Beautiful test result visualization
- GitHub Actions - Automated testing pipeline
- Postman - API testing collection
- Node.js 18+ installed
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd webapp-testing-project
-
Install dependencies
npm install
-
Install Playwright browsers
npm run install:browsers
-
Configure environment (optional)
cp .env.example .env # Edit .env file with your specific settings
npm test# Visual tests
npm run test:visual
# API tests
npm run test:api
# Mobile tests
npm run test:mobile# Run tests with UI mode
npm run test:ui
# Run tests in headed mode (see browser)
npm run test:headed
# Debug mode
npm run test:debugnpm run test:reportwebapp-testing-project/
├── tests/
│ ├── visual/ # Visual regression tests
│ ├── api/ # API endpoint tests
│ ├── mobile/ # Mobile responsive tests
│ └── example.spec.ts # Getting started examples
├── postman/ # Postman collection
├── .github/workflows/ # CI/CD pipeline
├── playwright.config.ts # Playwright configuration
└── package.json # Dependencies and scripts
test("should match homepage screenshot", async ({ page }) => {
await page.goto("/");
await expect(page).toHaveScreenshot("homepage.png");
});test("should get all posts", async ({ request }) => {
const response = await request.get("${API_BASE_URL}/posts");
expect(response.status()).toBe(200);
});test("should work on iPhone 12", async ({ browser }) => {
const context = await browser.newContext({
...devices["iPhone 12"],
});
const page = await context.newPage();
await page.goto("/");
});The project includes a GitHub Actions workflow that:
- Runs on push/PR to main branch
- Installs dependencies and browsers
- Executes all tests in parallel
- Uploads test reports as artifacts
- Supports multiple browsers (Chromium, Firefox, WebKit)
Import the Postman collection from postman/JSONPlaceholder-API-Tests.postman_collection.json to test API endpoints manually or integrate with Postman's CLI runner.
- Create test files in appropriate directories (
tests/visual/,tests/api/,tests/mobile/) - Follow existing naming convention:
*.spec.ts - Use Playwright's testing patterns and assertions
- Modify
playwright.config.tsfor global settings - Update browser configurations, timeouts, and reporters
- Add new test projects for different environments
BASE_URL- Target application URLAPI_BASE_URL- API endpoint base URLHEADLESS- Run browsers in headless modeSLOW_MO- Add delay between actions for debugging
- Playwright Documentation
- Playwright Test Best Practices
- Visual Testing Guide
- API Testing with Playwright
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
MIT License - feel free to use this project for learning and development purposes.
Happy Testing! 🎭