Skip to content

deepakjindal07/SeleniumFull

Repository files navigation

Selenium Test Framework

A modern Selenium automation framework using Java, TestNG, Maven, Page Object Model (POM), and Allure Reporting.

Features

  • POM Architecture: Organized page objects for maintainability and reusability.
  • Environment Management: Use of .env files for security and flexibility.
  • TestNG Listeners: Custom listeners for automatic screenshots on failure.
  • Reporting: Detailed Allure reports with embedded screenshots.
  • REST Assured: Advanced API testing with Reqres and JSONPlaceholder.
  • JDBC Testing: Database validation tests using SQLite.
  • Docker Support: Run tests in isolated containers.
  • CI/CD Integrated: GitHub Actions workflow for automated testing.
  • Cleanup Utility: Batch script to clear previous reports and results.

Requirements

  • Java 21+
  • Maven 3.x+
  • Chrome/Firefox/Edge browser

Quick Start

1. Configure Environment

Create/edit the .env file in the root directory:

BASE_URL=https://practice.expandtesting.com/
BROWSER=chrome
HEADLESS=false
USERNAME=practice
PASSWORD=SuperSecretPassword!

2. Clean Previous Results

Run the cleanup script:

.\clean_reports.bat

3. Execution

Run tests via Maven:

mvn clean test

4. Generate Reports

To see Allure reports after test execution:

allure generate target/allure-results --clean -o allure-report
allure open allure-report

Running with Docker

You can run the entire suite in an isolated container without having Java or Chrome installed locally.

1. Build the image

docker build -t selenium-framework .

2. Run the tests (Headless)

Pass environment variables directly or use the .env file logic:

docker run -e BROWSER=chrome -e HEADLESS=true -e BASE_URL=https://practice.expandtesting.com -e USERNAME=practice -e PASSWORD=SuperSecretPassword! selenium-framework

3. Alternative: Docker Compose

One command build and execution:

docker compose up --build

Reporting

After test execution, generate and open the Allure report:

allure generate target/allure-results --clean -o allure-report
allure open allure-report

GitHub Actions

The framework is pre-configured to run on every push/pull-request to main or master. Result artifacts can be downloaded from the "Actions" tab in GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors