UNPKG

@skyramp/mcp

Version:

Skyramp MCP (Model Context Protocol) Server - AI-powered test generation and execution

86 lines (80 loc) 2.73 kB
export function getLanguageSteps(params) { const { language, testType } = params; let pythonSteps = ""; switch (language) { case "python": pythonSteps = ` # Install skyramp dependency pip3 install skyramp `; // e2e and ui tests if (testType === "e2e" || testType === "ui") { pythonSteps += ` # Install playwright dependencies pip3 install pytest-playwright # Execute the test file python3 -m pytest --browser chromium <test-file>.py `; } // framework pytest if (params.framework === "pytest") { pythonSteps += ` # Install pytest dependency pip3 install pytest # Execute test file python3 -m pytest <test-file>.py `; } // robot framework if (params.framework === "robot") { pythonSteps += ` # Install robotframework dependency pip3 install robotframework # Execution of test file python3 -m robot <robot-file>.robot `; } break; case "javascript": pythonSteps = ` # install dependencies for package.json npm install @skyramp/skyramp @playwright/test # Execution of test file npx playwright test <test-file>.spec.js --reporter=list `; break; case "typescript": pythonSteps = ` # install dependencies for package.json npm install @skyramp/skyramp @playwright/test # Execution of test file npx playwright test <test-file>.spec.ts --reporter=list `; break; case "java": pythonSteps = ` # Prerequisites # Compile the test file javac -cp "./lib/*" -d target <test-file>.java # Execution of test file JUNIT_PLATFORM_VER="1.9.3" classpath="target:$(echo ./lib/*.jar | tr ' ' ':')" java -jar "./lib/junit-platform-console-standalone-\${JUNIT_PLATFORM_VER}.jar" \\ --classpath "\$classpath" \\ --include-engine=junit-jupiter \\ --select-class=<test-file> \\ --reports-dir=target/test-results `; break; default: return ""; } return pythonSteps + appendExecutionInstruction(); } function appendExecutionInstruction() { return ` - Notify the user that they can also use ** Execute with Skyramp ** tool to run the test.If this is your first test you are trying to execute with Skyramp, it may take a little bit longer than usual because we need to build the image for the first time. - Before I can execute the test for you, I need to confirm the following information: Authentication: Please provide me with your authentication token (by default we assume a Bearer Token). If you don't require any token for your service please just say: 'No token required' `; }