How itswale/qa-automation-plugin works
Project type and purpose
• This is a Streamlit-based QA automation tool (“QA Automation Plugin”) with a plugin architecture.
• It provides a UI for launching unit, E2E, and custom tests; collects results in a database; and renders interactive reports.
File structure
• Top level:
• app.py / .streamlit/ : Streamlit UI entry point and config
• config.yaml : runtime settings (test dirs, URLs, plugins)
• cleanup.py : housekeeping (temporary files, old DB rows)
• Dockerfile : container image definition
• qa_plugin/ : core Python package
– api.py : optional programmatic API
– cli.py : command-line interface
– core.py : orchestrator (load config, schedule runs, plugin loader)
– database.py : data access (store/retrieve test results)
– reports.py : report generation logic
• tests/ : unit, sample, E2E test suites
• .github/workflows/qa.yml : CI/CD pipeline for QA checks
• Patterns: layered (UI / service / data), plugin extension points in core.py via config.yaml.
Extract README insights
• UI tabs: “Reports” (real-time & historical views), “History” (trends, filtering)
• Persist data for trend analysis
• Extend via custom plugins under “plugins/” and register in config.yaml
Main components & their interactions
a. Components
1. Streamlit UI (app.py + .streamlit/config.toml)
2. CLI interface (qa_plugin/cli.py)
3. Core orchestrator (qa_plugin/core.py)
4. Plugin loader (dynamically loads classes named in config.yaml)
5. Test runners (unit via pytest, E2E via Playwright, custom plugin methods)
6. Database (qa_plugin/database.py; e.g. SQLite or Postgres)
7. Reporting engine (qa_plugin/reports.py)
8. Cleanup service (cleanup.py)
9. External services: Playwright browsers, Streamlit Cloud, Docker container
10. CI/CD pipeline (GitHub Actions)
b. Interactions / Data flow
• User interacts with Streamlit UI or CLI → Core orchestrator
• Core reads config.yaml → resolves test directories & plugin classes
• Core invokes test runners → test results emitted
• Results written to Database via database.py
• Reports reads from Database → aggregates stats, generates charts
• UI polls Reports for real-time updates → renders graphs & tables
• Cleanup service periodically purges old results / temp files
• CI pipeline executes tests in Docker container, posts results
c. Architectural patterns & principles
• Layered architecture: Presentation (UI/CLI), Application (Core/API), Persistence (Database)
• Plugin pattern: decoupled extension points, dynamic loading via configuration
• Single responsibility: each module handles one concern (e.g. reports, DB, orchestration)
• Infrastructure as code: Dockerfile, CI workflows, config.yaml
d. Key technologies
• Python & Streamlit (UI)
• Pytest & Playwright (test execution)
• YAML (configuration)
• SQLite/Postgres (persistent storage)
• Docker & GitHub Actions (CI/CD)