Playwright Test Automation

by Prathameshs

244 downloads
Not rated
GitHub

About

Experiments on using mcp for web automation using playwright / puppeteer map servers

Details

Author
Prathameshs
Downloads
244
Categories
Productivity

- Uses Playwright with Python for browser automation
- Page Object Model via a BasePage class
- Organized with tests/ and pages/ directories
- Runs tests using pytest
- Scalable and maintainable test structure

Clone the repository, install Python dependencies with pip install -r requirements.txt, then run playwright install to download browsers. Execute all tests with pytest tests/.

Playwright Test Automation

This project is designed for test automation of a web application using Playwright with Python. It provides a structured approach to writing and organizing tests, making it easier to maintain and scale.

Project Structure

playwright-test-automation
├── tests
│   ├── test_example.py
│   └── __init__.py
├── pages
│   └── base_page.py
├── requirements.txt
├── pytest.ini
└── README.md

Setup Instructions

1. Clone the repository:

   git clone <repository-url>
cd playwright-test-automation

2. Install dependencies:
Ensure you have Python installed, then run:

   pip install -r requirements.txt

3. Install Playwright browsers:
After installing the dependencies, run:

   playwright install

Usage

To run the tests, use the following command:

pytest tests/

Test Structure

- tests/test_example.py: Contains test cases that utilize Playwright's API to interact with the web application and assert expected outcomes.
- pages/base_page.py: Defines a BasePage class that serves as a foundation for all page objects, including common methods for interacting with web elements.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.