Skip to content

ahmetk3436/ebebek_qa_case

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ebebek E-commerce Test Automation Project

Project Overview

This is a comprehensive test automation project designed to test the core e-commerce functionality of the Ebebek website (www.ebebek.com.tr). The project implements automated testing for the complete user journey from product search to checkout, ensuring the reliability and quality of the online shopping experience.

What This Project Tests

The automation suite covers the following critical e-commerce user flow:

  1. Product Search - Automated search functionality for baby products (specifically "kaşık maması" - baby spoon food)
  2. Product Selection - Verification of product listing and selection capabilities
  3. Product Details - Validation of product detail page functionality
  4. Add to Cart - Testing the add-to-cart functionality with product verification
  5. Cart Management - Verification of cart contents and navigation
  6. Checkout Process - Testing the transition to membership/login page for order completion

Technical Architecture

Technology Stack

  • Programming Language: Java 19
  • Testing Framework: JUnit 5 (Jupiter)
  • Web Automation: Selenium WebDriver 4.6.0
  • Driver Management: WebDriverManager 5.3.1
  • Build Tool: Maven
  • Logging: Log4j 1.2.17
  • Browser: Chrome (ChromeDriver)

Project Structure

qa_case/
├── src/
│   ├── main/java/
│   │   ├── BasePage.java          # Base page object with common web element operations
│   │   ├── HomePage.java          # Home page object model
│   │   ├── SearchBox.java         # Search functionality component
│   │   ├── ProductsPage.java      # Product listing page object
│   │   ├── ProductDetailPage.java # Individual product page object
│   │   ├── CartPage.java          # Shopping cart page object
│   │   ├── MemberShipPage.java    # Login/membership page object
│   │   └── com/ebebek/qa_case/
│   │       └── Qa_case.java       # Main application class
│   └── test/java/
│       ├── BaseTest.java          # Base test configuration and setup
│       └── Test_Add_Product_To_Cart.java # Main test suite
├── pom.xml                        # Maven configuration
└── chromedriver.exe              # Chrome WebDriver executable

Design Patterns

  • Page Object Model (POM): Each web page is represented as a separate class with its own locators and methods
  • Base Page Pattern: Common web element operations are centralized in BasePage.java
  • Test Base Pattern: Common test setup and teardown logic in BaseTest.java
  • Component Pattern: Reusable components like SearchBox are separated for better maintainability

Key Features

Robust Element Handling

  • Implicit wait configuration (10 seconds)
  • Custom element finding methods with proper exception handling
  • Thread sleep for dynamic content loading

Comprehensive Assertions

  • Page navigation verification
  • Product consistency validation
  • Cart functionality verification
  • User flow completion checks

Logging Integration

  • Detailed logging for each test step
  • Turkish language logging for better local team understanding
  • Log4j integration for structured logging

Browser Management

  • Automatic ChromeDriver setup using WebDriverManager
  • Window maximization for consistent testing
  • Proper browser cleanup after test execution

Prerequisites

  • Java Development Kit (JDK) 19 or higher
  • Maven 3.6+ for dependency management
  • Google Chrome Browser (latest version recommended)
  • Internet connection for accessing the Ebebek website

Installation & Setup

  1. Clone the repository:

    git clone <repository-url>
    cd ebebek_qa_case
  2. Navigate to the project directory:

    cd qa_case
  3. Install dependencies:

    mvn clean install
  4. Verify Java version:

    java -version

Running the Tests

Command Line Execution

# Run all tests
mvn test

# Run with verbose output
mvn test -X

# Run specific test class
mvn test -Dtest=Test_Add_Product_To_Cart

IDE Execution

  1. Import the project as a Maven project in your IDE
  2. Navigate to src/test/java/Test_Add_Product_To_Cart.java
  3. Right-click and select "Run Test"

Test Execution Flow

The test suite executes in the following order:

  1. Setup (@BeforeAll)

    • Initialize ChromeDriver
    • Navigate to Ebebek homepage
    • Maximize browser window
    • Set implicit wait timeout
  2. Test Execution (Ordered sequence)

    • searchProduct() - Search for "kaşık maması"
    • selectProduct() - Select a product from results
    • addProductToCart() - Add selected product to cart
    • goToCart() - Navigate to shopping cart
    • completeShopping() - Proceed to checkout
  3. Cleanup (@AfterAll)

    • Close browser and cleanup resources

Configuration

Maven Configuration (pom.xml)

Key dependencies and their purposes:

  • Selenium WebDriver: Web browser automation
  • JUnit Jupiter: Modern testing framework with annotations
  • WebDriverManager: Automatic driver management
  • Log4j: Logging framework for test execution tracking

Test Configuration

  • Test Instance Lifecycle: PER_CLASS for shared state across test methods
  • Test Method Ordering: OrderAnnotation for sequential test execution
  • Implicit Wait: 10 seconds for element loading
  • Target URL: https://www.ebebek.com.tr

Troubleshooting

Common Issues

  1. ChromeDriver Issues:

    • Ensure Chrome browser is updated
    • WebDriverManager should handle driver compatibility automatically
  2. Element Not Found:

    • Check if website structure has changed
    • Verify CSS selectors and IDs in page objects
    • Increase implicit wait time if needed
  3. Test Failures:

    • Check internet connectivity
    • Verify website availability
    • Review logs for detailed error information

Debug Mode

Enable verbose logging by running:

mvn test -X -Dlog4j.debug

Contributing

  1. Follow the existing Page Object Model pattern
  2. Add appropriate assertions for new functionality
  3. Include logging for new test steps
  4. Update this README for any new features
  5. Ensure all tests pass before submitting changes

Future Enhancements

  • Cross-browser testing (Firefox, Safari, Edge)
  • Parallel test execution for faster feedback
  • Data-driven testing with external test data
  • API testing integration for comprehensive coverage
  • CI/CD pipeline integration (Jenkins, GitHub Actions)
  • Test reporting with Allure or ExtentReports
  • Mobile testing with Appium integration

License

This project is created for educational and testing purposes.

Contact

For questions or issues, please contact the development team or create an issue in the project repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages