Skip to content

A structured Selenium framework using Java, TestNG, Maven, and supporting DDT via Excel and properties files with detailed Log4j2 logging and Allure reporting. The framework follows the Page Object Model for maintainable and scalable test design.

Notifications You must be signed in to change notification settings

ahany42/SwagLabsSelenuim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwagLabs Selenium Test

This project is a structured Selenium automation framework using Java, TestNG, and Maven. It integrates Excel data handling, Log4j2 for logging, and Allure for detailed test reporting.

Project Structure

├── allure-report/                           # Allure generated HTML report
├── allure-results/                          # Allure raw result files
├── logs/
│   └── test-log.log                         # Log output from test runs
├── src/
│   ├── main/
│   │   ├── LoginPage.java       # Page Object for Login
│   │   └── PurchasePage.java    # Page Object for Purchase
│   │   
│
│   └── test/
│       ├── java/
│       │   ├── BaseTest.java                # Base setup/teardown for tests
│       │   ├── ExcelReader.java             # Utility for reading Excel files
│       │   ├── LoginTestCase.java           # Login test scenarios
│       │   ├── ProductsTestCase.java        # Product-related test scenarios
│       │   ├── PropertiesUtil.java          # Config/property utility
│       │   └── PurchaseTestCase.java        # Purchase flow test cases
│       └── resources/
│           ├── log4j2.xml                   # Logging configuration
│           ├── ProfileData.xlsx             # Profile Data To Fill Purchase Form
│           ├── ProductData.xlsx             # Product To Purchase
│           └── test-config.properties       # Custom configuration
├── pom.xml                                  # Maven project config
└── testng.xml                               # TestNG suite definition
                    

Technologies Used

Java 24 Selenium WebDriver 4.34.0 TestNG 7.11.0 Apache POI (poi-ooxml) 5.2.3 Log4j2 (log4j-core) 2.20.0 Allure TestNG 2.24.0 Maven Compiler Plugin 3.11.0 Maven Surefire Plugin 3.2.5

Test Cases

Login

  • Validate that User cannot Login With Invalid User Name
  • Validate that User cannot Login With Invalid Password
  • Validate that User cannot Login With Invalid User Name and Password
  • Validate that User cannot Login With Locked Account
  • Validate that User cannot Login with empty User Name or Password
  • Validate that User can Login With Valid Email and Password

Products

  • Validate that User can View price Label for Each product
  • Validate that User can View Add to cart button for each product

Purchase

  • Validate that User can Add Item to Cart
  • Validate that items in cart is increased by one
  • Validate that User Can Fill Checkout Form
  • Validate that User Can Finish purchase and Checkout

How to Run

git clone https://github.com/your-username/SwagLabs.git
cd SwagLabs
mvn clean install
Run the tests
mvn test

Allure Reports

Generate Report

allure generate allure-results --clean -o allure-report

View Report

allure open allure-report

About

A structured Selenium framework using Java, TestNG, Maven, and supporting DDT via Excel and properties files with detailed Log4j2 logging and Allure reporting. The framework follows the Page Object Model for maintainable and scalable test design.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages