Skip to content

mcello23/selenium-java-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selenium + Java — Saucedemo

CI

End-to-end UI tests for saucedemo.com using the classic Page Object Model pattern. Reports are generated with Maven Surefire and published to GitHub Pages on every push to main.

What it validates

Suite Tests Scenarios
Login 8 Standard user login + logout; locked-out user sees error message; wrong password shows error; all 5 accepted users can add an item to the cart
Checkout 4 Two-item checkout completes with confirmation; inventory sorted low-to-high; cart persists across page navigation; reset app state clears the cart badge

Stack

  • Java 17
  • Selenium WebDriver 4
  • JUnit 5
  • WebDriverManager (auto-manages chromedriver)
  • Maven Surefire HTML report
  • Allure (results exported for optional post-processing)
  • GitHub Actions + GitHub Pages

Prerequisites

  • Java 17+
  • Maven 3.8+
  • Google Chrome (for headless CI runs Chrome is launched automatically)

Install

No extra install step — Maven downloads all dependencies on first run.

Run

# Run all tests (headless by default)
mvn clean test

# Run with visible browser
mvn clean test -Dheadless=false

# Run against a different URL
mvn clean test -DbaseUrl=https://www.saucedemo.com/

# Generate Surefire HTML report after tests
mvn surefire-report:report-only

Open target/site/surefire-report.html to view the report locally.

Project structure

selenium-java/
├── src/test/java/
│   ├── pages/
│   │   ├── BasePage.java        # Shared waits and utilities
│   │   ├── LoginPage.java
│   │   ├── ProductsPage.java
│   │   ├── CartPage.java
│   │   └── CheckoutPage.java
│   └── tests/
│       ├── LoginTests.java
│       └── CheckoutTests.java
├── src/test/resources/
│   └── config.properties
└── .github/workflows/ci.yml

CI / GitHub Pages

Every push to main and every pull request runs the full suite in headless Chrome. The Surefire HTML report is deployed to GitHub Pages automatically on main pushes. Raw test artifacts (surefire XML, allure results) are uploaded on every run.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages