A production-ready, enterprise-grade unified test automation framework supporting Web (Playwright), API (Apache HttpClient), and Mobile (Appium) testing with externalized locators and configuration.
- Unified Architecture: Single codebase for Web, API, and Mobile testing.
- Strategy Pattern: Runtime driver resolution between platforms.
- Externalized Locators: Hierarchical
.propertieslocator strategy (Global > Mode > Page). - Java 21+ Native: Leverages modern LTS features for clean and efficient code.
- Enterprise Reporting: Native integration with ReportPortal and Xray Cloud (Jira).
- Contract Testing: Integrated support for Pact (Consumer-driven).
- Database Orchestration: Connection pooling with HikariCP and simplified JDBC wrapper.
- Quality Gates: Automatic retries for flaky tests and screenshots on failure.
- Code Hygiene: Automated checks with Checkstyle and PMD.
- CI/CD Integration: Out-of-the-box support for GitHub Actions and GitLab CI.
- Cloud Ready: Built-in support for BrowserStack and SauceLabs.
┌─────────────────────────────────────────────────────┐
│ Test Layer │
│ (Tests extend BaseTest) │
└──────────────────────┬──────────────────────────────┘
│
┌──────────────────────▼──────────────────────────────┐
│ DriverFactory │
│ (Strategy Pattern - Runtime) │
└──────────┬─────────────┬──────────────┬─────────────┘
│ │ │
┌──────────▼──┐ ┌───────▼────┐ ┌──────▼─────┐
│ Web │ │ API │ │ Mobile │
│ (Playwright)│ │ (HttpClient)│ │ (Appium) │
└─────────────┘ └────────────┘ └────────────┘
│ │ │
┌──────────▼─────────────▼──────────────▼─────────────┐
│ Externalized Locators │
│ (PropertiesLocatorStrategy) │
└─────────────────────────────────────────────────────┘
- Java 21+ - Download here
- Gradle 8.5+ - Or use the included wrapper (
./gradlew) - Git - For version control
- Clone the repository:
git clone https://github.com/vinipx/taflex.git
cd taflex- Run setup script:
./setup.shThe script will verify your Java version, create automation.properties from the template, and compile the test sources.
- Configure your environment:
# Edit automation.properties with your settings
nano automation.properties# Run Web tests
./gradlew webTest
# Run API tests
./gradlew apiTest
# Run Mobile tests
./gradlew mobileTest
# Run via Groups
./gradlew test -Dgroups=smokeSet the mode in automation.properties:
# Execution Mode: web | api | mobile
execution.mode=web
# Web Settings
web.browser=chromium
web.headless=true
# API Settings
api.base.url=https://api.example.compublic class LoginTests extends BaseTest {
@Test(groups = {"smoke"})
public void shouldLoginSuccessfully() {
driver.navigateTo("login.page.url");
driver.type("login.username.field", "user");
driver.type("login.password.field", "pass");
driver.click("login.submit.button");
Assert.assertTrue(driver.isVisible("dashboard.welcome"));
}
}public class UserApiTests extends BaseTest {
@Test(groups = {"api"})
public void shouldFetchUser() {
ApiDriverStrategy apiDriver = (ApiDriverStrategy) driver;
ApiDriverStrategy.ApiResponse response = apiDriver.get("users.endpoint");
Assert.assertEquals(response.getStatusCode(), 200);
}
}taflex/
├── src/
│ ├── main/java/io/github/vinipx/taflex/
│ │ ├── core/
│ │ │ ├── config/ # ConfigManager & properties loading
│ │ │ ├── drivers/ # Strategy implementations (Web, API, Mobile)
│ │ │ ├── locators/ # Hierarchical locator resolution
│ │ │ └── utils/ # XrayService, CapabilityBuilder
│ │ └── database/ # DatabaseManager & Connection Pool
│ └── test/java/io/github/vinipx/taflex/
│ ├── base/ # BaseTest lifecycle
│ ├── listeners/ # TestNG reporting & retry logic
│ └── tests/ # Web, API, and Mobile suites
├── documentation/ # Docusaurus documentation site
├── setup.sh # Environment initialization
└── automation.properties # Central configuration
TAFLEX maintains high standards through automated hygiene checks and robust CI integration:
- Checkstyle: Enforces coding standards (naming, indentation, whitespace).
- PMD: Detects code smells, dead code, and potential programming errors.
- CI/CD Ready: Fully configured pipelines for GitHub Actions and GitLab CI.
Run local verification:
./gradlew verifyBuild test- Xray Integration: Link tests to Jira issues. Configure
xray.client.idandxray.client.secretin properties. - ReportPortal: AI-powered dashboard. Enable via
reportportal.enabled=true. - Local Reports: Standard TestNG reports are generated at
build/reports/tests/index.html. - Screenshots: Automatically captured on failure in the
screenshots/directory.
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Happy Testing! 🚀