@skyramp/mcp
Version:
Skyramp MCP (Model Context Protocol) Server - AI-powered test generation and execution
42 lines (39 loc) • 1.82 kB
JavaScript
import { baseSchema } from "../types/TestTypes.js";
import { z } from "zod";
import { TestGenerationService, } from "../services/TestGenerationService.js";
export class UITestService extends TestGenerationService {
getTestType() {
return "ui";
}
buildGenerationOptions(params) {
const options = this.buildBaseGenerationOptions(params);
return {
...options,
playwrightInput: params.playwrightInput,
};
}
async handleApiAnalysis(params, generateOptions) {
return null;
}
}
// Only include the original params in the schema
const uiTestSchema = {
...baseSchema.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 function registerUITestTool(server) {
server.registerTool("skyramp_ui_test_generation", {
description: `Generate a UI test using Skyramp's deterministic test generation platform.
UI tests validate user interface functionality by simulating real user interactions with your web application. They test user workflows, form submissions, navigation, responsive design, and ensure that your frontend works correctly across different browsers and devices. UI tests use Playwright recordings as input to generate comprehensive test suites that replay user interactions, validate UI elements, and verify expected behaviors in browser environments.
For detailed documentation visit: https://www.skyramp.dev/docs/ui-test`,
inputSchema: uiTestSchema,
annotations: {
keywords: ["ui test", "playwright"],
},
}, async (params) => {
const service = new UITestService();
return await service.generateTest(params);
});
}