Skip to content

CivicDataLab/IDS-DRR-QA-Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

IDS-DRR QA Automation

Pytest-based test automation framework with self-healing and parallel execution.

Features

  • Self-healing tests - Auto-adapt to UI changes
  • Parallel execution - Run tests simultaneously
  • Enhanced reporting - Detailed test and healing reports

Quick Start

# 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 script

Project Structure

tests/          # 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

Running Tests

Standard Execution

# By marker
pytest -m smoke -v
pytest -m analytics -v
pytest -m dataset -v

# Specific test
pytest tests/test_analytics.py::TestMultiStateNavigation -v

Parallel Execution

# 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

GitHub Actions

# 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)

Cross-Repository Triggers

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

Smoke Tests

# 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 -v

The all-states smoke test validates for each state:

  • State selection, View selection (Map), District dropdown, Revenue circle dropdown
  • Section expand/collapse, Indicator selection

Test Markers

  • smoke - Critical tests (includes all-states indicator smoke test)
  • analytics - Analytics page
  • dataset - Dataset page
  • component - UI components
  • flow - End-to-end flows
  • multistate - Multi-state testing
  • negative - Error cases
  • edge_case - Edge scenarios

Configuration

.env

URL=https://your-app-url.com
LOCAL=true
HEADLESS=false

Reports

# 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

Performance

Workers Time vs Serial Speedup
1 (serial) 100% 1x
2 workers ~60% 1.7x
4 workers ~35% 2.9x
8 workers ~20% 5x

Documentation

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors