@skyramp/mcp
Version:
Skyramp MCP (Model Context Protocol) Server - AI-powered test generation and execution
86 lines (80 loc) • 2.73 kB
JavaScript
export function getLanguageSteps(params) {
const { language, testType } = params;
let pythonSteps = "";
switch (language) {
case "python":
pythonSteps = `
pip3 install skyramp
`;
// e2e and ui tests
if (testType === "e2e" || testType === "ui") {
pythonSteps += `
pip3 install pytest-playwright
python3 -m pytest --browser chromium <test-file>.py
`;
}
// framework pytest
if (params.framework === "pytest") {
pythonSteps += `
pip3 install pytest
python3 -m pytest <test-file>.py
`;
}
// robot framework
if (params.framework === "robot") {
pythonSteps += `
pip3 install robotframework
python3 -m robot <robot-file>.robot
`;
}
break;
case "javascript":
pythonSteps = `
npm install @skyramp/skyramp @playwright/test
npx playwright test <test-file>.spec.js --reporter=list
`;
break;
case "typescript":
pythonSteps = `
npm install @skyramp/skyramp @playwright/test
npx playwright test <test-file>.spec.ts --reporter=list
`;
break;
case "java":
pythonSteps = `
javac -cp "./lib/*" -d target <test-file>.java
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'
`;
}