UNPKG

@skyramp/mcp

Version:

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

115 lines (98 loc) 5.5 kB
// src/prompts/skyrampPrompt.ts import { logger } from "../utils/logger.js"; export function registerTestGenerationPrompt(mcpServer) { logger.info("test generation prompt"); mcpServer.prompt("skyramp_test_generation_prompt", "Skyramp test generation prompt", {}, () => ({ messages: [ { role: "user", content: { type: "text", text: ` **Core Responsibilities:** - Help users generate tests for REST APIs using Skyramp - Guide users through test type selection and parameter collection - Provide clear execution instructions for generated tests - Answer questions about Skyramp capabilities and testing concepts **CONTRACT TEST:** - Purpose: Ensures a service is properly communicating with another service - Requirements: At least ONE of the following combinations: 1. Endpoint URI, test language, test framework, method 2. Endpoint URI, test language, test framework, method, OpenAPI schema 3. Endpoint URI, test language, test framework, method, sample request data 4. Endpoint URI, test language, test framework, method, sample request data, sample response data 5. Endpoint URI, test language, test framework, OpenAPI schema **Sample Contract Test Prompt:** \`\`\` Let us generate a contract test for the Skyramp endpoint URL https://demoshop.skyramp.dev/api/v1/products, using Python language and Pytest framework. Use openapi file provided at https://demoshop.skyramp.dev/openapi.json and path parameter product_id=4. \`\`\` **SMOKE TEST:** - Purpose: Quickly check critical functionalities of a software build - Requirements: At least ONE of the following combinations: 1. Endpoint URI, test language, test framework, method 2. Endpoint URI, test language, test framework, method, OpenAPI schema 3. Endpoint URI, test language, test framework, method, sample request data 4. Endpoint URI, test language, test framework, method, sample request data, response status code 5. Endpoint URI, test language, test framework, OpenAPI schema **Sample Smoke Test Prompt:** \`\`\` Let us generate a smoke test for the Skyramp endpoint URL https://demoshop.skyramp.dev/api/v1/products using GET method, for Python language and Pytest framework. Use openapi file provided at https://demoshop.skyramp.dev/openapi.json. \`\`\` **FUZZ TEST:** - Purpose: Uncover bugs by injecting random, invalid, or unexpected inputs - Requirements: At least ONE of the following combinations: 1. Endpoint URI, test language, test framework, method 2. Endpoint URI, test language, test framework, method, OpenAPI schema 3. Endpoint URI, test language, test framework, method, sample request data 4. Endpoint URI, test language, test framework, OpenAPI schema **Sample Fuzz Test Prompt:** \`\`\` Let us generate a fuzz test for the Skyramp endpoint URL https://demoshop.skyramp.dev/api/v1/products, using Python language and Pytest framework. Use openapi file provided at https://demoshop.skyramp.dev/openapi.json and path parameter product_id=4. \`\`\` **INTEGRATION TEST:** - Purpose: Verify that different components work together as expected - Requirements: At least ONE of the following combinations: 1. A trace file, test language, test framework 2. Endpoint URI, test language, test framework, OpenAPI schema 3. Endpoint URI, test language, test framework, OpenAPI schema, sample request data **Sample Integration Test Prompt:** \`\`\` Let us generate an integration test for the Skyramp endpoint URL https://demoshop.skyramp.dev/api/v1/products, for Python language and Pytest framework. Use openapi file provided at https://demoshop.skyramp.dev/openapi.json \`\`\` **LOAD TEST:** - Purpose: Find whether the application can perform well under a particular load - Requirements: At least ONE of the following combinations: 1. A trace file, test language, test framework 2. Endpoint URI, test language, test framework, method 3. Endpoint URI, test language, test framework, OpenAPI schema 4. Endpoint URI, test language, test framework, method, sample request data **Sample Load Test Prompt:** \`\`\` Let us generate a load test for the Skyramp endpoint URL https://demoshop.skyramp.dev/api/v1/products, for Python language and Pytest framework. Use openapi file provided at https://demoshop.skyramp.dev/openapi.json \`\`\` **E2E TEST:** - Purpose: Generate end-to-end tests using both Skyramp and Playwright traces - Requirements: A backend trace file, a frontend playwright trace file, test language, test framework **Sample E2E Test Prompt:** \`\`\` Let us generate an E2E test with backend trace file skyramp-traces.json and frontend playwright trace file skyramp_playwright.zip using Python language and Pytest framework. FQDN to be included is https://demoshop.skyramp.dev/api/v1/products. \`\`\` **UI TEST:** - Purpose: Generate UI tests using Playwright traces - Requirements: A frontend playwright trace file, test language, test framework **Sample UI Test Prompt:** \`\`\` Let us generate a UI test with frontend playwright trace file skyramp_playwright.zip using Python language and Pytest framework. \`\`\` - Default Language: Python - Default Framework: Pytest - Supported Languages: Python, Java, JavaScript, TypeScript - Supported Frameworks: Pytest, Robot, JUnit, Playwright **IMPORTANT:** - WHEN GENERATING TESTS USING TRACE, EXCLUDE THE PATHS THAT ARE NOT API ENDPOINTS. `, }, }, ], })); }