🚀 End-to-end QA automation project built with Python, Flask, and Selenium WebDriver.
This project demonstrates how to build a small login + dashboard app and validate it using an automated test suite following QA best practices.
This project consists of:
- A Flask web app with:
- User registration & login (with hashed passwords)
- A personal dashboard with CRUD (Create, Update, Delete) items
- Accessibility-friendly forms and navigation
- An automated test suite using:
- Selenium WebDriver (Python)
- pytest test runner
- Page Object Model (POM) for clean test structure
- GitHub Actions CI/CD (runs tests automatically on every push)
- Backend: Flask, SQLAlchemy, Flask-Login
- Database: SQLite (default, lightweight)
- Frontend: HTML, Jinja2, CSS
- Testing: Selenium, pytest, WebDriverWait, Page Object Model
- CI/CD: GitHub Actions with headless Chrome
python-selenium-qa-demo/
│
├── app/ # Flask app
│ ├── __init__.py
│ ├── models.py # User + Item models
│ ├── routes.py # App routes
│ ├── templates/ # HTML templates
│ └── static/ # CSS, images
│
├── tests/ # Selenium test suite
│ ├── pages/ # Page Object classes
│ │ ├── base_page.py
│ │ ├── login_page.py
│ │ ├── register_page.py
│ │ └── dashboard_page.py
│ ├── test_auth.py # Register/Login flow tests
│ ├── test_accessibility.py # Accessibility tests
│ └── conftest.py # Fixtures (server + Selenium driver)
│
├── .github/workflows/ci.yml # GitHub Actions workflow
├── .env.example # Example environment config
├── app.py # App entry point
├── requirements.txt # Python dependencies
├── pytest.ini # pytest configuration
└── README.md # Project documentation
git clone https://github.com/avinav456/flask-selenium-automation.git
cd flask-selenium-automationpython -m venv .venv
# Activate
# Windows (PowerShell):
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activatepip install --upgrade pip
pip install -r requirements.txtpython app.pyApp will be available at: http://127.0.0.1:5000
pytest -qpytest tests/test_auth.py -vEdit tests/conftest.py and comment out:
# opts.add_argument("--headless=new")Then re-run pytest to watch the browser in action.
This project includes a GitHub Actions workflow:
- Installs Python + Chrome
- Starts the Flask app in the background
- Runs Selenium tests in headless mode
- Reports pass/fail status in the Actions tab
Copy .env.example → .env if needed. Defaults are already set:
SECRET_KEY=dev-secret
DATABASE_URL=sqlite:///app.db
- Automated end-to-end QA testing
- Secure login & authentication flow
- CRUD dashboard tested with Selenium
- Basic accessibility validation (labels, alt text)
- CI/CD pipeline with GitHub Actions
- Add Allure / pytest-html reports for visual test results
- Extend a11y testing with axe-core integration
- Add Dockerfile for easy containerized setup
MIT License © 2025 Avinav