- ποΈ Page Object Model (POM): Standardized structure for UI testing using a robust
BasePage. - π οΈ Dedicated CLI Tool (
qa-hub): Simplified test execution with environmental and tag overrides. - πͺ΅ Contextual Logger: Professional, colorized logs with automatic Feature/Scenario context.
- π‘οΈ Security Sanity Checks: Built-in steps for API header hygiene and cookie security validation.
- π Dual-Driver Engine: Native support for both Selenium and Playwright, switchable via configuration.
- π¨ Visual Regression Engine: RMS-based image comparison with automated baseline management.
- βοΈ Surgical Lifecycle Management: Advanced driver reuse logic to optimize execution speed.
- π§ͺ CI/CD Orchestration: Seamless integration with GitHub Actions and detailed audit logs.
Check out our professional Documentation Site for detailed guides on API, GUI, and PDF testing.
The framework follows a modular architecture to ensure separation of concerns:
graph TD
A[Test Features / Gherkin] --> B[Step Definitions]
B --> C[Page Objects]
C --> D[qa_framework.core.BasePage]
D --> E[Selenium WebDriver]
B --> F[qa_framework.utils.DriverFactory]
For more details on our core components, see ARCHITECTURE.md.
For the full list of reusable Gherkin steps, see STEPS.md.
For information on our CI/CD pipelines, see .github/workflows/README.md.
Add the framework to your requirements.txt:
-e git+https://github.com/carlos-camara/qa-hub-framework.git#egg=qa-automation-framework
Then install dependencies:
pip install -r requirements.txt
# Verify the CLI tool
qa-hub --helpRun your tests using the dedicated CLI tool:
# Run all smoke tests in staging
qa-hub run --env staging --tags smokeThe framework uses a centralized configuration system (features/config/config.yaml) that supports environment overrides (staging, prod) and secret management (.env).
For a detailed setup guide and advanced usage, see Configuration Guide.
The framework provides a powerful CLI to manage your test runs efficiently.
qa-hub run [OPTIONS]| Option | Description |
|---|---|
--env |
Set execution environment (local, dev, staging, prod) |
--tags |
Filter by Gherkin tags (e.g., @smoke) |
--browser |
Override browser (chrome, firefox, playwright) |
--fail |
Stop execution on the first failure |
--no-capture |
Show real-time logs and prints |
--junit-dir |
Directory for JUnit XML reports |
For more details, see the CLI Guide.
Every execution is enriched with a high-fidelity audit trail.
- Automatic Context: Logs automatically include
[Feature | Scenario]names. - Colorized Output: Visual differentiation between INFO, SUCCESS, WARNING, and ERROR.
- Timestamps: Precision timing for every action.
See Logging Documentation for configuration and usage.
Validate your API security posture with built-in audit steps.
- Metadata Leaks: Detect if your server leaks technology versions.
- Security Headers: Verify presence of HSTS, CSP, and X-Frame-Options.
- Cookie Security: Audit session cookies for Secure, HttpOnly, and SameSite flags.
Check the Security Guide for implementation details.
The framework includes a professional-grade image comparison engine.
- Baseline Management: Missing baselines are automatically seeded during the first run.
- RMS Error Calculation: High-fidelity detection of layout shifts and CSS glitches.
- Agnostic Logic: Works identically across Selenium and Playwright backends.
Then the "stats grid" element should visually match the baseline image "dashboard_stats" with a 5.0% toleranceThe framework provides an extensive library of modular Gherkin steps across all testing layers, reducing project-specific boilerplate.
Then the response JSON path "{path}" should equal "{expected}"(Alias for precision matching)Then the response JSON path "{path}" should be a "{py_type}"(Type-safe assertions)
Then I verify the content of the first {count:d} pages of "{filename}"(Non-empty extraction check)Then the PDF "{filename}" should have at least {page_count:d} pages
And I wait for "{name}" to be stable(Generic animation/load placeholder)When I store the text of the "{element_name}" as "{var_name}"(Dynamic data extraction)
Then the "{desc}" page should visually match the baseline image "{name}" without elements and with a {threshold:f}% tolerance(Allows blacking out dynamic elements like charts or dates to prevent false positives).
The framework supports Playwright as an alternative to Selenium, offering faster execution and better stability for modern web apps.
After installing requirements, run the Playwright browser installer:
pip install -r requirements.txt
playwright installNote
The playwright install command downloads browser binaries. For CI environments, you may need to run playwright install-deps first.
To use Playwright instead of Selenium, configure features/config/properties.cfg or config.yaml:
Driver:
web_library: playwright
type: chrome
headless: true| Browser | Selenium | Playwright |
|---|---|---|
| Chrome | β | β |
| Firefox | β | β |
| Edge | β | β |
| WebKit | β | β |
Tip
WebKit is the engine behind Safari. Use it for cross-browser testing without macOS.
This project is licensed under the MIT License - see the LICENSE file for details.
