Automation Script Generator MCP Server
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.
šÆ 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
/
āāā .agent/rules/ # Antigravity context rules
āāā config/ # Configuration files
ā āāā notion.config.ts # Notion API keys and DB IDs
āāā src/
ā āāā generator/ # THE BUILDER
ā ā āāā fetcher.ts # Pulls from Notion
ā ā āāā translator.ts # Gemini Agent (Notion -> TS Code)
ā ā āāā writer.ts # Saves .spec.ts files
ā āāā framework/ # THE RUNNER
ā ā āāā pages/ # Page Objects (POM)
ā ā āāā actions/ # Self-healing wrappers
ā āāā tests/ # Generated Spec files live here
āāā playwright.config.ts
āāā .env # Contains API Keys
āāā package.jsonāļø 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:
npx ts-node src/generator/main.tsArtifacts:
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:
npm testVideo: Recorded for ALL runs (available in Allure report).
Screenshots: Captured only on failure.
3. View Reports
To generate and view the Allure test report:
npm run test:report # Generates report (cleans old results)
npm run test:open # Opens report in browserš§ 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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/raymondsambur/automation-script-generator'
If you have feedback or need assistance with the MCP directory API, please join our Discord server