Skip to content

EternalRights/Athena-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Athena Platform

A Web Automation Testing Platform for Smart Agriculture SaaS, built on a data-driven and keyword-driven hybrid framework with Selenium and pytest.

Overview

Athena Platform is a purpose-built automation testing framework designed for Smart Agriculture SaaS applications. As SaaS platforms in the agriculture domain undergo rapid iteration cycles, regression testing becomes a recurring bottleneck -- manual testing cannot keep pace with frequent releases, and brittle test scripts break with every UI change. Athena addresses these pain points by combining data-driven and keyword-driven testing into a single, cohesive framework that separates test intent from implementation.

The platform adopts a layered architecture where configuration, page definitions, and test logic are fully decoupled. Test cases are expressed as readable keyword sequences backed by YAML data sources, making them accessible to both engineers and QA analysts. A smart element location strategy with automatic fallback ensures that tests remain stable even when the DOM shifts between releases.

Under the hood, a dynamic keyword engine with decorator-based registration and a singleton driver manager handle the heavy lifting, while Allure reporting and Jenkins CI/CD integration provide full visibility into test results. The result is a framework that scales with the product, not against it.

Architecture

Athena follows a five-layer architecture, each with a clear responsibility:

  • Config Layer -- YAML files hold all environment settings, browser options, and test data. No values are hardcoded in test or page code.
  • Framework Layer -- The core engine lives here. DriverManager handles browser lifecycle as a singleton. KeywordEngine discovers and dispatches keyword methods at runtime. DataDriver feeds parameterized data into test cases from YAML sources.
  • Page Object Layer -- Each page of the application is modeled as a Python class. Elements are defined as locators, and page behaviors are exposed as keyword-decorated methods. This layer is the only place that touches Selenium directly.
  • Utility Layer -- Cross-cutting concerns such as logging (Logger), element location with retry (ElementLocator), and report generation (ReportGenerator) are isolated here for reuse across the framework.
  • Test Layer -- Pytest test suites consume the layers above. Tests are thin orchestration scripts that call keywords and assert outcomes. Fixtures in conftest.py handle setup and teardown.

Data flows downward: tests invoke keywords, keywords call page objects, page objects use the driver, and everything reads from the config layer.

Features

  • Hybrid testing framework combining data-driven and keyword-driven approaches
  • Page Object Model with smart multi-strategy element location and automatic fallback
  • Dynamic keyword engine using the @keyword decorator with runtime page class registration
  • YAML configuration center for test data, environment settings, and browser options
  • Auto-retry mechanism with screenshot capture on failure
  • Allure report integration with full Jenkins CI/CD pipeline support
  • Singleton patterns for Logger and DriverManager to ensure consistent state
  • Clean separation of concerns across all architectural layers

Tech Stack

  • Python 3.11+
  • Selenium 4.x
  • pytest 8.x
  • Allure
  • PyYAML
  • Page Object Model

Project Structure

Athena-Platform/
  config/           - YAML configuration and test data
  framework/        - Core engine (DriverManager, KeywordEngine, DataDriver)
  jenkins/          - Jenkins CI/CD pipeline definitions
  pages/            - Page Object Model classes
  tests/            - Pytest test suites
  utils/            - Utilities (Logger, ElementLocator, ReportGenerator)
  conftest.py       - Root path configuration and shared fixtures
  pytest.ini        - Pytest settings and marker definitions
  requirements.txt  - Python dependencies
  .gitignore        - Git ignore rules
  LICENSE           - MIT License

Quick Start

  1. Clone the repository

    git clone <repository-url>
    cd Athena-Platform
  2. Create and activate a virtual environment

    python -m venv venv
    
    # Linux / macOS
    source venv/bin/activate
    
    # Windows
    venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure the environment

    Edit config/config.yaml to set the target URL, browser type, and timeouts. Place test data in config/test_data.yaml.

  5. Run the tests

    pytest

Configuration

All runtime configuration is managed through YAML files under the config/ directory.

config/config.yaml -- The main configuration file. Key settings include:

  • base_url -- The target application URL
  • browser -- Browser type (chrome, firefox, edge)
  • timeout -- Implicit wait timeout in seconds
  • headless -- Whether to run the browser in headless mode
  • retry -- Number of automatic retries on failure
  • screenshot_on_fail -- Whether to capture a screenshot when a test fails

config/test_data.yaml -- Test data source for data-driven tests. Each top-level key maps to a test scenario, and nested values are injected as parameters into keyword sequences. Keeping data here rather than in test code makes it straightforward to add or modify test cases without touching Python.

Running Tests

Run all tests:

pytest

Run a specific test file:

pytest tests/test_login.py

Run tests by marker:

pytest -m smoke
pytest -m regression

Generate and serve an Allure report:

pytest --alluredir=reports/allure-results
allure serve reports/allure-results

Run tests in parallel (requires pytest-xdist):

pytest -n 4

CI/CD Integration

The jenkins/ directory contains a Jenkinsfile that defines a declarative pipeline. On each commit, the pipeline:

  1. Checks out the source code
  2. Installs dependencies in a virtual environment
  3. Runs the full test suite with Allure result output
  4. Publishes the Allure report to the Jenkins dashboard
  5. Archives failure screenshots as build artifacts

This ensures that every code change is validated against the full regression suite before it reaches production.

License

This project is licensed under the MIT License. Copyright 2025 EternalRights.

About

Athena Platform is an automated testing platform specifically designed for high-frequency iterative web applications, aiming to address the bottleneck issue of regression testing efficiency in rapid business iterations. Through a hybrid framework combining data-driven and keyword-driven methods, it significantly enhances test execution efficiency a

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages