An open API service indexing awesome lists of open source software.

https://github.com/rennanreis/web-automation-suite

End-to-end automation tests for Swag Labs using Playwright.
https://github.com/rennanreis/web-automation-suite

ci-cd devops-tools e2e-testing github-actions page-object-model playwright qa-automation software-quality test-automation typescript

Last synced: about 2 months ago
JSON representation

End-to-end automation tests for Swag Labs using Playwright.

Awesome Lists containing this project

README

          

# Web Automation Suite

![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)
![Status: Portfolio](https://img.shields.io/badge/status-portfolio-blue)
![Last Update](https://img.shields.io/badge/last%20update-May%202025-brightgreen)

> ⚠️ This project is part of a personal portfolio and is not open to external contributions (pull requests or issues) at this time.

An end-to-end test automation suite for the [Sauce Labs Demo Site](https://www.saucedemo.com/) using Playwright and TypeScript.
It demonstrates modern QA practices like Page Object Model, custom fixtures, reusable test flows, and future-proof structure.

---

## πŸš€ Quick Start

```bash
# Clone the repo
git clone https://github.com/your-username/web-automation-suite

# Install dependencies
npm install

# Run all tests
npx playwright test

# Run a specific test
npx playwright test tests/cart.spec.ts

# Run in headed mode
npx playwright test --headed

# Launch test runner UI
npx playwright test --ui
```
---

## Repository Structure

```
β”œβ”€β”€ page-objects/ # Page Object Model definitions
β”œβ”€β”€ fixtures/ # Custom test fixtures (auth, data, setup)
β”œβ”€β”€ tests/ # Individual test files
β”œβ”€β”€ playwright.config.ts # Playwright configuration
β”œβ”€β”€ README.md # Project documentation
```

---

## βœ… Covered Test Scenarios

- **Login:** Valid, invalid and locked credentials
- **Search & Sorting:** Sorting by price and name (A-Z, Z-A, low-high, high-low)
- **Cart:** Adding and removing products
- **Checkout:** Successful checkout flow and validation of required fields
- **Confirmation:** Confirmation message + return navigation

---

## πŸ§ͺ Fixtures & Reusability

This project uses Playwright’s custom fixtures to:

- Reuse login flows (`loginAsStandardUser`)
- Set up products in cart (`addProductToCart`, `loginAndAddProductToCart`)
- Navigate directly to protected routes (`navigateToProducts`)
- Centralize test data (`testData` fixture with valid/invalid users and product names)
- Clean up state before/after tests (`resetState`)

➑️ This drastically reduces boilerplate and improves test readability.

---

## 🧠 Project Highlights

- Page Object Model for clean test logic and maintenance
- Custom fixtures to handle setup, teardown, and user flows
- English comments and clear test scenarios
- Modular and scalable structure
- Commit history follows Conventional Commits for clarity
- Tailored for QA portfolios and real-world team practices

---

## πŸ“Œ Roadmap & Status

- βœ… Page Object Model applied to all test suites
- βœ… Centralized and reusable fixtures implemented
- βœ… All major flows (positive and negative) tested
- βœ… Test comments standardized in English
- βœ… Project structure cleaned and documented

### πŸ”„ Suggested Future Improvements

- πŸ”§ Add CI pipeline with GitHub Actions for automated test runs
- πŸ“Š Generate and track test coverage reports
- πŸŒ€ Implement automatic retry for flaky tests
- 🧾 Standardize file and method naming conventions
- πŸ” Add better logging for debugging and traceability
- πŸ“ Connect test structure and decisions directly with the final article

---

## 🎯 About

This project was created as part of a self-study path to master QA automation with Playwright.
It simulates a real QA engineer workflow in a production team, with emphasis on code readability, maintainability, and CI readiness.

All scenarios are built on top of the **Sauce Labs Demo App**, a sandbox platform widely used in testing practices.

---

## πŸ“ License

MIT β€” feel free to read and learn, but external PRs are currently not accepted.

---