https://github.com/osama2262/swag_labs
A comprehensive ๐๐ฒ๐๐ ๐ฎ๐๐๐ผ๐บ๐ฎ๐๐ถ๐ผ๐ป ๐ฝ๐ฟ๐ผ๐ท๐ฒ๐ฐ๐ built with ๐๐ฆ๐ญ๐ฆ๐ฏ๐ช๐ถ๐ฎ ๐๐ฆ๐ฃ๐๐ณ๐ช๐ท๐ฆ๐ณ, implementing the ๐๐ข๐จ๐ฆ ๐๐ฃ๐ซ๐ฆ๐ค๐ต ๐๐ฐ๐ฅ๐ฆ๐ญ (๐๐๐) ๐ฅ๐ฆ๐ด๐ช๐จ๐ฏ ๐ฑ๐ข๐ต๐ต๐ฆ๐ณ๐ฏ for better maintainability and scalability of test cases. The project automates testing on the ๐ฆ๐๐ฎ๐ด ๐๐ฎ๐ฏ๐ website,
https://github.com/osama2262/swag_labs
allure-report automation automation-testing java javascript pom selenium testing
Last synced: 2 months ago
JSON representation
A comprehensive ๐๐ฒ๐๐ ๐ฎ๐๐๐ผ๐บ๐ฎ๐๐ถ๐ผ๐ป ๐ฝ๐ฟ๐ผ๐ท๐ฒ๐ฐ๐ built with ๐๐ฆ๐ญ๐ฆ๐ฏ๐ช๐ถ๐ฎ ๐๐ฆ๐ฃ๐๐ณ๐ช๐ท๐ฆ๐ณ, implementing the ๐๐ข๐จ๐ฆ ๐๐ฃ๐ซ๐ฆ๐ค๐ต ๐๐ฐ๐ฅ๐ฆ๐ญ (๐๐๐) ๐ฅ๐ฆ๐ด๐ช๐จ๐ฏ ๐ฑ๐ข๐ต๐ต๐ฆ๐ณ๐ฏ for better maintainability and scalability of test cases. The project automates testing on the ๐ฆ๐๐ฎ๐ด ๐๐ฎ๐ฏ๐ website,
- Host: GitHub
- URL: https://github.com/osama2262/swag_labs
- Owner: Osama2262
- Created: 2024-12-21T15:00:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-21T18:39:37.000Z (over 1 year ago)
- Last Synced: 2025-05-13T19:28:51.756Z (about 1 year ago)
- Topics: allure-report, automation, automation-testing, java, javascript, pom, selenium, testing
- Language: Java
- Homepage: https://www.saucedemo.com/
- Size: 5.81 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swag_Labs
A
comprehensive test automation project built with Selenium WebDriver, implementing the Page Object Model (POM) design pattern for better maintainability and scalability of test cases. The project automates testing on the [Swag Labs](https://saucedemo.com) website, an online store for performance testing and training purposes.
## Introduction
Swag_Labs is a robust test automation project developed to demonstrate the power and flexibility of Selenium WebDriver and the Page Object Model (POM) design pattern. This repository automates tests for the Swag Labs website, a mock e-commerce platform used primarily for testing purposes.
By using the POM design pattern, this project ensures that the test scripts remain clean, reusable, and easy to maintain, especially as the project grows. The POM approach makes it simple to modify page elements without affecting the test scripts, promoting separation of concerns and enhancing test scalability.
## Prerequisites
Before you can run this project, ensure you have the following installed:
- **Java**: Version 11 or higher
- **Maven**: For dependency management and project building
- **Selenium WebDriver**: For automating web browser interactions
- **TestNG**: For executing and managing tests
- **IDE (Optional)**: IntelliJ IDEA, Eclipse, or any Java-compatible IDE
## Project Structure
```
Swag_Labs/
โโโ src/
โ โโโ main/
โ โ โโโ java/
โ โ โโโ pages/
โ โ โโโ [Page Object Model classes]
โ โโโ test/
โ โโโ java/
โ โโโ tests/
โ โโโ [Test scripts]
โโโ pom.xml
โโโ README.md
```
### **Detailed File Breakdown:**
1. **src/main/java/pages/**:
- Contains the **Page Object Model (POM)** classes that represent different pages of the Swag Labs website (such as login, products, and cart pages). These classes are responsible for handling the web elements and interactions on each page. Each page object class encapsulates the web elements and actions that can be performed on those elements, ensuring test scripts remain clean and reusable.
- **Example**: `LoginPage.java`, `ProductsPage.java`, `CartPage.java`.
2. **src/test/java/tests/**:
- Contains the **TestNG test scripts** that execute the actual test scenarios using the Page Object Model classes. These test scripts are organized into logical groups, such as login tests, product selection tests, and cart validation tests.
- **Example**: `TC001_LoginTest.java`, `TC002_ProductListTest.java`, `TC003_CartTest.java`.
3. **pom.xml**:
- The **Maven configuration file** that defines the dependencies required for the project, such as Selenium, TestNG, and other libraries. It also includes plugins for building and running the tests, managing versions, and packaging the project.
4. **README.md**:
- This document provides instructions and information about the project, dependencies, and how to set up and run the tests.
---
## ๐Main Test Cases
+ The user can log in with a valid email and password
+ The user can't log in with a locked Account
+ The user can log out from his account successfully
+ The user can add all products to the cart
+ The user can add one product to the cart
+ The user can remove one product from the cart
+ Verify the functionality of adding all products to the cart and clearing the cart entirely
+ Ensure the sorting option triggers a change in product arrangement
+ Verify that the sorting option displays products in the correct order
+ The user can go back to the product list page and continue adding products to the cart by clicking on the 'continue shopping' button
+ The user can finish his order successfully
+ The user can cancel his order from CheckoutPage
+ The website displays the correct total price for all products
## Setup and Execution
To set up and execute the tests, follow these steps:
1. **Clone the repository**:
```bash
git clone https://github.com/Osama2262/Swag_Labs.git
```
2. **Navigate to the project directory**:
```bash
cd Swag_Labs
```
3. **Install dependencies**:
Run the following command to install the project dependencies:
```bash
mvn install
```
4. **Run the tests**:
To execute the automated tests, run:
```bash
mvn test
```
Maven will automatically download any missing dependencies and execute the tests based on the configuration in `pom.xml`.
---
## Contribution
We welcome contributions to this project! If you'd like to contribute:
1. Open an issue describing the enhancement or bug.
2. Create a new branch from `main`:
```bash
git checkout -b feature/your-feature-name
```
3. Commit your changes and push to the new branch.
4. Create a pull request with a clear description of your changes.
---
## References
- [Selenium Documentation](https://www.selenium.dev/documentation/)
- [TestNG Documentation](https://testng.org/doc/)
- [Maven Documentation](https://maven.apache.org/guides/index.html)