UNPKG

@skyramp/mcp

Version:

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

42 lines (38 loc) 1.84 kB
import { z } from "zod"; import { baseSchema, baseTraceSchema } from "../types/TestTypes.js"; import { TestGenerationService, } from "../services/TestGenerationService.js"; const e2eTestSchema = { ...baseSchema.shape, ...baseTraceSchema.shape, playwrightInput: z .string() .describe("MUST be absolute path to the playwright input file like /path/to/playwright-ui-test.zip and MUST be a zip file"), }; export class E2ETestService extends TestGenerationService { getTestType() { return "e2e"; } buildGenerationOptions(params) { return { ...super.buildBaseGenerationOptions(params), responseData: params.responseData, playwrightInput: params.playwrightInput, }; } } export function registerE2ETestTool(server) { server.registerTool("skyramp_e2e_test_generation", { description: `Generate an End-to-End (E2E) test using Skyramp's deterministic test generation platform. End-to-End tests validate complete user journeys by testing the entire application flow from frontend UI interactions to backend API responses. They ensure that all components work together correctly in realistic user scenarios, providing the highest confidence in application functionality. TRACE & UI INTEGRATION: E2E tests require both trace files (capturing backend API interactions) and Playwright recordings (capturing UI interactions) to generate comprehensive tests that validate the complete user experience. For detailed documentation visit: https://www.skyramp.dev/docs/e2e-test`, inputSchema: e2eTestSchema, annotations: { keywords: ["e2e test", "end-to-end test"], }, }, async (params) => { const service = new E2ETestService(); return await service.generateTest(params); }); }