This project is a Playwright-based automation framework designed for web testing. It includes support for test execution, reporting, and easy configuration, making it ideal for robust automated testing workflows.
- Built with Playwright and Python for modern, fast browser automation.
- Allure Reports for interactive and visually appealing test results.
- Configurable with
pytest
for test execution and flexibility. - Modular and maintainable structure following the Page Object Model (POM) design pattern.
Ensure the following tools and dependencies are installed:
- Python (>= 3.10): Download from python.org.
- Allure CLI:
- For macOS:
brew install allure
- For Windows/Linux: Follow the instructions here.
- For macOS:
- Node.js (Optional, for Playwright browser setup):
brew install node
-
Clone the Repository:
git clone <repository-url> cd Floward_web_automation
-
Set Up a Virtual Environment:
python3 -m venv myenv source myenv/bin/activate # Use myenv\Scripts\activate on Windows
-
Install Dependencies: Install all necessary Python libraries:
pip install -r requirements.txt
-
Install Playwright Browsers: Install the required browsers:
playwright install
Run the tests and serve the Allure report in one go:
pytest tests/ --alluredir=allure-results && allure serve allure-results
Run tests and generate raw Allure results:
pytest tests/
If you have raw results in allure-results
, generate the report:
allure generate allure-results -o allure-report --clean
Floward_web_automation/
├── config/ # Contains global configuration (e.g., base URL)
│ └── config.json
├── tests/ # Test files organized by feature or functionality
│ ├── test_example.py
│ ├── conftest.py # Shared fixtures and test setup
├── pages/ # Page Object Model (POM) classes
│ ├── base_page.py
│ ├── __init__.py
├── utils/ # Helper functions (e.g., config loading)
│ ├── helpers.py
├── pytest.ini # Pytest configuration
├── requirements.txt # Python dependencies
config/config.json
:
{
"base_url": "https://example.com",
"browser": "chromium"
}
All dependencies are listed in requirements.txt
. To install them:
pip install -r requirements.txt
Allure Reports provide detailed and graphical test results. The raw results are stored in allure-results
, and reports are generated in allure-report
.
To generate and view the report:
allure serve allure-results
Feel free to open issues or submit pull requests to improve the framework.
- Add support for CI/CD pipelines.
- Implement environment-specific configurations.
- Extend test cases for comprehensive coverage.