Generate test artifacts
wopee_generate_artifactGenerate test artifacts for a suite using AI. Must call sequentially: APP_CONTEXT, then user stories, then test cases. Returns confirmation; use fetch to get the artifact.
Instructions
Generate AI-powered test artifacts for a suite using the Wopee.io AI engine. Each call creates one artifact type — call multiple times for different types. Generation order matters: APP_CONTEXT must be generated before user stories, and user stories before test cases. If called out of order, the AI may produce lower quality results. On success, returns confirmation that generation started. Use wopee_fetch_artifact to retrieve the generated content once ready. Do NOT use this to update existing artifacts — use wopee_update_artifact instead. Generating the same type again overwrites the previous version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Type of test artifact to generate. One of: APP_CONTEXT, GENERAL_USER_STORIES, USER_STORIES_WITH_TEST_CASES, TEST_CASES, TEST_CASE_STEPS, REUSABLE_TEST_CASES, REUSABLE_TEST_CASE_STEPS. Start with APP_CONTEXT, then generate stories and test cases from it. | |
| suiteUuid | Yes | UUID of the analysis suite to generate artifacts for. Get this from wopee_create_blank_suite or wopee_fetch_analysis_suites. |
Implementation Reference
- src/tools/index.ts:3-3 (registration)Import of wopeeGenerateArtifact into the tools array for registration
import { wopeeGenerateArtifact } from "./wopee_generate_artifact/index.js"; - src/tools/index.ts:23-23 (registration)Registration of wopeeGenerateArtifact in the TOOLS array
wopeeGenerateArtifact, - Tool definition for wopee_generate_artifact with name, config (title, description, inputSchema), and handler that delegates to generateAIDataFile
export const wopeeGenerateArtifact = { name: ToolName.WOPEE_GENERATE_ARTIFACT, config: { title: "Generate test artifacts", description: "Generate AI-powered test artifacts for a suite using the Wopee.io AI engine. Each call creates one artifact type — call multiple times for different types. Generation order matters: APP_CONTEXT must be generated before user stories, and user stories before test cases. If called out of order, the AI may produce lower quality results. On success, returns confirmation that generation started. Use wopee_fetch_artifact to retrieve the generated content once ready. Do NOT use this to update existing artifacts — use wopee_update_artifact instead. Generating the same type again overwrites the previous version.", inputSchema: GenerateAIDataHandlerInputSchema.shape, }, handler: async (input: GenerateAIDataHandlerInput) => await generateAIDataFile(input), }; - src/tools/shared/schemas.ts:19-30 (schema)GenerateAIDataHandlerInputSchema defining input schema (type enum + suiteUuid) for the tool
export const GenerateAIDataHandlerInputSchema = z.object({ type: z.nativeEnum(GenerateArtifactType, { description: "Type of test artifact to generate. One of: APP_CONTEXT, GENERAL_USER_STORIES, USER_STORIES_WITH_TEST_CASES, TEST_CASES, TEST_CASE_STEPS, REUSABLE_TEST_CASES, REUSABLE_TEST_CASE_STEPS. Start with APP_CONTEXT, then generate stories and test cases from it.", }), suiteUuid: z .string({ description: "UUID of the analysis suite to generate artifacts for. Get this from wopee_create_blank_suite or wopee_fetch_analysis_suites.", }) .min(1, "Suite UUID is required"), }); - src/tools/shared/handlers.ts:70-120 (helper)generateAIDataFile function — the actual handler logic that parses the artifact type, builds the GraphQL input via factory, executes the generation mutation, then fetches and returns the resulting artifact
export async function generateAIDataFile( input: GenerateAIDataHandlerInput, ): Promise<{ content: { type: "text"; text: string; }[]; }> { const { query, dataKey, description } = _parseGenerateArtifactType( input.type, ); if (!query || !dataKey || !description) return { content: [ { type: "text" as const, text: "Failed to parse generation type", }, ], }; try { const generateAIDataInput = createGenerateAIDataInput(input); const parsedInput = GenerateAIDataInputSchema.parse(generateAIDataInput); const generationResult = await requestClient<{ [key: string]: boolean }>( query, { input: parsedInput, }, { timeoutMs: 5 * 60 * 1000 }, ); if (!generationResult?.[dataKey]) return { content: [ { type: "text" as const, text: `Failed to generate ${description}: no result returned`, }, ], }; const convertedType = _convertToArtifactType(input.type); return await fetchArtifact({ suiteUuid: parsedInput.suiteUuid, type: convertedType, }); } catch (error) { return _parseError(error); } }