Skip to content

Automated UI testing framework for SauceDemo using Java, Selenium, and TestNG with Page Object Model pattern and CI/CD integration.

Notifications You must be signed in to change notification settings

demjrhan/saucedemo-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Saucedemo Automation

GitHub Java Selenium TestNG Maven Allure GitHub Actions

POM-based UI automation for Saucedemo web with Selenium + TestNG + Maven.
Fast, readable tests, grouped by smoke, regression, positive, and negative, with Allure reporting and CI/CD integration.


Highlights

  • Clean Page Object Model with a minimal BasePage
  • Readable locators and explicit waits
  • Allure reports: trends, steps, attachments
  • GitHub Actions CI/CD pipeline with automated test execution
  • Configurable browser mode (visible locally, headless in CI)

Tech Stack

Tool Purpose
Java 21 Core language
Selenium 4.38 Browser automation
TestNG Grouping & assertions
Maven Build & dependencies
Allure Reporting
GitHub Actions CI/CD automation

Project Structure

src/
├─ main/java/
│ ├─ common/
│ │ └─ DataProviders.java
│ ├─ core/
│ │ └─ BasePage.java
│ ├─ pages/
│ │ ├─ HomePage.java
│ │ └─ LoginPage.java
│ └─ utils/
│ ├─ CredentialsUtils.java
│ └─ DriverManager.java
└─ test/java/
├─ core/
│ └─ BaseTest.java
├─ negative/
│ └─ LoginNegativeTest.java
├─ positive/
│ └─ LoginPositiveTest.java
├─ regression/
│ ├─ CartFunctionalityTest.java
│ ├─ HomePageAddToCartTest.java
│ ├─ HomePageNameSortTest.java
│ ├─ HomePagePriceSortTest.java
│ └─ RemoveFromCartTest.java
├─ smoke/
│ ├─ HomePageVisibilityTest.java
│ └─ LoginFieldVisibilityTest.java
└─ utils/
  └─ DataProviders.java

Test Coverage

Group What it checks
Smoke Login field visibility, home page elements visibility, product listings display, basic functionality
Regression Add to cart, remove from cart, cart badge functionality, name sorting (A-Z, Z-A), price sorting (low-high, high-low), product sorting changes
Negative Empty credentials validation, incorrect username/password, locked out user, special characters, very long strings, spaces-only inputs
Positive Successful login with all valid usernames, multiple logins, login after page refresh, login with leading/trailing spaces

Total Test Cases: 47 test methods


How to Run

Prereqs: JDK 21, Maven 3.9+, Google Chrome

# All tests
mvn clean test

# By TestNG group
mvn -Dgroups=smoke test
mvn -Dgroups=regression test
mvn -Dgroups=negative test
mvn -Dgroups=positive test

Allure Report

# Generate and open
mvn allure:serve

# Generate only
mvn allure:report

CI/CD

Tests automatically run on GitHub Actions for every push and pull request. The workflow:

  • Runs tests automatically on push/PR
  • Generates Allure reports
  • Uploads test results and reports as artifacts
  • Runs tests in headless mode for CI environment

See .github/workflows/ci.yml for configuration.

About

Automated UI testing framework for SauceDemo using Java, Selenium, and TestNG with Page Object Model pattern and CI/CD integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published