# gokuldevp/amazon_search_pytest_automation architecture

> Architecture diagram of the GitHub repository gokuldevp/amazon_search_pytest_automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gokuldevp/amazon_search_pytest_automation
- Repository: https://github.com/gokuldevp/amazon_search_pytest_automation

## Overview

This repository automates e-commerce crawling and functional checks with Selenium. The documented crawling workflow opens the site, searches products, traverses result pages, extracts product data, and saves it to CSV; a separate workflow checks product-page elements. Browser setup, logging, screenshots, and HTML reports support execution. The test-case implementations were not sampled, so their wiring is shown only where supported by the README; CAPTCHA and traffic errors can disrupt runs.

Main entry points: [`page_objects/search_result_page.py`](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/search_result_page.py) (Search results), [`test_cases/conftest.py`](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/test_cases/conftest.py) (Browser setup), [`test_cases`](https://github.com/gokuldevp/amazon_search_pytest_automation/tree/main/test_cases) (Test workflows), [`page_objects/home_page.py`](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/home_page.py) (Homepage actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crawl["Crawling"]
  node_testcases["Test workflows"]
end

subgraph group_pages["Page interactions"]
  node_home["Homepage actions<br/>[home_page.py]"]
  node_search["Search results"]
  node_product["Product checks"]
end

subgraph group_runtime["Runtime support"]
  node_config["Site settings<br/>[configs.py]"]
  node_base["Page base<br/>[base_page.py]"]
  node_setup["Browser setup<br/>[conftest.py]"]
  node_browserfactory["Browser factory<br/>[utilities.py]"]
  node_logger["File logger<br/>[utilities.py]"]
end

subgraph group_results["Results"]
  node_screenshots["Screenshot capture<br/>[utilities.py]"]
  node_csv["Product CSV"]
  node_report["HTML report<br/>[conftest.py]"]
end

node_operator(("Test runner"))
node_amazon["Amazon site"]
node_webdriver["WebDriver"]

node_operator -->|"runs tests"| node_testcases
node_testcases -->|"uses fixtures"| node_setup
node_setup -->|"selects browser"| node_browserfactory
node_browserfactory -->|"creates driver"| node_webdriver
node_setup -->|"gets logger"| node_logger
node_setup -->|"provides driver"| node_webdriver
node_testcases -->|"crawls site"| node_home
node_testcases -->|"extracts results"| node_search
node_testcases -->|"checks product"| node_product
node_home -->|"reads settings"| node_config
node_home -->|"opens and searches"| node_amazon
node_search -->|"reads results"| node_amazon
node_search -->|"advances pages"| node_amazon
node_search -->|"writes products"| node_csv
node_product -->|"checks page elements"| node_amazon
node_home -->|"inherits"| node_base
node_search -->|"inherits"| node_base
node_product -->|"inherits"| node_base
node_setup -->|"captures failures"| node_screenshots
node_setup -->|"configures report"| node_report
node_home -->|"logs activity"| node_logger
node_search -->|"logs activity"| node_logger
node_product -->|"logs activity"| node_logger

click node_testcases "https://github.com/gokuldevp/amazon_search_pytest_automation/tree/main/test_cases"
click node_config "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/configs/configs.py"
click node_home "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/home_page.py"
click node_search "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/search_result_page.py"
click node_product "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/product_detailed_page.py"
click node_base "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/base_page.py"
click node_setup "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/test_cases/conftest.py"
click node_browserfactory "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/utilities/utilities.py"
click node_logger "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/utilities/utilities.py"
click node_screenshots "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/utilities/utilities.py"
click node_csv "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/search_result_page.py"
click node_report "https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/test_cases/conftest.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_testcases toneBlue
class node_home,node_search,node_product toneAmber
class node_config,node_base,node_setup,node_browserfactory,node_logger toneMint
class node_screenshots,node_csv,node_report toneRose
class node_operator,node_amazon,node_webdriver toneIndigo
```

## Components

### Crawling

- [Test workflows](https://github.com/gokuldevp/amazon_search_pytest_automation/tree/main/test_cases): `test_cases`

### Page interactions

- [Homepage actions](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/home_page.py): `page_objects/home_page.py`
- [Search results](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/search_result_page.py): `page_objects/search_result_page.py`
- [Product checks](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/product_detailed_page.py): `page_objects/product_detailed_page.py`

### Runtime support

- [Site settings](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/configs/configs.py): `configs/configs.py`
- [Page base](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/base_page.py): `page_objects/base_page.py`
- [Browser setup](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/test_cases/conftest.py): `test_cases/conftest.py`
- [Browser factory](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/utilities/utilities.py): `utilities/utilities.py`
- [File logger](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/utilities/utilities.py): `utilities/utilities.py`

### Results

- [Screenshot capture](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/utilities/utilities.py): `utilities/utilities.py`
- [Product CSV](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/page_objects/search_result_page.py): `page_objects/search_result_page.py`
- [HTML report](https://github.com/gokuldevp/amazon_search_pytest_automation/blob/main/test_cases/conftest.py): `test_cases/conftest.py`

### Other components

- **Test runner**
- **Amazon site**
- **WebDriver**

## Connections

- Test runner → Test workflows: runs tests
- Test workflows → Browser setup: uses fixtures
- Browser setup → Browser factory: selects browser
- Browser factory → WebDriver: creates driver
- Browser setup → File logger: gets logger
- Browser setup → WebDriver: provides driver
- Test workflows → Homepage actions: crawls site
- Test workflows → Search results: extracts results
- Test workflows → Product checks: checks product
- Homepage actions → Site settings: reads settings
- Homepage actions → Amazon site: opens and searches
- Search results → Amazon site: reads results
- Search results → Amazon site: advances pages
- Search results → Product CSV: writes products
- Product checks → Amazon site: checks page elements
- Homepage actions → Page base: inherits
- Search results → Page base: inherits
- Product checks → Page base: inherits
- Browser setup → Screenshot capture: captures failures
- Browser setup → HTML report: configures report
- Homepage actions → File logger: logs activity
- Search results → File logger: logs activity
- Product checks → File logger: logs activity
