This repository contains a Selenium-based test automation framework using Pytest. It is designed to facilitate robust and scalable test automation for web applications, following best practices for maintainability and ease of use.
- Cross-Browser Testing: Supports multiple browsers (Chrome, Firefox).
- Page Object Model (POM): Enhances test code maintainability.
- Data-Driven Testing: Easily integrate data from external sources (e.g., CSV, JSON).
- Detailed Reporting: Generates detailed test reports using HTML.
- Python 3.12 or higher
- Pip (Python package installer)
- Clone the repository:
git clone https://github.com/WkjuniorDiaz/Pytest-Web-Automation.git
- Navigate to the project directory:
cd your-repo
- Install the required packages:
pip install pytest
pip install selenium
tests
: Contains the test cases.pageObjects
: Contains the Page Object Model (POM) classes.utilities
: Stores general methods to use and log configuration.reports
: Directory where test reports are saved.testData
: Contains the data required for the test cases.
To execute all test cases:
pytest
To run a specific test file:
pytest tests/test_your_test_file.py
To specify custom settings, such as the browser:
pytest --browser_name chrome
To generate a test report:
pytest --html=reports/report.html
This project is licensed under the MIT License - see the LICENSE file for details.