@skyramp/mcp 0.0.65 → 0.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/playwright/traceRecordingPrompt.js +30 -36
- package/build/prompts/architectPersona.js +19 -0
- package/build/prompts/test-maintenance/drift-analysis-prompt.js +11 -6
- package/build/prompts/test-maintenance/drift-analysis-prompt.test.js +49 -0
- package/build/prompts/test-maintenance/driftAnalysisSections.js +4 -2
- package/build/prompts/test-recommendation/analysisOutputPrompt.js +42 -50
- package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.js +125 -0
- package/build/prompts/test-recommendation/recommendationSections.js +121 -4
- package/build/prompts/test-recommendation/registerRecommendTestsPrompt.js +151 -9
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +416 -61
- package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +455 -63
- package/build/prompts/testbot/testbot-prompts.js +111 -100
- package/build/prompts/testbot/testbot-prompts.test.js +142 -0
- package/build/resources/analysisResources.js +13 -5
- package/build/services/ScenarioGenerationService.js +2 -2
- package/build/services/ScenarioGenerationService.test.js +35 -0
- package/build/services/TestExecutionService.js +1 -1
- package/build/tools/code-refactor/modularizationTool.js +2 -2
- package/build/tools/executeSkyrampTestTool.js +4 -3
- package/build/tools/generate-tests/generateBatchScenarioRestTool.js +51 -21
- package/build/tools/generate-tests/generateContractRestTool.js +26 -4
- package/build/tools/generate-tests/generateIntegrationRestTool.js +44 -13
- package/build/tools/generate-tests/generateScenarioRestTool.js +17 -39
- package/build/tools/generate-tests/generateUIRestTool.js +69 -4
- package/build/tools/submitReportTool.js +27 -13
- package/build/tools/test-management/analyzeChangesTool.js +32 -10
- package/build/tools/test-management/analyzeChangesTool.test.js +85 -0
- package/build/types/RepositoryAnalysis.js +25 -3
- package/build/types/TestRecommendation.js +5 -4
- package/build/types/TestTypes.js +44 -9
- package/build/utils/AnalysisStateManager.js +43 -9
- package/build/utils/AnalysisStateManager.test.js +35 -0
- package/build/utils/routeParsers.js +35 -0
- package/build/utils/routeParsers.test.js +66 -1
- package/build/utils/scenarioDrafting.js +207 -360
- package/build/utils/scenarioDrafting.test.js +191 -256
- package/build/utils/trace-parser.js +24 -6
- package/build/utils/trace-parser.test.js +140 -0
- package/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +3 -0
- package/node_modules/playwright/lib/mcp/browser/tab.js +8 -1
- package/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +3 -2
- package/node_modules/playwright/lib/mcp/browser/tools/navigate.js +1 -1
- package/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +4 -4
- package/node_modules/playwright/lib/mcp/browser/tools/tabs.js +5 -4
- package/node_modules/playwright/lib/mcp/browser/tools/wait.js +1 -1
- package/node_modules/playwright/lib/mcp/skyramp/exportTool.js +10 -9
- package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +304 -7
- package/node_modules/playwright/lib/mcp/test/skyRampExport.js +128 -20
- package/package.json +2 -2
- package/node_modules/playwright/lib/mcp/terminal/help.json +0 -32
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
|
-
import { nextjsFileToApiPath, parseRouteLine } from "./routeParsers.js";
|
|
2
|
+
import { nextjsFileToApiPath, parseRouteLine, resolveEndpointPaths } from "./routeParsers.js";
|
|
3
3
|
describe("nextjsFileToApiPath", () => {
|
|
4
4
|
it("converts pages/api route to API path", () => {
|
|
5
5
|
expect(nextjsFileToApiPath("pages/api/users/index.ts")).toBe("/api/users");
|
|
@@ -85,3 +85,68 @@ describe("parseRouteLine", () => {
|
|
|
85
85
|
expect(parseRouteLine("import express from 'express';", "index.ts")).toBeNull();
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
|
+
describe("resolveEndpointPaths", () => {
|
|
89
|
+
const knownEndpoints = [
|
|
90
|
+
{ path: "/api/v1/orders", methods: [{ method: "POST", sourceFile: "routers/order.py" }, { method: "GET", sourceFile: "routers/order.py" }] },
|
|
91
|
+
{ path: "/api/v1/orders/{order_id}", methods: [{ method: "GET", sourceFile: "routers/order.py" }, { method: "PUT", sourceFile: "routers/order.py" }, { method: "DELETE", sourceFile: "routers/order.py" }] },
|
|
92
|
+
{ path: "/api/v1/products", methods: [{ method: "POST", sourceFile: "routers/product.py" }, { method: "GET", sourceFile: "routers/product.py" }] },
|
|
93
|
+
{ path: "/api/v1/products/{product_id}", methods: [{ method: "GET", sourceFile: "routers/product.py" }, { method: "PUT", sourceFile: "routers/product.py" }, { method: "DELETE", sourceFile: "routers/product.py" }] },
|
|
94
|
+
];
|
|
95
|
+
it("resolves router-relative path to full API path", () => {
|
|
96
|
+
const eps = [{ method: "PUT", path: "/{order_id}", sourceFile: "routers/order.py" }];
|
|
97
|
+
resolveEndpointPaths(eps, knownEndpoints);
|
|
98
|
+
expect(eps[0].path).toBe("/api/v1/orders/{order_id}");
|
|
99
|
+
});
|
|
100
|
+
it("leaves already-full paths unchanged", () => {
|
|
101
|
+
const eps = [{ method: "POST", path: "/api/v1/orders", sourceFile: "routers/order.py" }];
|
|
102
|
+
resolveEndpointPaths(eps, knownEndpoints);
|
|
103
|
+
expect(eps[0].path).toBe("/api/v1/orders");
|
|
104
|
+
});
|
|
105
|
+
it("resolves multiple endpoints in one call", () => {
|
|
106
|
+
const eps = [
|
|
107
|
+
{ method: "PUT", path: "/{order_id}", sourceFile: "routers/order.py" },
|
|
108
|
+
{ method: "DELETE", path: "/{order_id}", sourceFile: "routers/order.py" },
|
|
109
|
+
];
|
|
110
|
+
resolveEndpointPaths(eps, knownEndpoints);
|
|
111
|
+
expect(eps[0].path).toBe("/api/v1/orders/{order_id}");
|
|
112
|
+
expect(eps[1].path).toBe("/api/v1/orders/{order_id}");
|
|
113
|
+
});
|
|
114
|
+
it("disambiguates by sourceFile when suffix matches multiple endpoints", () => {
|
|
115
|
+
const ambiguousKnown = [
|
|
116
|
+
{ path: "/api/v1/orders/{id}", methods: [{ method: "PUT", sourceFile: "routers/order.py" }] },
|
|
117
|
+
{ path: "/api/v1/products/{id}", methods: [{ method: "PUT", sourceFile: "routers/product.py" }] },
|
|
118
|
+
];
|
|
119
|
+
const eps = [{ method: "PUT", path: "/{id}", sourceFile: "routers/order.py" }];
|
|
120
|
+
resolveEndpointPaths(eps, ambiguousKnown);
|
|
121
|
+
expect(eps[0].path).toBe("/api/v1/orders/{id}");
|
|
122
|
+
});
|
|
123
|
+
it("does not resolve when no match found", () => {
|
|
124
|
+
const eps = [{ method: "PATCH", path: "/{id}", sourceFile: "routers/unknown.py" }];
|
|
125
|
+
resolveEndpointPaths(eps, knownEndpoints);
|
|
126
|
+
expect(eps[0].path).toBe("/{id}");
|
|
127
|
+
});
|
|
128
|
+
it("does not resolve when ambiguous and sourceFile does not disambiguate", () => {
|
|
129
|
+
const ambiguousKnown = [
|
|
130
|
+
{ path: "/api/v1/orders/{id}", methods: [{ method: "PUT" }] },
|
|
131
|
+
{ path: "/api/v1/products/{id}", methods: [{ method: "PUT" }] },
|
|
132
|
+
];
|
|
133
|
+
const eps = [{ method: "PUT", path: "/{id}", sourceFile: "shared.py" }];
|
|
134
|
+
resolveEndpointPaths(eps, ambiguousKnown);
|
|
135
|
+
expect(eps[0].path).toBe("/{id}");
|
|
136
|
+
});
|
|
137
|
+
it("handles empty arrays gracefully", () => {
|
|
138
|
+
const eps = [];
|
|
139
|
+
resolveEndpointPaths(eps, knownEndpoints);
|
|
140
|
+
expect(eps).toEqual([]);
|
|
141
|
+
const eps2 = [{ method: "PUT", path: "/{id}", sourceFile: "x.py" }];
|
|
142
|
+
resolveEndpointPaths(eps2, []);
|
|
143
|
+
expect(eps2[0].path).toBe("/{id}");
|
|
144
|
+
});
|
|
145
|
+
it("resolves collection-level relative paths (e.g. empty string becomes base)", () => {
|
|
146
|
+
const eps = [{ method: "POST", path: "", sourceFile: "routers/order.py" }];
|
|
147
|
+
resolveEndpointPaths(eps, knownEndpoints);
|
|
148
|
+
// Empty string — endsWith("") is always true, so multiple matches.
|
|
149
|
+
// sourceFile should disambiguate to orders.
|
|
150
|
+
expect(eps[0].path).toBe("/api/v1/orders");
|
|
151
|
+
});
|
|
152
|
+
});
|