@askqa/mcp 1.2.7 → 1.2.8
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/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/server.js +9 -5
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -226,7 +226,7 @@ server.registerTool(
|
|
|
226
226
|
server.registerTool(
|
|
227
227
|
"detect_tests",
|
|
228
228
|
{
|
|
229
|
-
description: "Start here when a user wants to monitor a new site. Screenshots the URL and uses AI to suggest 2-3 meaningful e2e tests tailored to that specific site (e.g. checkout flow, login, add to cart). Returns a page_summary and a list of suggestions with names, descriptions, and step sketches. After calling this: present the suggestions to the user, let them pick which ones to add, then YOU write the Playwright test code for each chosen test, validate with validate_test, iterate until it passes, then save with create_test.",
|
|
229
|
+
description: "Start here when a user wants to monitor a new site. Screenshots the URL and uses AI to suggest 2-3 meaningful e2e tests tailored to that specific site (e.g. checkout flow, login, add to cart). Returns a page_summary and a list of suggestions with names, descriptions, and step sketches. After calling this: present the suggestions to the user, let them pick which ones to add, then YOU write the Playwright test code for each chosen test, validate with validate_test, iterate until it passes, then save with create_test. NAVIGATION RULE: test code must only call page.goto() once, to the site root/homepage. All further navigation (to product pages, category pages, etc.) must be through real user interactions — menu hovers, link clicks, form submissions. Never use page.goto() to jump directly to a sub-page or product URL.",
|
|
230
230
|
readOnlyHint: true,
|
|
231
231
|
inputSchema: {
|
|
232
232
|
url: z.string().describe("The website URL to analyze (e.g. 'https://my-store.com')"),
|
|
@@ -280,7 +280,7 @@ server.registerTool(
|
|
|
280
280
|
server.registerTool(
|
|
281
281
|
"create_test",
|
|
282
282
|
{
|
|
283
|
-
description: "Save a validated test. IMPORTANT: For code-based tests, only call this AFTER validate_test confirms the test passes — never save untested code. Use template_id for universal templates (e.g. 'quick-checks') that work on any site without validation. Use code for custom tests after running detect_tests → write code → validate_test. Provide template_id or code, not both.",
|
|
283
|
+
description: "Save a validated test. IMPORTANT: For code-based tests, only call this AFTER validate_test confirms the test passes — never save untested code. Use template_id for universal templates (e.g. 'quick-checks') that work on any site without validation. Use code for custom tests after running detect_tests → write code → validate_test. Provide template_id or code, not both. NAVIGATION RULE: test code must only call page.goto() once, to the site root/homepage. All further navigation must be through real user interactions — menu hovers, link clicks, form submissions. Never use page.goto() to jump directly to a sub-page or product URL.",
|
|
284
284
|
destructiveHint: true,
|
|
285
285
|
inputSchema: {
|
|
286
286
|
name: z.string().describe("A name for this test (e.g. 'Homepage health check')"),
|
|
@@ -375,17 +375,18 @@ server.registerTool(
|
|
|
375
375
|
server.registerTool(
|
|
376
376
|
"validate_test",
|
|
377
377
|
{
|
|
378
|
-
description: "REQUIRED before create_test for any code-based test. Dry-runs Playwright code against a URL without saving it — returns step results, screenshots, and page structure. Steps continue even on failure for maximum debug signal. Iterate here until ALL steps pass, then call create_test to save it.",
|
|
378
|
+
description: "REQUIRED before create_test for any code-based test. Dry-runs Playwright code against a URL without saving it — returns step results, screenshots, and page structure. Steps continue even on failure for maximum debug signal. Iterate here until ALL steps pass, then call create_test to save it. NAVIGATION RULE: test code must only call page.goto() once, to the site root/homepage (the url parameter). All further navigation must be through real user interactions — menu hovers, link clicks, form submissions. Never use page.goto() to jump directly to a sub-page, product URL, or collection path.",
|
|
379
379
|
readOnlyHint: true,
|
|
380
380
|
inputSchema: {
|
|
381
381
|
code: z.string().describe("Custom Playwright test code. Must define an async function test({ page, step, log })."),
|
|
382
382
|
url: z.string().describe("The target URL to test against (e.g. 'https://example.com')"),
|
|
383
|
+
timeout: z.coerce.number().optional().describe("Maximum seconds the test is allowed to run (default: 120, max: 300). Increase for tests with many page navigations."),
|
|
383
384
|
},
|
|
384
385
|
},
|
|
385
|
-
async ({ code, url }) => {
|
|
386
|
+
async ({ code, url, timeout }) => {
|
|
386
387
|
try {
|
|
387
388
|
// POST returns immediately with test_run_id; poll until done (same as run_test)
|
|
388
|
-
const { test_run_id } = await apiPost("/api/tests/validate", { code, url });
|
|
389
|
+
const { test_run_id } = await apiPost("/api/tests/validate", { code, url, timeout });
|
|
389
390
|
const testRun = await pollTestRun(test_run_id);
|
|
390
391
|
const runResult = testRun.result || {};
|
|
391
392
|
const content = [];
|
|
@@ -406,6 +407,9 @@ server.registerTool(
|
|
|
406
407
|
lines.push(" Logs:");
|
|
407
408
|
for (const msg of runResult.logs) lines.push(` ${msg}`);
|
|
408
409
|
}
|
|
410
|
+
if (testRun.trace_viewer_url) {
|
|
411
|
+
lines.push(` Trace: ${testRun.trace_viewer_url}`);
|
|
412
|
+
}
|
|
409
413
|
content.push({ type: "text", text: lines.join("\n") });
|
|
410
414
|
|
|
411
415
|
// Include page info for debugging selectors
|