Overview
What is MCP Test Automation?
MCP Test Automation is a test automation project that uses Cucumber.js and Playwright to run browser-based web application tests. It is designed for developers and QA engineers who need to automate end-to-end testing with support for multiple browsers and configurable run modes.
How to use MCP Test Automation?
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.
Key features of MCP Test Automation
- 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
Use cases of MCP Test Automation
- Run automated regression tests across multiple browser engines
- Debug flaky tests by running in headed mode with slow motion
- Integrate into CI/CD pipelines using headless Chromium
- Test login flows and other critical user journeys via dedicated npm scripts
FAQ from MCP Test Automation
How do I run tests in headed (visible browser) mode?
Use npm run mcp:headed to run tests with the browser window visible.
What environment variables can I use to configure tests?
BROWSER, HEADLESS, SLOW_MO, TIMEOUT, BASE_URL, TEST_USERNAME, and TEST_PASSWORD can override settings in config/test-config.js.
How do I run tests on a specific browser?
Use the dedicated npm scripts: npm run mcp:chrome, npm run mcp:firefox, or npm run mcp:webkit.
Are screenshots captured on test failure?
Yes, if screenshots are enabled in configuration, a screenshot is automatically saved to the screenshots directory when a test fails.
Can I generate an HTML report of test results?
Yes, run npm run mcp:report to generate an HTML test report.