GitHunt
MM

mmizin/insider_qa

home_task

๐Ÿ”ฅ๐Ÿž Test Automation Project โ€“ UI & API ๐Ÿž๐Ÿ”ฅ

This repository contains automated test suites for UI and API testing, implemented in Python using Selenium for UI and requests for API.


โœ๏ธ Manual Testing Scenarios Analysis

  1. Pencil with Eraser Testing
    Full functional, usability, performance, load, stress, and security testing scenarios.
    View analysis document

  2. Hepsiburada Product Recommendations Analysis
    Study of Recommendations sections across Main, Product Detail, and Cart pages.
    View analysis document


๐Ÿ’ป๐ŸŒŽ UI Test Automation

  • Framework: Python + Pytest + Selenium
  • Page Object Model fully implemented
  • Cross-browser support: Chrome & Firefox
  • Screenshots captured automatically on failures
  • Parallel execution supported via xdist

๐Ÿ’ป ๐Ÿ‘ท API Test Automation

  • Framework: Python + Pytest + Requests
  • CRUD operations for Pet endpoints (Swagger Petstore)
  • Positive and negative test scenarios
  • In-memory image upload using io.BytesIO
  • Parallel execution supported via xdist

๐ŸŒณ Project Structure

ui_tests/ and api_tests/ combined structure:

UI Testing
โ”œโ”€โ”€ ui_tests/
โ”‚ โ”œโ”€โ”€ config.py # Global configuration (BASE_URL, timeouts)
โ”‚ โ”œโ”€โ”€ conftest.py # Pytest hooks and global fixtures
โ”‚ โ”œโ”€โ”€ fixtures/ # Pytest fixtures
โ”‚ โ”‚ โ”œโ”€โ”€ fxt_webdriver.py
โ”‚ โ”‚ โ””โ”€โ”€ fxt_cookie.py
โ”‚ โ”œโ”€โ”€ pages/ # POM classes
โ”‚ โ”‚ โ”œโ”€โ”€ base_page.py
โ”‚ โ”‚ โ”œโ”€โ”€ home_page.py
โ”‚ โ”‚ โ”œโ”€โ”€ careers_page.py
โ”‚ โ”‚ โ”œโ”€โ”€ career_roles_page.py
โ”‚ โ”‚ โ””โ”€โ”€ careers_open_positions_page.py
โ”‚ โ”œโ”€โ”€ tests/ # Test cases
โ”‚ โ”‚ โ”œโ”€โ”€ test_home_page.py
โ”‚ โ”‚ โ”œโ”€โ”€ test_careers_page.py
โ”‚ โ”‚ โ””โ”€โ”€ test_browse_open_positions.py
โ”‚ โ””โ”€โ”€ utils/ # Helpers (e.g., screenshot)
โ”‚ โ””โ”€โ”€ generate_screenshot.py

API Testing
โ”œโ”€โ”€ api_tests/
โ”‚ โ”œโ”€โ”€ api/
โ”‚ โ”‚ โ”œโ”€โ”€ base_api.py
โ”‚ โ”‚ โ”œโ”€โ”€ config.py
โ”‚ โ”‚ โ””โ”€โ”€ pet_api.py
โ”‚ โ”œโ”€โ”€ fixtures/
โ”‚ โ”‚ โ”œโ”€โ”€ fxt_pet_api.py
โ”‚ โ”‚ โ””โ”€โ”€ fxt_add_pet.py
โ”‚ โ”œโ”€โ”€ tests/
โ”‚ โ”‚ โ”œโ”€โ”€ test_create_pets.py
โ”‚ โ”‚ โ”œโ”€โ”€ test_delete_pets.py
โ”‚ โ”‚ โ”œโ”€โ”€ test_get_pets.py
โ”‚ โ”‚ โ”œโ”€โ”€ test_update_pets.py
โ”‚ โ”‚ โ””โ”€โ”€ test_image_upload_pet.py
โ”‚ โ””โ”€โ”€ utils/
โ”‚ โ”œโ”€โ”€ api_payloads.py
โ”‚ โ”œโ”€โ”€ enums.py
โ”‚ โ””โ”€โ”€ generate_image_file.py

๐Ÿ”‘ Key Features

  • UI Tests

    • Full POM implementation
    • Cross-browser (Chrome/Firefox)
    • Screenshots captured on failure
    • Parameterized tests and fixtures
    • Auto-handling cookie banners
    • Parallel execution via pytest-xdist
  • API Tests

    • Full CRUD coverage
    • Positive and negative test scenarios
    • Image upload support (in-memory)
    • Payload builders & enumerations
      • Parallel execution via pytest-xdist
  • General

    • Independent, reusable fixtures
    • Easy parametrization
    • Supports both UI and API test execution in parallel

๐Ÿง‘โ€๐Ÿ’ป Running Tests

Install dependencies:

pip install -r requirements.txt

Run all UI tests:

pytest ui_tests/ -n auto -v

Run all API tests:

pytest api_tests/ -n auto -v

Run specific test file:

pytest ui_tests/tests/test_careers_page.py -v

Run tests by marker:

pytest -m "API and CREATE_PET" -v

๐Ÿค˜ Notes

  • Uses requests library for API calls.
  • Image upload uses in-memory files via io.BytesIO.
  • Screenshots are generated automatically on test failure.
  • All tests are independent and use fixtures for setup/teardown.
  • Enumerations (enums.py) and payload builders (api_payloads.py) help maintain consistency across tests.