MCPInstall
Playwrite-Browser-automation-MCP logo

Playwrite-Browser-automation-MCP

by ShubhamDalvi1999 1 stars ShubhamDalvi1999/Playwrite-Browser-automation-MCP

Automated tests for Sauce Demo website using Playwright and Python.

READMEmain

Playwright Python Framework

This project contains automated tests for the Sauce Demo website using Playwright with Python.

Project Structure

playwright-python-framework/
|--requirements.txt
|--pages/
|    |--__init__.py
|    |--login_page.py
|--tests/
|    |--test_login.py
|    |--pytest.ini
|    |--conftest.py
|--README.md

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Install Playwright browsers:
python -m playwright install

Running Tests

To run all tests:

pytest

To run with verbose output:

pytest -v

To run with a specific browser:

pytest --browser-name=firefox

Available browser options:

  • chromium (default)
  • firefox
  • webkit

To run a specific test:

pytest tests/test_login.py::test_valid_login -v

Test Scenarios

The framework currently includes the following test scenarios:

  1. Valid Login Test

    • Navigates to the login page
    • Logs in with valid credentials (standard_user)
    • Verifies successful redirection to inventory page
    • Verifies login form is no longer visible
  2. Locked Out User Test

    • Navigates to the login page
    • Attempts to log in with locked_out_user credentials
    • Verifies user remains on login page
    • Verifies appropriate error message is displayed

Page Object Model

This framework uses the Page Object Model design pattern:

  • login_page.py - Contains methods and selectors for the login page
  • Tests interact with pages through these objects rather than directly with UI elements

Technologies Used

  • Playwright - Browser automation library
  • pytest - Testing framework
  • pytest-playwright - Pytest plugin for Playwright integration

More Security & Testing MCP servers

Similar servers from the same category.

Enables deepfake detection in images through Proofly API integration, providing detailed analysis results including real/fake probability scores and individual model results for each detected face.

Security & Testing

CASB provides comprehensive visibility and control over your SaaS applications, so you can easily eliminate the risk of compromise, prevent data loss, and avoid compliance violations.

Security & Testing

Audit logs summarize the history of changes made within your Cloudflare account. Audit logs include account level actions like zone configuration changes.

Security & Testing

YaraFlux

threatflux

Provides YARA-based malware scanning capabilities with support for local and MinIO storage backends, enabling security professionals to manage rules, scan files/URLs, and analyze results for threat detection.

filesystemstorage