This project contains the automated test suite for the SauceDemo e-commerce web application. It is developed using Playwright and JavaScript.
my-playwright-project/
├── node_modules/
├── pages/
│ ├── LoginPage.js
│ ├── InventoryPage.js
│ ├── CartPage.js
│ ├── CheckoutPage.js
│ ├── UserProfilePage.js
│ ├── OrderPage.js
│ └── PerformancePage.js
├── playwright-report/
│ └── index.html
├── test-results/
│ ├── screenshots/
│ ├── videos/
│ └── traces/
├── tests/
│ ├── e2e/
│ │ ├── TC01.auth.spec.js
│ │ ├── TC02.inventory.spec.js
│ │ ├── TC03.cart.spec.js
│ │ ├── TC04.checkout.spec.js
│ │ ├── TC05.filter.spec.js
│ │ ├── TC06.profile.spec.js
│ │ ├── TC07.order.spec.js
│ │ └── TC08.performance.spec.js
│ ├── fixtures/
│ │ └── test-data.json
│ └── manual-test-cases/
│ ├── TC01-authentication.md
│ ├── TC02-inventory-management.md
│ ├── TC03-cart-operations.md
│ ├── TC04-checkout-process.md
│ ├── TC05-filtering-searching.md
│ ├── TC06-user-profile.md
│ ├── TC07-order-history.md
│ └── TC08-performance.md
├── utils/
│ ├── test-helpers.js
│ └── test-constants.js
├── .gitignore
├── package.json
├── package-lock.json
├── playwright.config.js
└── README.md
- Install Node.js (v14 or higher)
- Clone the project:
git clone https://github.com/fatihmcicek/playwright-test-project.git
cd playwright-test-project
- Install dependencies:
npm install
- Install Playwright browsers:
npx playwright install
npm test
npx playwright test [test-file]
# Example: npx playwright test TC01.auth.spec.js
npx playwright test --debug
npx playwright test --ui
## 📝 Test Scenarios
### TC01 - Authentication Tests
- Successful login
- Login with invalid credentials
- Locked user validation
### TC02 - Inventory Tests
- Product listing
- Product details
- Adding/removing products
### TC03 - Cart Tests
- Adding items to cart
- Removing items from cart
- Cart updates
### TC04 - Checkout Tests
- Successful order completion
- Form validations
- Order summary validations
### TC05 - Filter Tests
- Product filtering
- Sorting operations
- Search functionality
### TC06 - Profile Tests
- User profile operations
- Session management
- Application state management
### TC07 - Order Tests
- Order processes
- Order summary
- Order completion
### TC08 - Performance Tests
- Page load times
- API response times
- Resource utilization
To view test results:
npx playwright show-report
- Page Object Model (POM) architecture
- Separate test data management
- Detailed manual test scenarios
- Performance metrics measurement
- Comprehensive error handling
- HTML and JSON reporting
- Multi-browser support (Chromium, Firefox)
-
Robust Test Architecture
- Page Object Model for better maintainability
- Reusable components and utilities
- Clear separation of concerns
-
Comprehensive Test Coverage
- End-to-end functional tests
- Performance testing
- Error handling scenarios
- Cross-browser testing
-
Enhanced Reporting
- Detailed HTML reports
- Performance metrics
- Screenshot and video capture on failure
- Trace viewing capabilities
-
Performance Monitoring
- Page load time measurements
- Resource utilization tracking
- API response time monitoring
- Memory usage analysis
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Create a Pull Request
The project uses Playwright's configuration file (playwright.config.js
) for setting up:
- Test timeouts
- Browser configurations
- Parallel execution settings
- Retry mechanisms
- Screenshot and video capture rules
- Proper page load handling
- Efficient selector strategies
- Consistent waiting mechanisms
- Error recovery methods
- Test isolation
- Clean test data management
This project is licensed under the MIT License.
Project Owner - Linkedin: @fatihcicek
Project Link: https://github.com/fatihcicek/playwright-test-project
- Ensure all dependencies are installed before running tests
- Chrome and Firefox browsers should be installed on the system
- Node.js version 14 or higher is required
- Some tests require specific test data that is included in the fixtures
Please check the Issues page for current known issues and planned enhancements.
- SauceDemo for providing the test application
- Playwright team for the excellent testing framework
- All contributors who have helped with the project