@uuv/mcp-server 0.2.0 → 0.4.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.
- package/README.md +31 -2
- package/dist/CHANGELOG.md +26 -0
- package/dist/README.md +31 -2
- package/dist/lib/mcp-server-factory.js +82 -6
- package/dist/lib/services/prompt-retriever.service.d.ts +69 -0
- package/dist/lib/services/prompt-retriever.service.js +70 -4
- package/dist/package.json +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ First, install the UUV MCP server with your client.
|
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
<summary>
|
|
61
|
+
<summary>Opencode</summary>
|
|
62
62
|
|
|
63
63
|
Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). For example in `~/.config/opencode/opencode.json`:
|
|
64
64
|
|
|
@@ -84,9 +84,38 @@ Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). F
|
|
|
84
84
|
|
|
85
85
|
<summary>Claude Code</summary>
|
|
86
86
|
|
|
87
|
-
Use the Claude Code CLI to add the
|
|
87
|
+
Use the Claude Code CLI to add the Marketplace plugin for the UUV:
|
|
88
|
+
```bash
|
|
89
|
+
claude plugin marketplace add https://github.com/e2e-test-quest/uuv
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then use the Claude Code CLI to add specific UUV's plugin:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
claude plugin install uuv-e2e-accessibility-test@uuv-e2e-accessibility-test-marketplace
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then use the Claude Code CLI to add the UUV MCP server:
|
|
88
99
|
|
|
89
100
|
```bash
|
|
90
101
|
claude mcp add uuv npx @uuv/mcp-server@latest
|
|
91
102
|
```
|
|
103
|
+
|
|
104
|
+
</details>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<summary>Gemini CLI</summary>
|
|
108
|
+
|
|
109
|
+
To **add** the UUV Extension:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
gemini extensions install https://github.com/e2e-test-quest/uuv --auto-update
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
To **remove** the UUV Extension:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
gemini extensions uninstall uuv-e2e-accessibility-test
|
|
119
|
+
```
|
|
120
|
+
|
|
92
121
|
</details>
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [0.3.0](https://github.com/e2e-test-quest/uuv/compare/mcp-server-v0.2.0...mcp-server-v0.3.0) (2025-11-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **mcp-server:** add claude code plugin, [#1168](https://github.com/e2e-test-quest/uuv/issues/1168) ([8b00804](https://github.com/e2e-test-quest/uuv/commit/8b00804aaeea87b4385e16b5dbdfa01a10319db0))
|
|
7
|
+
* **mcp-server:** add gemini extension, [#1166](https://github.com/e2e-test-quest/uuv/issues/1166) ([b1ee07b](https://github.com/e2e-test-quest/uuv/commit/b1ee07bcf6236fd9c5b0ee8cc30ae786b19fe1b1))
|
|
8
|
+
|
|
9
|
+
# [0.2.0](https://github.com/e2e-test-quest/uuv/compare/mcp-server-v0.1.3...mcp-server-v0.2.0) (2025-11-30)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **docs:** clone dictionary during doc generation ([c357bb8](https://github.com/e2e-test-quest/uuv/commit/c357bb8cb18f8aca0ade49e512c806c768030054))
|
|
15
|
+
* **runner-cypress:** update dependency @cypress/webpack-preprocessor to v7.0.2 ([1e2abab](https://github.com/e2e-test-quest/uuv/commit/1e2abab644d26e6b6fd65a00c8d6edd4cdbd2fb6))
|
|
16
|
+
* **runner-playwright:** update dependency chokidar to v4.0.3 ([0e11d27](https://github.com/e2e-test-quest/uuv/commit/0e11d27808d47d77ae982b8874492c98c0afdb76))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **mcp-server:** introduce unit-test for mcp-server and domSelector for generate_expect_elem, [#1164](https://github.com/e2e-test-quest/uuv/issues/1164) ([a1aabb3](https://github.com/e2e-test-quest/uuv/commit/a1aabb359ee780905cbbdf8d07248b59965208ca))
|
|
22
|
+
* **mcp-server:** refactor and add generate within and type tool, [#1164](https://github.com/e2e-test-quest/uuv/issues/1164) ([49530fb](https://github.com/e2e-test-quest/uuv/commit/49530fbcdfba9bc37b3978a15f155cd6ec98b9f5))
|
|
23
|
+
* **mcp-server:** refactor and add generate_test_click_element tool, [#1164](https://github.com/e2e-test-quest/uuv/issues/1164) ([7db8860](https://github.com/e2e-test-quest/uuv/commit/7db8860d55e21c126f6bfb043a4d721366217e87))
|
|
24
|
+
* **mcp-server:** rename tools generate_role_and_name and generate_table, [#1164](https://github.com/e2e-test-quest/uuv/issues/1164) ([2044197](https://github.com/e2e-test-quest/uuv/commit/204419743916269d7e238d11cbd073b5118ff4c1))
|
|
25
|
+
* **runner-cypress:** update dependency cypress to v15.7.0 ([36f50df](https://github.com/e2e-test-quest/uuv/commit/36f50dfebe23be556ade0c3e7ed5a53d9214bd9a))
|
|
26
|
+
|
|
1
27
|
## [0.1.3](https://github.com/e2e-test-quest/uuv/compare/mcp-server-v0.1.2...mcp-server-v0.1.3) (2025-11-21)
|
|
2
28
|
|
|
3
29
|
|
package/dist/README.md
CHANGED
|
@@ -58,7 +58,7 @@ First, install the UUV MCP server with your client.
|
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
<summary>
|
|
61
|
+
<summary>Opencode</summary>
|
|
62
62
|
|
|
63
63
|
Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). For example in `~/.config/opencode/opencode.json`:
|
|
64
64
|
|
|
@@ -84,9 +84,38 @@ Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). F
|
|
|
84
84
|
|
|
85
85
|
<summary>Claude Code</summary>
|
|
86
86
|
|
|
87
|
-
Use the Claude Code CLI to add the
|
|
87
|
+
Use the Claude Code CLI to add the Marketplace plugin for the UUV:
|
|
88
|
+
```bash
|
|
89
|
+
claude plugin marketplace add https://github.com/e2e-test-quest/uuv
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then use the Claude Code CLI to add specific UUV's plugin:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
claude plugin install uuv-e2e-accessibility-test@uuv-e2e-accessibility-test-marketplace
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then use the Claude Code CLI to add the UUV MCP server:
|
|
88
99
|
|
|
89
100
|
```bash
|
|
90
101
|
claude mcp add uuv npx @uuv/mcp-server@latest
|
|
91
102
|
```
|
|
103
|
+
|
|
104
|
+
</details>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<summary>Gemini CLI</summary>
|
|
108
|
+
|
|
109
|
+
To **add** the UUV Extension:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
gemini extensions install https://github.com/e2e-test-quest/uuv --auto-update
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
To **remove** the UUV Extension:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
gemini extensions uninstall uuv-e2e-accessibility-test
|
|
119
|
+
```
|
|
120
|
+
|
|
92
121
|
</details>
|
|
@@ -39,6 +39,79 @@ function createUUVServer() {
|
|
|
39
39
|
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
40
40
|
domSelector: zod_1.z.string().optional().describe("Dom selector of the element"),
|
|
41
41
|
};
|
|
42
|
+
server.registerPrompt(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE, {
|
|
43
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE].title,
|
|
44
|
+
description: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE].description,
|
|
45
|
+
argsSchema: {
|
|
46
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the table/grid/treegrid is located."),
|
|
47
|
+
},
|
|
48
|
+
}, ({ ...args }) => ({
|
|
49
|
+
messages: [
|
|
50
|
+
{
|
|
51
|
+
role: "assistant",
|
|
52
|
+
content: {
|
|
53
|
+
type: "text",
|
|
54
|
+
text: prompt_retriever_service_1.PromptRetrieverService.retrievePrompt({
|
|
55
|
+
promptName: prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE,
|
|
56
|
+
...args
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
}));
|
|
62
|
+
[
|
|
63
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT,
|
|
64
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT,
|
|
65
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT
|
|
66
|
+
].forEach((promptName) => {
|
|
67
|
+
server.registerPrompt(promptName, {
|
|
68
|
+
title: prompt_retriever_service_1.uuvPrompts[promptName].title,
|
|
69
|
+
description: prompt_retriever_service_1.uuvPrompts[promptName].description,
|
|
70
|
+
argsSchema: {
|
|
71
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the table/grid/treegrid is located."),
|
|
72
|
+
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
73
|
+
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
74
|
+
domSelector: zod_1.z.string().optional().describe("Dom selector of the element")
|
|
75
|
+
}
|
|
76
|
+
}, ({ ...args }) => ({
|
|
77
|
+
messages: [
|
|
78
|
+
{
|
|
79
|
+
role: "assistant",
|
|
80
|
+
content: {
|
|
81
|
+
type: "text",
|
|
82
|
+
text: prompt_retriever_service_1.PromptRetrieverService.retrievePrompt({
|
|
83
|
+
promptName,
|
|
84
|
+
...args
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}));
|
|
90
|
+
});
|
|
91
|
+
server.registerPrompt(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT, {
|
|
92
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT].title,
|
|
93
|
+
description: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT].description,
|
|
94
|
+
argsSchema: {
|
|
95
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the table/grid/treegrid is located."),
|
|
96
|
+
valueToType: zod_1.z.string().describe("Value to type"),
|
|
97
|
+
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
98
|
+
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
99
|
+
domSelector: zod_1.z.string().optional().describe("Dom selector of the element")
|
|
100
|
+
}
|
|
101
|
+
}, ({ ...args }) => ({
|
|
102
|
+
messages: [
|
|
103
|
+
{
|
|
104
|
+
role: "assistant",
|
|
105
|
+
content: {
|
|
106
|
+
type: "text",
|
|
107
|
+
text: prompt_retriever_service_1.PromptRetrieverService.retrievePrompt({
|
|
108
|
+
promptName: prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT,
|
|
109
|
+
...args
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}));
|
|
42
115
|
server.registerTool("retrieve_prompt", {
|
|
43
116
|
title: "Retrieve uuv prompt",
|
|
44
117
|
description: "Retrieve a uuv prompt template for a coding agent based on a prompt name and arguments.",
|
|
@@ -47,12 +120,15 @@ function createUUVServer() {
|
|
|
47
120
|
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE,
|
|
48
121
|
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT,
|
|
49
122
|
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT,
|
|
123
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT,
|
|
124
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT
|
|
50
125
|
]),
|
|
51
126
|
baseUrl: zod_1.z.string().describe("The base URL of the page"),
|
|
52
127
|
// generate_test_* Fields
|
|
53
|
-
accessibleName: zod_1.z.string().optional().describe("Accessible name
|
|
54
|
-
accessibleRole: zod_1.z.string().optional().describe("Accessible role
|
|
128
|
+
accessibleName: zod_1.z.string().optional().describe("Accessible name"),
|
|
129
|
+
accessibleRole: zod_1.z.string().optional().describe("Accessible role"),
|
|
55
130
|
domSelector: zod_1.z.string().optional().describe("Dom selector of the element"),
|
|
131
|
+
valueToType: zod_1.z.string().optional().describe("Value to type")
|
|
56
132
|
},
|
|
57
133
|
}, async ({ ...args }) => {
|
|
58
134
|
return {
|
|
@@ -89,7 +165,7 @@ function createUUVServer() {
|
|
|
89
165
|
};
|
|
90
166
|
});
|
|
91
167
|
server.registerTool("generate_test_expect_element", {
|
|
92
|
-
title: "Generate test that expects of html element with role and name",
|
|
168
|
+
title: "Generate test that expects of html element with (role and name) or domSelector",
|
|
93
169
|
description:
|
|
94
170
|
// eslint-disable-next-line max-len
|
|
95
171
|
"Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified accessible name and role or domSelector. Use this when the user asks to create/write/generate a UUV scenario or test for checking element visibility. DON'T USE IF ACCESSIBLE ROLE IS grid, treegrid, table, or form",
|
|
@@ -101,7 +177,7 @@ function createUUVServer() {
|
|
|
101
177
|
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.EXPECT, baseUrl, accessibleName, accessibleRole, domSelector });
|
|
102
178
|
});
|
|
103
179
|
server.registerTool("generate_test_click_element", {
|
|
104
|
-
title: "Generate test that clicks on html element with role and name",
|
|
180
|
+
title: "Generate test that clicks on html element with (role and name) or domSelector",
|
|
105
181
|
description:
|
|
106
182
|
// eslint-disable-next-line max-len
|
|
107
183
|
"Generate a complete UUV test scenario (Gherkin format) to click on an element with specified accessible name and role or domSelector. Use this when the user asks to create/write/generate a UUV scenario or test for checking element visibility. DON'T USE IF ACCESSIBLE ROLE IS grid, treegrid, table, or form",
|
|
@@ -110,7 +186,7 @@ function createUUVServer() {
|
|
|
110
186
|
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.CLICK, baseUrl, accessibleName, accessibleRole, domSelector });
|
|
111
187
|
});
|
|
112
188
|
server.registerTool("generate_test_within_element", {
|
|
113
|
-
title: "Generate test that focus within an html element with role and name",
|
|
189
|
+
title: "Generate test that focus within an html element with (role and name) or domSelector",
|
|
114
190
|
description:
|
|
115
191
|
// eslint-disable-next-line max-len
|
|
116
192
|
"Generate a complete UUV test scenario (Gherkin format) that focus within an html element with specified accessible name and role or domSelector. Use this when the user asks to create/write/generate a UUV scenario or test for checking element visibility. DON'T USE IF ACCESSIBLE ROLE IS grid, treegrid, table, or form",
|
|
@@ -119,7 +195,7 @@ function createUUVServer() {
|
|
|
119
195
|
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.WITHIN, baseUrl, accessibleName, accessibleRole, domSelector });
|
|
120
196
|
});
|
|
121
197
|
server.registerTool("generate_test_type_element", {
|
|
122
|
-
title: "Generate test that types a value into html element with role and name",
|
|
198
|
+
title: "Generate test that types a value into html element with (role and name) or domSelector",
|
|
123
199
|
description:
|
|
124
200
|
// eslint-disable-next-line max-len
|
|
125
201
|
"Generate a complete UUV test scenario (Gherkin format) that types a value into an html element with specified accessible name and role or domSelector. Use this when the user asks to create/write/generate a UUV scenario or test for checking element visibility. DON'T USE IF ACCESSIBLE ROLE IS grid, treegrid, table, or form",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
type PromptExtraArgs = Record<string, any>;
|
|
2
3
|
export type PromptArgs = {
|
|
3
4
|
promptName: UUV_PROMPT;
|
|
@@ -9,6 +10,74 @@ export declare enum UUV_PROMPT {
|
|
|
9
10
|
GENERATE_TEST_WITHIN_ELEMENT = "generate_test_within_element",
|
|
10
11
|
GENERATE_TEST_TYPE_ELEMENT = "generate_test_type_element"
|
|
11
12
|
}
|
|
13
|
+
export declare const uuvPrompts: {
|
|
14
|
+
generate_test_expect_table: {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
generate_test_expect_element: {
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
generate_test_click_element: {
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
generate_test_within_element: {
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
generate_test_type_element: {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const UUVPromptInputSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"promptName", [z.ZodObject<{
|
|
36
|
+
promptName: z.ZodLiteral<UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE>;
|
|
37
|
+
baseUrl: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE;
|
|
40
|
+
baseUrl: string;
|
|
41
|
+
}, {
|
|
42
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE;
|
|
43
|
+
baseUrl: string;
|
|
44
|
+
}>, z.ZodObject<{
|
|
45
|
+
promptName: z.ZodEnum<[UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT, UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT, UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT, UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT]>;
|
|
46
|
+
baseUrl: z.ZodString;
|
|
47
|
+
accessibleName: z.ZodOptional<z.ZodString>;
|
|
48
|
+
accessibleRole: z.ZodOptional<z.ZodString>;
|
|
49
|
+
domSelector: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT | UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT | UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT | UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT;
|
|
52
|
+
baseUrl: string;
|
|
53
|
+
accessibleName?: string | undefined;
|
|
54
|
+
accessibleRole?: string | undefined;
|
|
55
|
+
domSelector?: string | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT | UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT | UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT | UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT;
|
|
58
|
+
baseUrl: string;
|
|
59
|
+
accessibleName?: string | undefined;
|
|
60
|
+
accessibleRole?: string | undefined;
|
|
61
|
+
domSelector?: string | undefined;
|
|
62
|
+
}>]>, {
|
|
63
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE;
|
|
64
|
+
baseUrl: string;
|
|
65
|
+
} | {
|
|
66
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT | UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT | UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT | UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT;
|
|
67
|
+
baseUrl: string;
|
|
68
|
+
accessibleName?: string | undefined;
|
|
69
|
+
accessibleRole?: string | undefined;
|
|
70
|
+
domSelector?: string | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE;
|
|
73
|
+
baseUrl: string;
|
|
74
|
+
} | {
|
|
75
|
+
promptName: UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT | UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT | UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT | UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT;
|
|
76
|
+
baseUrl: string;
|
|
77
|
+
accessibleName?: string | undefined;
|
|
78
|
+
accessibleRole?: string | undefined;
|
|
79
|
+
domSelector?: string | undefined;
|
|
80
|
+
}>;
|
|
12
81
|
export declare class PromptRetrieverService {
|
|
13
82
|
private static loadPromptTemplate;
|
|
14
83
|
private static generatePrompt;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PromptRetrieverService = exports.UUV_PROMPT = void 0;
|
|
3
|
+
exports.PromptRetrieverService = exports.UUVPromptInputSchema = exports.uuvPrompts = exports.UUV_PROMPT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path = tslib_1.__importStar(require("node:path"));
|
|
6
6
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
@@ -14,6 +14,60 @@ var UUV_PROMPT;
|
|
|
14
14
|
UUV_PROMPT["GENERATE_TEST_WITHIN_ELEMENT"] = "generate_test_within_element";
|
|
15
15
|
UUV_PROMPT["GENERATE_TEST_TYPE_ELEMENT"] = "generate_test_type_element";
|
|
16
16
|
})(UUV_PROMPT || (exports.UUV_PROMPT = UUV_PROMPT = {}));
|
|
17
|
+
exports.uuvPrompts = {
|
|
18
|
+
[UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE]: {
|
|
19
|
+
title: "GenerateTestExpectTable",
|
|
20
|
+
description: "Prompt to generate test for html table or grid or treeGrid"
|
|
21
|
+
},
|
|
22
|
+
[UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT]: {
|
|
23
|
+
title: "GenerateTestExpectElement",
|
|
24
|
+
description: "Prompt to generate test that expects of html element with (role and name) or domSelector"
|
|
25
|
+
},
|
|
26
|
+
[UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT]: {
|
|
27
|
+
title: "GenerateTestClickElement",
|
|
28
|
+
description: "Prompt to generate test that clicks on html element with (role and name) or domSelector"
|
|
29
|
+
},
|
|
30
|
+
[UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT]: {
|
|
31
|
+
title: "GenerateTestWithinElement",
|
|
32
|
+
description: "Prompt to generate test that focus within an html element with (role and name) or domSelector"
|
|
33
|
+
},
|
|
34
|
+
[UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT]: {
|
|
35
|
+
title: "GenerateTestTypeElement",
|
|
36
|
+
description: "Prompt to generate test that types a value into html element with (role and name) or domSelector"
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.UUVPromptInputSchema = zod_1.z.discriminatedUnion("promptName", [
|
|
40
|
+
zod_1.z.object({
|
|
41
|
+
promptName: zod_1.z.literal(UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE),
|
|
42
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the table/grid/treegrid is located."),
|
|
43
|
+
}),
|
|
44
|
+
zod_1.z.object({
|
|
45
|
+
promptName: zod_1.z.enum([
|
|
46
|
+
UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT,
|
|
47
|
+
UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT,
|
|
48
|
+
UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT,
|
|
49
|
+
UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT
|
|
50
|
+
]),
|
|
51
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the element is located."),
|
|
52
|
+
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
53
|
+
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
54
|
+
domSelector: zod_1.z.string().optional().describe("Dom selector of the element"),
|
|
55
|
+
}),
|
|
56
|
+
]).superRefine((data, ctx) => {
|
|
57
|
+
if (data.promptName === UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT ||
|
|
58
|
+
data.promptName === UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT ||
|
|
59
|
+
data.promptName === UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT ||
|
|
60
|
+
data.promptName === UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT) {
|
|
61
|
+
const hasAccessibleSelector = data.accessibleRole && data.accessibleName;
|
|
62
|
+
const hasDomSelector = data.domSelector;
|
|
63
|
+
if (!hasAccessibleSelector && !hasDomSelector) {
|
|
64
|
+
ctx.addIssue({
|
|
65
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
66
|
+
message: "You must provide either (accessibleRole AND accessibleName) or domSelector",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
17
71
|
class PromptRetrieverService {
|
|
18
72
|
static loadPromptTemplate(promptName) {
|
|
19
73
|
const templatePath = path.join(__dirname, "..", "prompts", `${promptName}.mustache`);
|
|
@@ -33,16 +87,28 @@ class PromptRetrieverService {
|
|
|
33
87
|
promptName: zod_1.z.enum([
|
|
34
88
|
UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT,
|
|
35
89
|
UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT,
|
|
36
|
-
UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT
|
|
37
|
-
UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT
|
|
90
|
+
UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT
|
|
38
91
|
]),
|
|
39
92
|
baseUrl: zod_1.z.string().describe("The base URL of the page where the element is located."),
|
|
40
93
|
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
41
94
|
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
42
95
|
domSelector: zod_1.z.string().optional().describe("Dom selector of the element"),
|
|
43
96
|
}),
|
|
97
|
+
zod_1.z.object({
|
|
98
|
+
promptName: zod_1.z.enum([
|
|
99
|
+
UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT
|
|
100
|
+
]),
|
|
101
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the element is located."),
|
|
102
|
+
valueToType: zod_1.z.string().describe("Value to type"),
|
|
103
|
+
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
104
|
+
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
105
|
+
domSelector: zod_1.z.string().optional().describe("Dom selector of the element"),
|
|
106
|
+
})
|
|
44
107
|
]).superRefine((data, ctx) => {
|
|
45
|
-
if (data.promptName === UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT ||
|
|
108
|
+
if (data.promptName === UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT ||
|
|
109
|
+
data.promptName === UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT ||
|
|
110
|
+
data.promptName === UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT ||
|
|
111
|
+
data.promptName === UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT) {
|
|
46
112
|
const hasAccessibleSelector = data.accessibleRole && data.accessibleName;
|
|
47
113
|
const hasDomSelector = data.domSelector;
|
|
48
114
|
if (!hasAccessibleSelector && !hasDomSelector) {
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A Model Context Protocol (MCP) server for UUV - a solution to facilitate the writing and execution of E2E tests understandable by any human being(English or French) using cucumber(BDD) and cypress or playwright.",
|
|
5
5
|
"author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@modelcontextprotocol/sdk": "1.17.5",
|
|
60
60
|
"@types/mustache": "^4.2.6",
|
|
61
|
-
"@uuv/assistant": "2.
|
|
62
|
-
"@uuv/dictionary": "0.
|
|
61
|
+
"@uuv/assistant": "2.74.0",
|
|
62
|
+
"@uuv/dictionary": "0.2.0",
|
|
63
63
|
"jsdom": "26.1.0",
|
|
64
64
|
"mustache": "^4.2.0",
|
|
65
65
|
"tsconfig-paths": "4.2.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A Model Context Protocol (MCP) server for UUV - a solution to facilitate the writing and execution of E2E tests understandable by any human being(English or French) using cucumber(BDD) and cypress or playwright.",
|
|
5
5
|
"author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
|
|
6
6
|
"license": "MIT",
|