Skip to main content
Glama
raymondsambur

Automation Script Generator MCP Server

generate_component_file

Creates a component file with specified data items and saves it to a designated path, enabling efficient test scenario management in WDIO test suites.

Instructions

Generate component file with collection of data items (only if needed)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_itemsYesCollection of data items for the component
output_pathYesPath where the component file should be saved
scenario_titleYesTitle of the test scenario

Implementation Reference

  • Handler function that generates the complete content for a component file (test data file) based on scenario title and data items. This is the core implementation for creating component files.
    buildComponentFileContent(scenario_title, data_items = {}) { let content = ''; // Add header if (this.config.get('fileGeneration.includeMetadata')) { content += this.generateFileHeader('Test Data Component', scenario_title); } // Add JSDoc if (this.config.shouldEnforceJSDoc()) { content += `/**\n * Test data for ${scenario_title}\n */\n\n`; } // Generate data objects Object.keys(data_items).forEach(key => { const dataObject = data_items[key]; content += `export const ${key} = {\n`; Object.keys(dataObject).forEach(prop => { const value = typeof dataObject[prop] === 'string' ? `'${dataObject[prop]}'` : dataObject[prop]; content += ` ${prop}: ${value},\n`; }); content += '};\n\n'; }); // Add utility functions for data manipulation content += this.generateDataUtilityFunctions(data_items); return this.formatCode(content, 'javascript'); }

Other Tools

Related Tools

Latest Blog Posts

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