Skip to content

anukul-hub/E-commerece-Capstone-project-amazon-automation

Repository files navigation

🛍️ Amazon Web Automation Framework

Java Selenium TestNG Maven Cucumber ExtentReports

A robust test automation framework designed to validate the functionality of the Amazon e-commerce website, built with Java, Selenium, TestNG, and Cucumber following industry best practices including BDD and Page Object Model.


✨ Features

🔍 Product Search Testing

  • ✅ Valid search using search button and Enter key
  • 🏷️ Department-specific search (Electronics, Books, etc.)
  • 💡 Autocomplete suggestions validation
  • ❌ Edge cases: empty, invalid, and extremely long queries

🔐 User Authentication

  • ✅ Positive login flows with valid credentials
  • ❌ Negative testing with invalid credentials
  • 🔄 Session persistence validation across navigation

📝 User Registration

  • ✅ Mandatory field validation
  • 📋 Registration form error handling

🛒 End-to-End Purchase Flow

  • 💳 Complete checkout process testing
  • ❌ Negative scenarios with invalid payment details
  • 🔍 Error handling validation

🏠 Home Page UI Validation

  • 🎨 Critical UI elements verification (logo, banners)
  • 🖼️ Broken images detection
  • 🔗 Dead links identification

🛠️ Tech Stack

Category Technology Purpose
Programming Language Java 11+ Core development language
Web Automation Selenium WebDriver Browser automation and interaction
Testing Framework TestNG + Cucumber Test execution and BDD scenarios
Build Tool Apache Maven Dependency management and build automation
Reporting Extent Reports Rich HTML test reports
Data Handling Apache POI Excel operations for test data
Driver Management WebDriverManager Automatic browser driver management
Logging Log4j 2 Comprehensive logging system

📂 Project Structure

.
├── pom.xml                   # Maven Project Object Model
├── testng.xml                # TestNG suite for test execution
│
└── src
    └── test
        ├── java
        │   ├── base                # Core framework setup (DriverFactory, BaseTest)
        │   ├── pages               # Page Object Model classes (LoginPage, HomePage, etc.)
        │   ├── runners             # TestNG Cucumber runner
        │   ├── stepDefinitions     # Cucumber step definitions (glue code)
        │   └── utils               # Helper utilities (ConfigReader, ScreenshotUtils, etc.)
        │
        └── resources
            ├── features            # Cucumber .feature files
            ├── config.properties   # Main configuration file
            ├── log4j2.xml          # Logging configuration
            ├── extent-config.xml   # Extent Reports styling
            └── testdata.xlsx       # Test data for data-driven tests

🚀 Quick Start

📋 Prerequisites

RequirementVersionDownload Link
Java JDK11 or higheradoptium.net
Apache Maven3.6 or highermaven.apache.org
GitLatestgit-scm.com

📥 Installation

  1. Clone the repository:

    git clone https://github.com/anukul-hub/E-commerece-Capstone-project-amazon-automation.git
    cd E-commerece-Capstone-project-amazon-automation
  2. Install dependencies:

    mvn clean install
  3. Verify installation:

    mvn clean compile

🧪 Running Tests

🖥️ Command Line Execution

Run all tests:

mvn clean test

Run specific test suite:

mvn clean test -Dsurefire.suiteXmlFiles=testng.xml

Run with specific browser:

mvn clean test -Dbrowser=chrome

💻 IDE Execution

IntelliJ IDEA / Eclipse:

  • Right-click on testng.xmlRun
  • Right-click on any feature file → Run Feature
  • Right-click on TestRunner.javaRun

📊 Test Reports

📈 Extent Reports

Rich, interactive HTML reports with detailed execution insights:

  • 📍 Location: test-output/extent-report.html
  • ✨ Features:
    • Test execution dashboard
    • Step-by-step execution details
    • Embedded screenshots for failures
    • Execution timeline and statistics

🥒 Cucumber Reports

Standard BDD reports in multiple formats:

  • 📍 Location: target/cucumber-reports/cucumber.html
  • 📋 Formats: HTML, JSON

📸 Screenshots

Automatic screenshot capture on test failures:

  • 📍 Location: test-outpt/screenshots/
  • 🎯 Naming: Scenario_TestName_Timestamp.png

⚙️ Configuration

🔧 config.properties

Change the baseUrl, browser, and test user credentials here:

# Application Settings
baseUrl=https://www.amazon.in
browser=chrome
headless=false
explicitWait=25

# Test User Credentials
regMobile=your_mobile
regName=Anukul Chauhan
regPassword=tempPAss

# Reporting
reports.screenshots=true
reports.extent=true

🎯 testng.xml

Modify the test suite to run specific classes or pass parameters to your tests:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Amazon Automation Suite">
    <test name="Smoke Tests">
        <classes>
            <class name="runners.CucumberTestRunner"/>
        </classes>
    </test>
</suite>

About

A robust test automation framework designed to validate the functionality of the Amazon e-commerce website.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published