A Web Automation Testing Platform for Smart Agriculture SaaS, built on a data-driven and keyword-driven hybrid framework with Selenium and pytest.
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.
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.
DriverManagerhandles browser lifecycle as a singleton.KeywordEnginediscovers and dispatches keyword methods at runtime.DataDriverfeeds 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.pyhandle 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.
- 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
@keyworddecorator 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
- Python 3.11+
- Selenium 4.x
- pytest 8.x
- Allure
- PyYAML
- Page Object Model
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
-
Clone the repository
git clone <repository-url> cd Athena-Platform
-
Create and activate a virtual environment
python -m venv venv # Linux / macOS source venv/bin/activate # Windows venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure the environment
Edit
config/config.yamlto set the target URL, browser type, and timeouts. Place test data inconfig/test_data.yaml. -
Run the tests
pytest
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 URLbrowser-- Browser type (chrome, firefox, edge)timeout-- Implicit wait timeout in secondsheadless-- Whether to run the browser in headless moderetry-- Number of automatic retries on failurescreenshot_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.
Run all tests:
pytestRun a specific test file:
pytest tests/test_login.pyRun tests by marker:
pytest -m smoke
pytest -m regressionGenerate and serve an Allure report:
pytest --alluredir=reports/allure-results
allure serve reports/allure-resultsRun tests in parallel (requires pytest-xdist):
pytest -n 4The jenkins/ directory contains a Jenkinsfile that defines a declarative pipeline. On each commit, the pipeline:
- Checks out the source code
- Installs dependencies in a virtual environment
- Runs the full test suite with Allure result output
- Publishes the Allure report to the Jenkins dashboard
- Archives failure screenshots as build artifacts
This ensures that every code change is validated against the full regression suite before it reaches production.
This project is licensed under the MIT License. Copyright 2025 EternalRights.