This project demonstrates automated API testing using Playwright for the ReqRes REST API. It showcases best practices in API testing with TypeScript and implements continuous integration using GitHub Actions.
- Automated CI/CD: Runs tests automatically via GitHub Actions
- Comprehensive Test Coverage: Tests all major HTTP methods and response scenarios
- Detailed Reporting: Generates HTML and JSON reports for test results
/users
- List all users with pagination/users/{id}
- Get single user/users?delay={n}
- Test delayed response/unknown
- List all resources/unknown/{id}
- Get single resource
/users
- Create new user/register
- User registration (success/failure scenarios)/login
- User authentication (success/failure scenarios)
/users/{id}
- Update user (full/partial updates)
/users/{id}
- Delete user
- Node.js 18 or higher
- npm or yarn package manager
- Clone the repository:
git clone https://github.com/gdautoqa/playwright-automated-api-tests.git
- Navigate to project directory:
cd playwright-automated-api-tests
- Install dependencies:
npm install
npx playwright test
npx playwright test src/api/specs/user.spec.ts
npx playwright show-report
- HTML Report: Available after test execution at
playwright-report/index.html
- JSON Results: Available at
test-results/results.json
Tests are automatically executed in the following scenarios:
- On every push to the
main
branch - On pull request creation/update targeting
main
- Daily at 7:00 AM Eastern Time (11:00 UTC) on weekdays
- Manually via GitHub Actions workflow dispatch
- Uses Playwright's built-in test fixtures
- Implements proper error handling and logging
- Follows TypeScript best practices
- Maintains test isolation and independence
- Uses data-driven testing approaches
- Implements proper assertion strategies