This project demonstrates end-to-end (E2E) test automation using Microsoft Playwright against the demo e-commerce website SauceDemo.
It showcases:
- UI testing with Playwright's test runner
- Reusable login logic with
beforeEach() - Cart validation and checkout flow
- Test isolation and grouping with
test.describe()
playwright-portfolio-tests/
├── tests/
│ ├── login.spec.js # Login and inventory verification
│ ├── add-to-cart.spec.js # Cart badge and contents
│ └── checkout-flow.spec.js # End-to-end checkout test
│ └── with-login.spec.js # Showcase of reusable logic in beforeEach()
├── playwright.config.js # Global Playwright settings
├── package.json
├── package-lock.json
└── README.md
git clone https://github.com/Artenes/playwright-portfolio-tests.git
cd playwright-portfolio-testsnpm installnpx playwright installnpx playwright testnpx playwright test tests/add-to-cart.spec.jsnpx playwright show-report- ✅ Login with valid credentials
- ✅ Adding product(s) to the cart
- ✅ Cart badge count validation
- ✅ Navigating to cart and validating item
- ✅ Completing the checkout flow
- ✅ Using
beforeEach()to reuse login logic - ✅ Organized tests with
test.describe()
- Playwright for browser automation
- JavaScript
- HTML reports and auto-screenshots on failure
Artenes Junior Gomes Nogueira
- GitHub: https://github.com/Artenes
- LinkedIn: https://linkedin.com/in/artenes
This project is licensed under the MIT License.