The Automated Image Comparison Framework is designed to facilitate the comparison of web page screenshots and thumbnails against predefined template images. Utilizing tools such as Playwright for browser automation and OpenCV for image processing, this framework enables efficient validation of visual elements on web pages.
- Screenshot Comparison: Captures full-page screenshots and compares them against template images to identify visual discrepancies.
- Thumbnail Matching: Extracts thumbnail images from web pages and compares them with predefined templates to ensure consistency.
- Logging: Provides detailed logging of test execution and results for easy debugging and analysis.
-
Clone the repository:
git clone https://github.com/aswanirs23/Image-matching-framework.git cd Image-matching-framework -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install project dependencies:
pip install -r requirements.txt
-
Running Tests:
To run a Single Test File, use the following command:
pytest -s test_file.py
To run the entire suite, use the following command:
pytest -s
You can generate and view the report using:
allure serve output/allure-resultsPurpose of key folders in project is below:
src/pages: Contains modules that define page objects or componentssrc/utils: Contains common functionalities such as file operations, image processing, and logging, which are used across the projecttests: Contains test modules organized by functionalityoutput/logs: Stores log files generated during the execution of the application or tests.config.py: Store configuration settings
- Aswani R S