This repository provides a template for using Playwright with Python to write end-to-end tests for web applications. Playwright is a powerful library for browser automation, enabling fast and reliable testing.
- Cross-browser testing (Chromium, Firefox, WebKit)
- Headless and headed execution modes
- Easy integration with CI/CD pipelines
- Detailed test reports
- Python 3.7 or higher
- pip (Python package manager)
-
Clone the repository:
git clone https://github.com/qa-chrisb/playwright-python-template.git cd playwright-python-template
-
Install dependencies:
pip install -r requirements.txt
-
Install Playwright browsers:
playwright install
Run tests using the following command:
pytest
To run tests in headed mode:
pytest --headed
tests/
: Contains all test files.pages/
: Page Object Model (POM) implementation.utils/
: Utility functions and helpers.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the Unlicense License. See the LICENSE file for details.