wopee-mcp 1.25.0 → 1.26.0

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.
@@ -1,3 +1,4 @@
1
1
  import { fetchProjectSummary } from "./fetch_project_summary/index.js";
2
2
  import { fetchTestResults } from "./fetch_test_results/index.js";
3
- export const PROMPTS = [fetchProjectSummary, fetchTestResults];
3
+ import { runTest } from "./run_test/index.js";
4
+ export const PROMPTS = [fetchProjectSummary, fetchTestResults, runTest];
@@ -0,0 +1,46 @@
1
+ import { PromptName } from "../shared/types.js";
2
+ export const runTest = {
3
+ name: PromptName.RUN_TEST,
4
+ config: {
5
+ title: "Run a test",
6
+ description: "Workflow for running a test — discovers existing suites, finds a matching test case, confirms before dispatching. Use when the user asks to run, execute, or try a test.",
7
+ },
8
+ handler: () => ({
9
+ messages: [
10
+ {
11
+ role: "user",
12
+ content: {
13
+ type: "text",
14
+ text: `The user wants to run a test. Follow the "Run a test" workflow below step by step. Do NOT ask the user for URL, login credentials, or "autonomous vs guided" up front.
15
+
16
+ ## "Run a test" workflow
17
+
18
+ Step 1 — Discover existing suites.
19
+ Call 'wopee_fetch_analysis_suites' first. The returned list is the authoritative catalog of apps/suites in this project.
20
+
21
+ Step 2 — Find a matching test case.
22
+ For suites where generatedAnalysisDataState.testCases.isGenerated === true, call 'wopee_fetch_artifact' with type 'USER_STORIES' and scan for a test case that semantically matches the user's request. Match on intent ("add to cart" ≈ "add item to shopping cart"), not literal string equality.
23
+
24
+ Step 3 — Match found → confirm and dispatch.
25
+ Reply with: suite name, test case identifier (e.g. US004:TC006), and a one-line description. End with "Run this test? (yes/no)". Wait for explicit user confirmation before proceeding. On confirmation, call 'wopee_dispatch_agent' with suiteUuid, analysisIdentifier, and the matched testCases (array of { userStoryId, testCaseId }). After dispatch completes, call 'wopee_fetch_executed_test_cases' and summarize pass/fail results plus any failure findings.
26
+
27
+ Step 4 — No match found → offer concrete options.
28
+ If suites exist but no test case matches, reply with exactly three options referencing the existing suites by name:
29
+ 1. Run full analysis on <SuiteName> (<url>) — crawl the app, generate user stories + test cases, then pick the right one. Best for broader coverage. (uses 'wopee_dispatch_analysis')
30
+ 2. Create just this one test quickly on <SuiteName> — generate APP_CONTEXT + USER_STORIES_WITH_TEST_CASES scoped to this scenario and run it. Fastest. (uses 'wopee_create_blank_suite' if needed, then 'wopee_generate_artifact' for APP_CONTEXT first, then USER_STORIES_WITH_TEST_CASES)
31
+ 3. Use a different app — tell me which URL, or say "new" to start fresh.
32
+
33
+ If the project has zero suites, skip the option list and ask for a URL (the only situation where that question is valid).
34
+
35
+ Step 5 — Never dispatch silently.
36
+ Always show the proposed suite + test case (title + identifier) and wait for explicit confirmation before calling 'wopee_dispatch_agent'. If a tool call fails, state the failure in one sentence and propose the next concrete step — do not retry silently and do not loop.
37
+
38
+ ## Ground rules
39
+ - Never re-prompt for information already present in existing suites, artifacts, or prior messages.
40
+ - State clearly which suite + test case you are about to run so the user can cancel.
41
+ - Keep responses concise — no long explanations unless the user asks.`,
42
+ },
43
+ },
44
+ ],
45
+ }),
46
+ };
@@ -2,4 +2,5 @@ export var PromptName;
2
2
  (function (PromptName) {
3
3
  PromptName["FETCH_PROJECT_SUMMARY"] = "fetch-project-summary";
4
4
  PromptName["FETCH_TEST_RESULTS"] = "fetch-test-results";
5
+ PromptName["RUN_TEST"] = "run-test";
5
6
  })(PromptName || (PromptName = {}));
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "bin": {
5
5
  "wopee-mcp": "./build/index.js"
6
6
  },
7
- "version": "1.25.0",
7
+ "version": "1.26.0",
8
8
  "mcpName": "io.github.Wopee-io/wopee-mcp",
9
9
  "description": "Wopee.io MCP server for autonomous testing platform",
10
10
  "main": "./build/index.js",