Skip to content

devopsworksio/TestingGoogle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google.com Regression Testing Framework

Python Selenium regression tests for Google.com search, using pytest and the Page Object Model.

Structure

TestingGoogle/
├── config/
│   ├── __init__.py
│   ├── settings.py          # BASE_URL, timeouts, logging
│   └── logging_config.py    # Logging setup
├── pages/
│   ├── __init__.py
│   └── google_search_page.py   # Page Object for Google search
├── tests/
│   ├── __init__.py
│   └── test_google_search.py   # Regression tests
├── conftest.py                  # Pytest fixtures (driver)
├── requirements.txt
└── README.md

Setup

  1. Create a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate   # Windows: .venv\Scripts\activate
  2. Install dependencies:

    pip install -r requirements.txt
  3. Install Chrome and ensure ChromeDriver is on your PATH, or use webdriver-manager (add to requirements.txt and use in conftest.py) for automatic driver management.

Run tests

From the project root:

pytest tests/ -v

Headless Chrome is used by default. To run with a visible browser, remove or comment out the --headless option in conftest.py.

Allure reporting

Tests are instrumented for Allure. To view reports you need the Allure CLI (separate from the Python package).

Install Allure CLI (required once)

1. Run tests and collect Allure results

pytest tests/ -v --alluredir=allure-results

2. View the report

  • Quick (opens in browser):
    allure serve allure-results

  • Or generate static HTML then open:
    allure generate allure-results -o allure-report --clean
    Then run: open allure-report/index.html (macOS) or open the file in your browser.

  • Helper script: ./scripts/allure-report.sh — generates the report and opens it (checks for Allure CLI).

The report includes steps (from the page object), epic/feature/story, and a screenshot attachment when a test fails.

Logging

Logging is configured at session start and writes to:

  • Console – same format as file (pytest may capture it; use pytest -s to see live).
  • Filelogs/test_run.log (created automatically).

Format: timestamp | level | logger_name | message. Loggers used: conftest, pages.google_search_page, tests.test_google_search.

  • Level: set TEST_LOG_LEVEL (e.g. DEBUG, INFO, WARNING). Default is DEBUG.
  • Example: TEST_LOG_LEVEL=INFO pytest tests/ -v -s

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 90.6%
  • Shell 9.4%