Pytest-based test automation framework with self-healing and parallel execution.
- Self-healing tests - Auto-adapt to UI changes
- Parallel execution - Run tests simultaneously
- Enhanced reporting - Detailed test and healing reports
# Setup
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Configure
cp .env.example .env
# Edit .env with your application URL
# Run tests
pytest -m smoke -v # Quick smoke tests
pytest -n 4 -m smoke -v # Parallel (4 workers)
./run_parallel_tests.sh -n 4 # Using helper scripttests/ # Test files
pages/ # Page Object Model
locators/ # Element locators
config/ # Configuration
utils/ # Utilities
scripts/ # Utility scripts (verify_setup, report_gen, etc.)
conftest.py # Pytest fixtures
pytest.ini # Configuration
# By marker
pytest -m smoke -v
pytest -m analytics -v
pytest -m dataset -v
# Specific test
pytest tests/test_analytics.py::TestMultiStateNavigation -v# Auto-detect workers
pytest -n auto -v
# Specific workers
pytest -n 4 tests/ -v # 4 workers (recommended)
pytest -n 8 tests/ -v # 8 workers
# Using helper script
./run_parallel_tests.sh # Default: 4 workers
./run_parallel_tests.sh --auto # Auto-detect
./run_parallel_tests.sh -n 8 -m smoke # 8 workers, smoke tests# Push to trigger CI/CD
git push origin main # Full test suite
git push origin dev # Smoke tests + full suite
# Or manually via GitHub Actions UI
# Select environment: dev (smoke only), prod (full suite)This test suite can be triggered from external repos (e.g., frontend deployments):
# In your frontend repo's deploy workflow
- name: Trigger E2E Tests
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.QA_REPO_PAT }}
repository: CivicDataLab/IDS-DRR-QA-Automation
event-type: frontend-deployed
client-payload: '{"environment": "dev", "commit": "${{ github.sha }}"}'| Environment | Tests Run |
|---|---|
dev |
Smoke tests only |
prod / staging |
Full test suite |
# Run all smoke tests
pytest -m smoke -v
# Comprehensive all-states smoke test (tests all 5 states with dropdowns + indicators)
pytest -m smoke -k "TestAllStatesIndicatorSmoke" -v
# Quick smoke tests in parallel
pytest -n 4 -m smoke -vThe all-states smoke test validates for each state:
- State selection, View selection (Map), District dropdown, Revenue circle dropdown
- Section expand/collapse, Indicator selection
smoke- Critical tests (includes all-states indicator smoke test)analytics- Analytics pagedataset- Dataset pagecomponent- UI componentsflow- End-to-end flowsmultistate- Multi-state testingnegative- Error casesedge_case- Edge scenarios
.env
URL=https://your-app-url.com
LOCAL=true
HEADLESS=false# View latest report
./view_reports.sh
# List all reports
./view_reports.sh --all
# Self-healing summary
./view_reports.sh --self-healing
# Clean old reports
./view_reports.sh --clean 30| Workers | Time vs Serial | Speedup |
|---|---|---|
| 1 (serial) | 100% | 1x |
| 2 workers | ~60% | 1.7x |
| 4 workers | ~35% | 2.9x |
| 8 workers | ~20% | 5x |
- docs/QUICKSTART.md - Quick setup guide
- docs/SELF_HEALING_GUIDE.md - Complete reference
- docs/EXAMPLES.md - Usage examples
- docs/REPORTS_GUIDE.md - Report management
- docs/MULTISTATE_QUICKSTART.md - Multi-state quick start
- docs/MULTISTATE_TESTING_GUIDE.md - Multi-state testing guide
- .github/workflows/README.md - CI/CD setup