Playwright Automation With MCP Server

by syedzubairalam1

233 downloads
Not rated
GitHub

Description

# MCP Test Automation This project contains automated tests using Cucumber.js and Playwright. ## Setup 1. Install dependencies: ``` npm install ``` ## Configuration The test configuration is managed in `config/test-config.js`. You can modify this file directly or use environment…

About

# MCP Test Automation This project contains automated tests using Cucumber.js and Playwright. ## Setup 1. Install dependencies: ``` npm install ``` ## Configuration The test configuration is managed in `config/test-config.js`. You can modify this file directly or use environment variables to override the default…

Details

Author
syedzubairalam1
Downloads
233
Categories
Productivity

- Runs on Chromium, Firefox, or WebKit
- Supports headless and headed (visible) browser modes
- Slow motion mode for debugging (configurable delay)
- Automatic screenshots on test failure
- Gherkin feature files for behavior-driven development
- Environment variable overrides for all major settings
- Generates HTML test reports

Install dependencies with npm install, then run tests using commands such as npm run mcp or npm run mcp:headed. Configuration can be adjusted in config/test-config.js or via environment variables like BROWSER, HEADLESS, SLOW_MO, TIMEOUT, and BASE_URL. Specific test suites (e.g., login) and browsers (chromium, firefox, webkit) have dedicated npm scripts.

MCP Test Automation

This project contains automated tests using Cucumber.js and Playwright.

Setup

1. Install dependencies:

npm install

Configuration

The test configuration is managed in config/test-config.js. You can modify this file directly or use environment variables to override the default settings.

Key Configuration Options

- Browser Type: Choose between Chromium, Firefox, or WebKit
- Headless Mode: Run tests with or without visible browser
- Viewport Size: Configure browser window dimensions
- Test Timeouts: Set global timeout for test steps
- Screenshots: Enable/disable screenshots on test failure
- Test Data: Configure test credentials and other data

Environment Variables

You can use the following environment variables to override configuration:

- BROWSER: Set browser type ('chromium', 'firefox', 'webkit')
- HEADLESS: Control headless mode ('true', 'false')
- SLOW_MO: Add delay between test actions in milliseconds
- TIMEOUT: Set global timeout in milliseconds
- BASE_URL: Override the base URL
- TEST_USERNAME: Set test username
- TEST_PASSWORD: Set test password

Running Tests

Basic Usage

Run all feature tests:

npm run mcp

Run Options

- Headless Mode (default): npm run mcp:headless
- Headed Mode (browser visible): npm run mcp:headed
- Specific Browser:
- Firefox: npm run mcp:firefox
- WebKit: npm run mcp:webkit
- Chromium: npm run mcp:chrome
- Run only login tests: npm run mcp:login
- Slow motion for debugging: npm run mcp:slow
- Generate HTML report: npm run mcp:report

Custom Environment Variables

You can also set custom environment variables before running tests:

set BASE_URL=https://dev.gatherit.co&& npm run mcp

For multiple options:

set HEADLESS=false&& set BROWSER=firefox&& set SLOW_MO=50&& npm run mcp

Screenshots

When a test fails, a screenshot is automatically captured and saved to the screenshots directory (if enabled in config).

Feature Files

The tests are written in Gherkin format in .feature files. The main features include:

- Login functionality
- Project creation
- Item management

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.