Overview

The CitizenGO Live Testing Interface (LTI) is a Django-based platform that runs automated Selenium browser tests against CitizenGO's donation forms and petition pages. It schedules tests, tracks results, monitors payment gateways, and presents everything through a web dashboard.

What it does

Architecture

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   Django      │────│   MySQL       │────│   Cron        │
│   Web App     │    │   Database    │    │   Scheduler   │
└──────┬───────┘     └──────────────┘     └──────┬───────┘
       │                                          │
       │              ┌──────────────┐            │
       └──────────────│   Selenium    │───────────┘
                      │   Chrome      │
                      └──────┬───────┘
                             │
                      ┌──────────────┐
                      │   CitizenGO   │
                      │   Websites    │
                      └──────────────┘

The Django app serves the dashboard, scenario control plane, and Agent API. A scheduler polls at a configurable interval no longer than three minutes and picks up due tests and tasks. Selenium drives legacy deterministic checks while the private visual runner executes versioned manual-AI scenarios through the outbound Agent API bridge. Results and redacted evidence are stored in MySQL and displayed on the dashboard.

Tech Stack

Layer Technology
Framework Django 4.2.7
Language Python 3.11
Database MySQL 8.0
Browser automation Selenium 4.31 + Chrome
Task scheduling django-cron
Production server Gunicorn + Nginx
External APIs Salesforce, Stripe, PayPal, Asana, Sentry, Gmail
Data processing pandas, numpy
Containerization Docker (optional)

Project Structure

├── main/                    # Django project config (settings, urls)
├── test_interface/          # Main Django app
│   ├── models.py            # ScheduledTest, ScheduledTask, etc.
│   ├── views.py             # Dashboard, reports, API endpoints
│   ├── cron.py              # Cron job definitions
│   ├── helpers/             # API integrations (Salesforce, Stripe, etc.)
│   ├── unittests/           # Selenium test implementations
│   ├── templates/           # HTML templates
│   └── static/              # CSS, JS, images
├── features/                # BDD test scenarios (Behave)
├── docs/                    # Documentation source (markdown)
└── Docker/                  # Container configuration

Next Steps