This server automates the generation of WebDriverIO (WDIO) test automation code from test scenarios, with pattern analysis and AI-powered code review capabilities.
Core Capabilities:
Process Complete Test Scenarios - Generate all required WDIO test files (features, steps, pages, components) from a single test scenario with Gherkin syntax, selectors, and test data in one operation
Analyze Repository Patterns - Scan existing codebases to identify and learn from established testing patterns, formats, and validation rules for consistency
Generate Individual Test Files - Create specific WDIO files:
Feature files with Gherkin syntax and test ID tags
Step definition files that implement Gherkin steps and reuse existing functions
Page object files with element selectors and reusable page functions
Component files containing test data collections and configurations
Review and Enhance Code - Automatically analyze and improve generated code with:
Documentation and comments
Page Object Model (POM) pattern enforcement
Reusable and utility function extraction
Proper formatting
Integration with existing step definitions
Customize Output - Specify output directories and paths for generated files, allowing seamless integration into existing project structures
Implements robust input validation using AJV (Another JSON Schema Validator) to validate all tool inputs against defined schemas before execution, providing type checking, required field validation, and detailed error messages.
Supports environment configuration through .env files for setting parameters like repository paths, output paths, and WDIO configuration paths.
Requires Node.js 18+ as a runtime environment for the MCP server operation.
Fetches test scenarios from Notion databases, including scenario titles, tags, Gherkin syntax, selectors, and data items for test generation.
Generates complete test suites with the WebDriverIO framework, including feature files (Gherkin syntax), step definition files, Page Object Model files, and component files for automated testing.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Automation Script Generator MCP Servergenerate a test for user login with 2FA"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Automation Script Generator
š Project Mission: Hybrid AI Automation Framework (Notion -> Playwright)
This project creates an autonomous end-to-end testing framework that bridges the gap between manual test case management and automated execution. It leverages Generative AI to automatically generate robust Playwright test scripts from Notion test tickets.
Related MCP server: Screenshot MCP Server
šÆ Objectives
Read: Fetch test scenarios directly from a Notion Database.
Generate: Create executable Playwright (TypeScript) scripts automatically using Google Gemini.
Execute: Run tests with a "Self-Healing" mechanism for resilient locators.
Report: Generate detailed reports via Allure and reflect status updates back to Notion.
š ļø Tech Stack
Language: TypeScript, Node.js (v20+)
Framework: Playwright
AI Model: Google Gemini (
gemini-2.0-flashvia@google/genaiSDK)Integration: Notion API (
@notionhq/client)Reporting: Allure Report
š Directory Structure
āļø Setup & Installation
Clone the repository:
git clone <repository-url> cd automation-script-generatorInstall dependencies:
npm installEnvironment Configuration: Create a
.envfile in the root directory and add your keys:GEMINI_API_KEY=your_google_gemini_api_key NOTION_TOKEN=your_notion_integration_token NOTION_DATABASE_ID=your_notion_database_id
š Usage
1. Generate Tests
To fetch "Ready for Automation" tickets from Notion and generate Playwright test files with strict Page Object Model separation:
Artifacts:
src/framework/pages/*.page.ts: Page Objects (private selectors, public methods).src/tests/[module]/[module].data.ts: Shared test data per module.src/tests/[module]/[id]...spec.ts: Clean test specs.
2. Run Tests
To execute the generated Playwright tests:
Video: Recorded for ALL runs (available in Allure report).
Screenshots: Captured only on failure.
3. View Reports
To generate and view the Allure test report:
š§ Smart Actions (Self-Healing)
The framework includes a SmartPage wrapper that handles flaky selectors. If a primary selector fails, it attempts to "heal" by using fallback strategies (like text hints) and logs the event, preventing brittle test failures.