@uuv/mcp-server 0.6.0 → 0.8.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 +63 -46
- package/dist/CHANGELOG.md +26 -0
- package/dist/README.md +63 -46
- package/dist/lib/mcp-server-factory.js +96 -63
- package/dist/lib/prompts/genTestClickDomSelector.mustache +4 -0
- package/dist/lib/prompts/genTestClickRoleAndName.mustache +4 -0
- package/dist/lib/prompts/genTestExpectDomSelector.mustache +4 -0
- package/dist/lib/prompts/genTestExpectRoleAndName.mustache +4 -0
- package/dist/lib/prompts/{generate_test_expect_table.mustache → genTestExpectTable.mustache} +1 -1
- package/dist/lib/prompts/genTestTypeRoleAndName.mustache +4 -0
- package/dist/lib/prompts/genTestWithinDomSelector.mustache +4 -0
- package/dist/lib/prompts/genTestWithinRoleAndName.mustache +4 -0
- package/dist/lib/services/general.service.d.ts +1 -0
- package/dist/lib/services/general.service.js +33 -0
- package/dist/lib/services/prompt-retriever.service.d.ts +53 -18
- package/dist/lib/services/prompt-retriever.service.js +69 -76
- package/dist/package.json +4 -4
- package/package.json +4 -4
- package/dist/lib/prompts/generate_test_click_element.mustache +0 -8
- package/dist/lib/prompts/generate_test_expect_element.mustache +0 -8
- package/dist/lib/prompts/generate_test_type_element.mustache +0 -8
- package/dist/lib/prompts/generate_test_within_element.mustache +0 -8
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ First, install the UUV MCP server with your client.
|
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
<details>
|
|
29
30
|
<summary>Opencode</summary>
|
|
30
31
|
|
|
31
32
|
Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). For example in `~/.config/opencode/opencode.json`:
|
|
@@ -44,12 +45,11 @@ Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). F
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
|
|
48
48
|
```
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
You can also use the following file as inspiration to configure a **dedicated agent for writing tests**: https://github.com/e2e-test-quest/uuv/tree/main/packages/mcp-server/agents/uuv-assistant.md
|
|
51
50
|
</details>
|
|
52
51
|
|
|
52
|
+
<details>
|
|
53
53
|
<summary>Claude Code</summary>
|
|
54
54
|
|
|
55
55
|
Use the Claude Code CLI to add the Marketplace plugin for the UUV:
|
|
@@ -71,6 +71,7 @@ claude mcp add uuv npx @uuv/mcp-server@latest
|
|
|
71
71
|
|
|
72
72
|
</details>
|
|
73
73
|
|
|
74
|
+
<details>
|
|
74
75
|
|
|
75
76
|
<summary>Gemini CLI</summary>
|
|
76
77
|
|
|
@@ -92,55 +93,64 @@ gemini extensions uninstall uuv-e2e-accessibility-test
|
|
|
92
93
|
|
|
93
94
|
This MCP server exposes the following tools:
|
|
94
95
|
|
|
95
|
-
###
|
|
96
|
-
- **Description**: Retrieve
|
|
96
|
+
### getBaseUrl
|
|
97
|
+
- **Description**: Retrieve project base url for generated UUV tests. In terms of priority, the UUV_BASE_URL environment variable is read, and if it is empty, the value of the baseURL field in the projectPath/uuv/playwright.config.ts or projectPath/uuv/cypress.config.ts file is checked.
|
|
97
98
|
- **Input Schema**:
|
|
98
|
-
- `
|
|
99
|
-
- `baseUrl` (string): The base URL of the page
|
|
100
|
-
- For `generate_test_expect_table`, `generate_test_expect_element`, `generate_test_click_element`, `generate_test_within_element` or `generate_test_type_element`:
|
|
101
|
-
- `accessibleName`: (string, optional): Accessible name
|
|
102
|
-
- `accessibleRole`: (string, optional): Accessible role
|
|
103
|
-
- `domSelector`: Dom selector of the element
|
|
99
|
+
- `projectPath` (string): Project absolute path
|
|
104
100
|
|
|
105
|
-
###
|
|
101
|
+
### availableSentences
|
|
106
102
|
- **Description**: List all available UUV test sentences/phrases in Gherkin format.
|
|
107
103
|
- **Input Schema**:
|
|
108
104
|
- `category` (enum, optional): Filters sentences by action type (general, keyboard, click, contains, type, checkable)
|
|
109
105
|
- `role` (string, optional): Filters sentences related to an accessible role
|
|
110
106
|
|
|
111
|
-
###
|
|
112
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified
|
|
107
|
+
### genTestExpectRoleAndName
|
|
108
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified role and name.
|
|
113
109
|
- **Input Schema**:
|
|
114
110
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
115
|
-
- `accessibleName` (string): Accessible name of the element
|
|
116
111
|
- `accessibleRole` (string): Accessible role of the element
|
|
117
|
-
- `
|
|
112
|
+
- `accessibleName` (string): Accessible name of the element
|
|
118
113
|
|
|
119
|
-
###
|
|
120
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified
|
|
114
|
+
### genTestExpectDomSelector
|
|
115
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified domSelector.
|
|
121
116
|
- **Input Schema**:
|
|
122
117
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
123
|
-
- `
|
|
124
|
-
- `accessibleRole` (string): Accessible role of the element
|
|
125
|
-
- `domSelector`: Dom selector of the element
|
|
118
|
+
- `domSelector` (string): Dom selector of the element
|
|
126
119
|
|
|
127
|
-
###
|
|
128
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) that clicks on html element with specified
|
|
120
|
+
### genTestClickRoleAndName
|
|
121
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that clicks on html element with specified role and name.
|
|
129
122
|
- **Input Schema**:
|
|
130
123
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
131
|
-
- `accessibleName` (string): Accessible name of the element
|
|
132
124
|
- `accessibleRole` (string): Accessible role of the element
|
|
133
|
-
- `
|
|
125
|
+
- `accessibleName` (string): Accessible name of the element
|
|
126
|
+
|
|
127
|
+
### genTestClickDomSelector
|
|
128
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that clicks on html element with specified domSelector.
|
|
129
|
+
- **Input Schema**:
|
|
130
|
+
- `baseUrl` (string): The base URL of the page where the element is located
|
|
131
|
+
- `domSelector` (string): Dom selector of the element
|
|
134
132
|
|
|
135
|
-
###
|
|
136
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified
|
|
133
|
+
### genTestWithinRoleAndName
|
|
134
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified role and name.
|
|
137
135
|
- **Input Schema**:
|
|
138
136
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
137
|
+
- `accessibleRole` (string): Accessible role of the element
|
|
139
138
|
- `accessibleName` (string): Accessible name of the element
|
|
139
|
+
|
|
140
|
+
### genTestWithinDomSelector
|
|
141
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified domSelector.
|
|
142
|
+
- **Input Schema**:
|
|
143
|
+
- `baseUrl` (string): The base URL of the page where the element is located
|
|
144
|
+
- `domSelector` (string): Dom selector of the element
|
|
145
|
+
|
|
146
|
+
### genTestTypeRoleAndName
|
|
147
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified role and name.
|
|
148
|
+
- **Input Schema**:
|
|
149
|
+
- `baseUrl` (string): The base URL of the page where the element is located
|
|
140
150
|
- `accessibleRole` (string): Accessible role of the element
|
|
141
|
-
- `
|
|
151
|
+
- `accessibleName` (string): Accessible name of the element
|
|
142
152
|
|
|
143
|
-
###
|
|
153
|
+
### genTestExpectTable (WIP)
|
|
144
154
|
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence and content of html table, grid or treegrid.
|
|
145
155
|
- **Input Schema**:
|
|
146
156
|
- `baseUrl` (string): The base URL of the page where the table/grid/treegrid is located
|
|
@@ -151,39 +161,46 @@ This MCP server exposes the following tools:
|
|
|
151
161
|
|
|
152
162
|
This MCP server exposes the following prompts:
|
|
153
163
|
|
|
154
|
-
###
|
|
155
|
-
- **Description**: Returns UUV prompt to verify the presence of an element with specified
|
|
164
|
+
### genTestExpectRoleAndName
|
|
165
|
+
- **Description**: Returns UUV prompt to verify the presence of an element with specified role and name.
|
|
156
166
|
- **Input Schema**:
|
|
157
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
158
167
|
- `accessibleName` (string): Accessible name of the element
|
|
159
168
|
- `accessibleRole` (string): Accessible role of the element
|
|
160
|
-
- `domSelector`: Dom selector of the element
|
|
161
169
|
|
|
162
|
-
###
|
|
163
|
-
- **Description**: Returns UUV prompt to verify the presence of an element with specified
|
|
170
|
+
### genTestExpectDomSelector
|
|
171
|
+
- **Description**: Returns UUV prompt to verify the presence of an element with specified domSelector.
|
|
172
|
+
- **Input Schema**:
|
|
173
|
+
- `domSelector` (string): Dom selector of the element
|
|
174
|
+
|
|
175
|
+
### genTestClickRoleAndName
|
|
176
|
+
- **Description**: Returns UUV prompt that clicks on html element with specified role and name.
|
|
164
177
|
- **Input Schema**:
|
|
165
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
166
178
|
- `accessibleName` (string): Accessible name of the element
|
|
167
179
|
- `accessibleRole` (string): Accessible role of the element
|
|
168
|
-
- `domSelector`: Dom selector of the element
|
|
169
180
|
|
|
170
|
-
###
|
|
171
|
-
- **Description**: Returns UUV prompt that clicks on html element with specified
|
|
181
|
+
### genTestClickDomSelector
|
|
182
|
+
- **Description**: Returns UUV prompt that clicks on html element with specified domSelector.
|
|
183
|
+
- **Input Schema**:
|
|
184
|
+
- `domSelector` (string): Dom selector of the element
|
|
185
|
+
|
|
186
|
+
### genTestTypeRoleAndName
|
|
187
|
+
- **Description**: Returns UUV prompt that types a value into html element with specified role and name.
|
|
172
188
|
- **Input Schema**:
|
|
173
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
174
189
|
- `accessibleName` (string): Accessible name of the element
|
|
175
190
|
- `accessibleRole` (string): Accessible role of the element
|
|
176
|
-
- `domSelector`: Dom selector of the element
|
|
177
191
|
|
|
178
|
-
###
|
|
179
|
-
- **Description**: Returns UUV prompt that focus within a html element with specified
|
|
192
|
+
### genTestWithinRoleAndName
|
|
193
|
+
- **Description**: Returns UUV prompt that focus within a html element with specified role and name.
|
|
180
194
|
- **Input Schema**:
|
|
181
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
182
195
|
- `accessibleName` (string): Accessible name of the element
|
|
183
196
|
- `accessibleRole` (string): Accessible role of the element
|
|
184
|
-
- `domSelector`: Dom selector of the element
|
|
185
197
|
|
|
186
|
-
###
|
|
198
|
+
### genTestWithinDomSelector
|
|
199
|
+
- **Description**: Returns UUV prompt that focus within a html element with specified domSelector.
|
|
200
|
+
- **Input Schema**:
|
|
201
|
+
- `domSelector` (string): Dom selector of the element
|
|
202
|
+
|
|
203
|
+
### genTestExpectTable (WIP)
|
|
187
204
|
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence and content of html table, grid or treegrid.
|
|
188
205
|
- **Input Schema**:
|
|
189
206
|
- `baseUrl` (string): The base URL of the page where the table/grid/treegrid is located
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [0.7.0](https://github.com/e2e-test-quest/uuv/compare/mcp-server-v0.6.0...mcp-server-v0.7.0) (2026-01-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **assistant:** update dependency dom-accessibility-api to v0.7.1 ([1e76c40](https://github.com/e2e-test-quest/uuv/commit/1e76c40a6d021a60c42b8a30e80281cb14a816f7))
|
|
7
|
+
* **runner-playwright:** update dependency axe-core to v4.11.1 ([8404435](https://github.com/e2e-test-quest/uuv/commit/8404435e018c6068a7a649a19d2f77b57d8f8260))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **assistant:** update dependency playwright-chromium to v1.58.0 ([963f73f](https://github.com/e2e-test-quest/uuv/commit/963f73fcff199a46201ce676c9dde278973c4953))
|
|
13
|
+
* **assistant:** update dependency tabbable to v6.4.0 ([0db9a9e](https://github.com/e2e-test-quest/uuv/commit/0db9a9e75a28bcbe4851f666934fdc90b06eaf68))
|
|
14
|
+
* **mcp-server:** improve mcp server tools and prompts naming, [#1189](https://github.com/e2e-test-quest/uuv/issues/1189) ([51e63e8](https://github.com/e2e-test-quest/uuv/commit/51e63e8836d981b4d5f3590b6f5c2d00dd404fff))
|
|
15
|
+
* **runner-cypress:** update dependency cypress to v15.9.0 ([16e7102](https://github.com/e2e-test-quest/uuv/commit/16e7102542e9a1a958c3d30971c9314bb6c3f0e2))
|
|
16
|
+
* **runner-playwright:** update dependency webpack to v5.104.1 ([715510a](https://github.com/e2e-test-quest/uuv/commit/715510ac995b295670568b8e8e492b7c6b8937e0))
|
|
17
|
+
|
|
18
|
+
# [0.6.0](https://github.com/e2e-test-quest/uuv/compare/mcp-server-v0.5.0...mcp-server-v0.6.0) (2026-01-18)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **deps:** update dependency @modelcontextprotocol/sdk to v1.25.2 [security] ([77e3511](https://github.com/e2e-test-quest/uuv/commit/77e3511ecbf906c72dedc798fa5883109095d0e4))
|
|
24
|
+
* **runner-playwright:** update dependency typescript to v5.9.3 ([3b0f131](https://github.com/e2e-test-quest/uuv/commit/3b0f1314104546c382bfabb38d3bc6a72c9b2e9e))
|
|
25
|
+
* **runner-playwright:** update dependency webpack to v5.104.1 ([d1dd93b](https://github.com/e2e-test-quest/uuv/commit/d1dd93b3426c7e9baee15c4ad88dc294ea23c9c7))
|
|
26
|
+
|
|
1
27
|
# [0.5.0](https://github.com/e2e-test-quest/uuv/compare/mcp-server-v0.4.1...mcp-server-v0.5.0) (2026-01-01)
|
|
2
28
|
|
|
3
29
|
|
package/dist/README.md
CHANGED
|
@@ -26,6 +26,7 @@ First, install the UUV MCP server with your client.
|
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
<details>
|
|
29
30
|
<summary>Opencode</summary>
|
|
30
31
|
|
|
31
32
|
Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). For example in `~/.config/opencode/opencode.json`:
|
|
@@ -44,12 +45,11 @@ Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). F
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
|
|
48
48
|
```
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
You can also use the following file as inspiration to configure a **dedicated agent for writing tests**: https://github.com/e2e-test-quest/uuv/tree/main/packages/mcp-server/agents/uuv-assistant.md
|
|
51
50
|
</details>
|
|
52
51
|
|
|
52
|
+
<details>
|
|
53
53
|
<summary>Claude Code</summary>
|
|
54
54
|
|
|
55
55
|
Use the Claude Code CLI to add the Marketplace plugin for the UUV:
|
|
@@ -71,6 +71,7 @@ claude mcp add uuv npx @uuv/mcp-server@latest
|
|
|
71
71
|
|
|
72
72
|
</details>
|
|
73
73
|
|
|
74
|
+
<details>
|
|
74
75
|
|
|
75
76
|
<summary>Gemini CLI</summary>
|
|
76
77
|
|
|
@@ -92,55 +93,64 @@ gemini extensions uninstall uuv-e2e-accessibility-test
|
|
|
92
93
|
|
|
93
94
|
This MCP server exposes the following tools:
|
|
94
95
|
|
|
95
|
-
###
|
|
96
|
-
- **Description**: Retrieve
|
|
96
|
+
### getBaseUrl
|
|
97
|
+
- **Description**: Retrieve project base url for generated UUV tests. In terms of priority, the UUV_BASE_URL environment variable is read, and if it is empty, the value of the baseURL field in the projectPath/uuv/playwright.config.ts or projectPath/uuv/cypress.config.ts file is checked.
|
|
97
98
|
- **Input Schema**:
|
|
98
|
-
- `
|
|
99
|
-
- `baseUrl` (string): The base URL of the page
|
|
100
|
-
- For `generate_test_expect_table`, `generate_test_expect_element`, `generate_test_click_element`, `generate_test_within_element` or `generate_test_type_element`:
|
|
101
|
-
- `accessibleName`: (string, optional): Accessible name
|
|
102
|
-
- `accessibleRole`: (string, optional): Accessible role
|
|
103
|
-
- `domSelector`: Dom selector of the element
|
|
99
|
+
- `projectPath` (string): Project absolute path
|
|
104
100
|
|
|
105
|
-
###
|
|
101
|
+
### availableSentences
|
|
106
102
|
- **Description**: List all available UUV test sentences/phrases in Gherkin format.
|
|
107
103
|
- **Input Schema**:
|
|
108
104
|
- `category` (enum, optional): Filters sentences by action type (general, keyboard, click, contains, type, checkable)
|
|
109
105
|
- `role` (string, optional): Filters sentences related to an accessible role
|
|
110
106
|
|
|
111
|
-
###
|
|
112
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified
|
|
107
|
+
### genTestExpectRoleAndName
|
|
108
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified role and name.
|
|
113
109
|
- **Input Schema**:
|
|
114
110
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
115
|
-
- `accessibleName` (string): Accessible name of the element
|
|
116
111
|
- `accessibleRole` (string): Accessible role of the element
|
|
117
|
-
- `
|
|
112
|
+
- `accessibleName` (string): Accessible name of the element
|
|
118
113
|
|
|
119
|
-
###
|
|
120
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified
|
|
114
|
+
### genTestExpectDomSelector
|
|
115
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified domSelector.
|
|
121
116
|
- **Input Schema**:
|
|
122
117
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
123
|
-
- `
|
|
124
|
-
- `accessibleRole` (string): Accessible role of the element
|
|
125
|
-
- `domSelector`: Dom selector of the element
|
|
118
|
+
- `domSelector` (string): Dom selector of the element
|
|
126
119
|
|
|
127
|
-
###
|
|
128
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) that clicks on html element with specified
|
|
120
|
+
### genTestClickRoleAndName
|
|
121
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that clicks on html element with specified role and name.
|
|
129
122
|
- **Input Schema**:
|
|
130
123
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
131
|
-
- `accessibleName` (string): Accessible name of the element
|
|
132
124
|
- `accessibleRole` (string): Accessible role of the element
|
|
133
|
-
- `
|
|
125
|
+
- `accessibleName` (string): Accessible name of the element
|
|
126
|
+
|
|
127
|
+
### genTestClickDomSelector
|
|
128
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that clicks on html element with specified domSelector.
|
|
129
|
+
- **Input Schema**:
|
|
130
|
+
- `baseUrl` (string): The base URL of the page where the element is located
|
|
131
|
+
- `domSelector` (string): Dom selector of the element
|
|
134
132
|
|
|
135
|
-
###
|
|
136
|
-
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified
|
|
133
|
+
### genTestWithinRoleAndName
|
|
134
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified role and name.
|
|
137
135
|
- **Input Schema**:
|
|
138
136
|
- `baseUrl` (string): The base URL of the page where the element is located
|
|
137
|
+
- `accessibleRole` (string): Accessible role of the element
|
|
139
138
|
- `accessibleName` (string): Accessible name of the element
|
|
139
|
+
|
|
140
|
+
### genTestWithinDomSelector
|
|
141
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified domSelector.
|
|
142
|
+
- **Input Schema**:
|
|
143
|
+
- `baseUrl` (string): The base URL of the page where the element is located
|
|
144
|
+
- `domSelector` (string): Dom selector of the element
|
|
145
|
+
|
|
146
|
+
### genTestTypeRoleAndName
|
|
147
|
+
- **Description**: Generate a complete UUV test scenario (Gherkin format) that focus within a html element with specified role and name.
|
|
148
|
+
- **Input Schema**:
|
|
149
|
+
- `baseUrl` (string): The base URL of the page where the element is located
|
|
140
150
|
- `accessibleRole` (string): Accessible role of the element
|
|
141
|
-
- `
|
|
151
|
+
- `accessibleName` (string): Accessible name of the element
|
|
142
152
|
|
|
143
|
-
###
|
|
153
|
+
### genTestExpectTable (WIP)
|
|
144
154
|
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence and content of html table, grid or treegrid.
|
|
145
155
|
- **Input Schema**:
|
|
146
156
|
- `baseUrl` (string): The base URL of the page where the table/grid/treegrid is located
|
|
@@ -151,39 +161,46 @@ This MCP server exposes the following tools:
|
|
|
151
161
|
|
|
152
162
|
This MCP server exposes the following prompts:
|
|
153
163
|
|
|
154
|
-
###
|
|
155
|
-
- **Description**: Returns UUV prompt to verify the presence of an element with specified
|
|
164
|
+
### genTestExpectRoleAndName
|
|
165
|
+
- **Description**: Returns UUV prompt to verify the presence of an element with specified role and name.
|
|
156
166
|
- **Input Schema**:
|
|
157
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
158
167
|
- `accessibleName` (string): Accessible name of the element
|
|
159
168
|
- `accessibleRole` (string): Accessible role of the element
|
|
160
|
-
- `domSelector`: Dom selector of the element
|
|
161
169
|
|
|
162
|
-
###
|
|
163
|
-
- **Description**: Returns UUV prompt to verify the presence of an element with specified
|
|
170
|
+
### genTestExpectDomSelector
|
|
171
|
+
- **Description**: Returns UUV prompt to verify the presence of an element with specified domSelector.
|
|
172
|
+
- **Input Schema**:
|
|
173
|
+
- `domSelector` (string): Dom selector of the element
|
|
174
|
+
|
|
175
|
+
### genTestClickRoleAndName
|
|
176
|
+
- **Description**: Returns UUV prompt that clicks on html element with specified role and name.
|
|
164
177
|
- **Input Schema**:
|
|
165
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
166
178
|
- `accessibleName` (string): Accessible name of the element
|
|
167
179
|
- `accessibleRole` (string): Accessible role of the element
|
|
168
|
-
- `domSelector`: Dom selector of the element
|
|
169
180
|
|
|
170
|
-
###
|
|
171
|
-
- **Description**: Returns UUV prompt that clicks on html element with specified
|
|
181
|
+
### genTestClickDomSelector
|
|
182
|
+
- **Description**: Returns UUV prompt that clicks on html element with specified domSelector.
|
|
183
|
+
- **Input Schema**:
|
|
184
|
+
- `domSelector` (string): Dom selector of the element
|
|
185
|
+
|
|
186
|
+
### genTestTypeRoleAndName
|
|
187
|
+
- **Description**: Returns UUV prompt that types a value into html element with specified role and name.
|
|
172
188
|
- **Input Schema**:
|
|
173
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
174
189
|
- `accessibleName` (string): Accessible name of the element
|
|
175
190
|
- `accessibleRole` (string): Accessible role of the element
|
|
176
|
-
- `domSelector`: Dom selector of the element
|
|
177
191
|
|
|
178
|
-
###
|
|
179
|
-
- **Description**: Returns UUV prompt that focus within a html element with specified
|
|
192
|
+
### genTestWithinRoleAndName
|
|
193
|
+
- **Description**: Returns UUV prompt that focus within a html element with specified role and name.
|
|
180
194
|
- **Input Schema**:
|
|
181
|
-
- `baseUrl` (string): The base URL of the page where the element is located
|
|
182
195
|
- `accessibleName` (string): Accessible name of the element
|
|
183
196
|
- `accessibleRole` (string): Accessible role of the element
|
|
184
|
-
- `domSelector`: Dom selector of the element
|
|
185
197
|
|
|
186
|
-
###
|
|
198
|
+
### genTestWithinDomSelector
|
|
199
|
+
- **Description**: Returns UUV prompt that focus within a html element with specified domSelector.
|
|
200
|
+
- **Input Schema**:
|
|
201
|
+
- `domSelector` (string): Dom selector of the element
|
|
202
|
+
|
|
203
|
+
### genTestExpectTable (WIP)
|
|
187
204
|
- **Description**: Generate a complete UUV test scenario (Gherkin format) to verify the presence and content of html table, grid or treegrid.
|
|
188
205
|
- **Input Schema**:
|
|
189
206
|
- `baseUrl` (string): The base URL of the page where the table/grid/treegrid is located
|
|
@@ -7,6 +7,7 @@ const sentence_service_1 = require("./services/sentence.service");
|
|
|
7
7
|
const prompt_retriever_service_1 = require("./services/prompt-retriever.service");
|
|
8
8
|
const dictionary_1 = require("@uuv/dictionary");
|
|
9
9
|
const expect_service_1 = require("./services/expect.service");
|
|
10
|
+
const general_service_1 = require("./services/general.service");
|
|
10
11
|
function handleElementTestGeneration(input) {
|
|
11
12
|
let result;
|
|
12
13
|
const service = (0, expect_service_1.getElementService)(input.serviceType);
|
|
@@ -33,12 +34,6 @@ function createUUVServer() {
|
|
|
33
34
|
name: "uuv-mcp-server",
|
|
34
35
|
version: "0.0.1-beta",
|
|
35
36
|
});
|
|
36
|
-
const FindElementInputSchema = {
|
|
37
|
-
baseUrl: zod_1.z.string().describe("The base URL of the page where the element is located."),
|
|
38
|
-
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
39
|
-
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
40
|
-
domSelector: zod_1.z.string().optional().describe("Dom selector of the element"),
|
|
41
|
-
};
|
|
42
37
|
server.registerPrompt(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE, {
|
|
43
38
|
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE].title,
|
|
44
39
|
description: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE].description,
|
|
@@ -60,17 +55,41 @@ function createUUVServer() {
|
|
|
60
55
|
],
|
|
61
56
|
}));
|
|
62
57
|
[
|
|
63
|
-
prompt_retriever_service_1.UUV_PROMPT.
|
|
64
|
-
prompt_retriever_service_1.UUV_PROMPT.
|
|
65
|
-
prompt_retriever_service_1.UUV_PROMPT.
|
|
58
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_ROLE_AND_NAME,
|
|
59
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_ROLE_AND_NAME,
|
|
60
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_WITHIN_ROLE_AND_NAME
|
|
66
61
|
].forEach((promptName) => {
|
|
67
62
|
server.registerPrompt(promptName, {
|
|
68
63
|
title: prompt_retriever_service_1.uuvPrompts[promptName].title,
|
|
69
64
|
description: prompt_retriever_service_1.uuvPrompts[promptName].description,
|
|
70
65
|
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
66
|
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
67
|
+
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element")
|
|
68
|
+
}
|
|
69
|
+
}, ({ ...args }) => ({
|
|
70
|
+
messages: [
|
|
71
|
+
{
|
|
72
|
+
role: "assistant",
|
|
73
|
+
content: {
|
|
74
|
+
type: "text",
|
|
75
|
+
text: prompt_retriever_service_1.PromptRetrieverService.retrievePrompt({
|
|
76
|
+
promptName,
|
|
77
|
+
...args
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
[
|
|
85
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_DOM_SELECTOR,
|
|
86
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_DOM_SELECTOR,
|
|
87
|
+
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_WITHIN_DOM_SELECTOR
|
|
88
|
+
].forEach((promptName) => {
|
|
89
|
+
server.registerPrompt(promptName, {
|
|
90
|
+
title: prompt_retriever_service_1.uuvPrompts[promptName].title,
|
|
91
|
+
description: prompt_retriever_service_1.uuvPrompts[promptName].description,
|
|
92
|
+
argsSchema: {
|
|
74
93
|
domSelector: zod_1.z.string().optional().describe("Dom selector of the element")
|
|
75
94
|
}
|
|
76
95
|
}, ({ ...args }) => ({
|
|
@@ -88,14 +107,12 @@ function createUUVServer() {
|
|
|
88
107
|
]
|
|
89
108
|
}));
|
|
90
109
|
});
|
|
91
|
-
server.registerPrompt(prompt_retriever_service_1.UUV_PROMPT.
|
|
92
|
-
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.
|
|
93
|
-
description: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.
|
|
110
|
+
server.registerPrompt(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME, {
|
|
111
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME].title,
|
|
112
|
+
description: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME].description,
|
|
94
113
|
argsSchema: {
|
|
95
|
-
baseUrl: zod_1.z.string().describe("The base URL of the page where the table/grid/treegrid is located."),
|
|
96
|
-
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
97
114
|
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
98
|
-
|
|
115
|
+
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element")
|
|
99
116
|
}
|
|
100
117
|
}, ({ ...args }) => ({
|
|
101
118
|
messages: [
|
|
@@ -104,41 +121,30 @@ function createUUVServer() {
|
|
|
104
121
|
content: {
|
|
105
122
|
type: "text",
|
|
106
123
|
text: prompt_retriever_service_1.PromptRetrieverService.retrievePrompt({
|
|
107
|
-
promptName: prompt_retriever_service_1.UUV_PROMPT.
|
|
124
|
+
promptName: prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME,
|
|
108
125
|
...args
|
|
109
126
|
})
|
|
110
127
|
}
|
|
111
128
|
}
|
|
112
129
|
]
|
|
113
130
|
}));
|
|
114
|
-
server.registerTool(
|
|
115
|
-
title:
|
|
116
|
-
description:
|
|
131
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GET_BASE_URL, {
|
|
132
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GET_BASE_URL].title,
|
|
133
|
+
description: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GET_BASE_URL].description,
|
|
117
134
|
inputSchema: {
|
|
118
|
-
|
|
119
|
-
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE,
|
|
120
|
-
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT,
|
|
121
|
-
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT,
|
|
122
|
-
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT,
|
|
123
|
-
prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT
|
|
124
|
-
]),
|
|
125
|
-
baseUrl: zod_1.z.string().describe("The base URL of the page"),
|
|
126
|
-
// generate_test_* Fields
|
|
127
|
-
accessibleName: zod_1.z.string().optional().describe("Accessible name"),
|
|
128
|
-
accessibleRole: zod_1.z.string().optional().describe("Accessible role"),
|
|
129
|
-
domSelector: zod_1.z.string().optional().describe("Dom selector of the target element")
|
|
135
|
+
projectPath: zod_1.z.string().describe("Project absolute path"),
|
|
130
136
|
},
|
|
131
|
-
}, async ({
|
|
137
|
+
}, async ({ projectPath }) => {
|
|
132
138
|
return {
|
|
133
139
|
content: [
|
|
134
140
|
{
|
|
135
141
|
type: "text",
|
|
136
|
-
text:
|
|
137
|
-
}
|
|
138
|
-
]
|
|
142
|
+
text: (0, general_service_1.getBaseUrl)(projectPath)
|
|
143
|
+
}
|
|
144
|
+
]
|
|
139
145
|
};
|
|
140
146
|
});
|
|
141
|
-
server.registerTool(
|
|
147
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.AVAILABLE_SENTENCES, {
|
|
142
148
|
title: "List Available UUV Sentences",
|
|
143
149
|
description:
|
|
144
150
|
// eslint-disable-next-line max-len
|
|
@@ -162,47 +168,74 @@ function createUUVServer() {
|
|
|
162
168
|
],
|
|
163
169
|
};
|
|
164
170
|
});
|
|
165
|
-
server.registerTool(
|
|
166
|
-
title:
|
|
171
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_ROLE_AND_NAME, {
|
|
172
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_ROLE_AND_NAME].title,
|
|
167
173
|
description:
|
|
168
174
|
// eslint-disable-next-line max-len
|
|
169
|
-
"Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified accessible name and role
|
|
170
|
-
inputSchema:
|
|
171
|
-
}, ({ baseUrl, accessibleName, accessibleRole
|
|
175
|
+
"Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified accessible name and role. 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",
|
|
176
|
+
inputSchema: prompt_retriever_service_1.ElementByRoleAndNameInputSchema,
|
|
177
|
+
}, ({ baseUrl, accessibleName, accessibleRole }) => {
|
|
172
178
|
if (accessibleRole === "table" || accessibleRole === "grid" || accessibleRole === "treegrid") {
|
|
173
179
|
throw new Error("For role 'table/grid/treegrid', you must use generate_test_expect_table tool.");
|
|
174
180
|
}
|
|
175
|
-
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.EXPECT, baseUrl, accessibleName, accessibleRole
|
|
181
|
+
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.EXPECT, baseUrl, accessibleName, accessibleRole });
|
|
176
182
|
});
|
|
177
|
-
server.registerTool(
|
|
178
|
-
title:
|
|
183
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_DOM_SELECTOR, {
|
|
184
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_DOM_SELECTOR].title,
|
|
179
185
|
description:
|
|
180
186
|
// eslint-disable-next-line max-len
|
|
181
|
-
"Generate a complete UUV test scenario (Gherkin format) to
|
|
182
|
-
inputSchema:
|
|
183
|
-
},
|
|
184
|
-
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.
|
|
187
|
+
"Generate a complete UUV test scenario (Gherkin format) to verify the presence of an element with specified 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",
|
|
188
|
+
inputSchema: prompt_retriever_service_1.ElementByDomSelectorInputSchema,
|
|
189
|
+
}, ({ baseUrl, domSelector }) => {
|
|
190
|
+
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.EXPECT, baseUrl, domSelector });
|
|
185
191
|
});
|
|
186
|
-
server.registerTool(
|
|
192
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_ROLE_AND_NAME, {
|
|
193
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_ROLE_AND_NAME].title,
|
|
194
|
+
description:
|
|
195
|
+
// eslint-disable-next-line max-len
|
|
196
|
+
"Generate a complete UUV test scenario (Gherkin format) to click on an element with specified accessible name and role. 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",
|
|
197
|
+
inputSchema: prompt_retriever_service_1.ElementByRoleAndNameInputSchema,
|
|
198
|
+
}, async ({ baseUrl, accessibleName, accessibleRole }) => {
|
|
199
|
+
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.CLICK, baseUrl, accessibleName, accessibleRole });
|
|
200
|
+
});
|
|
201
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_DOM_SELECTOR, {
|
|
202
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_CLICK_DOM_SELECTOR].title,
|
|
203
|
+
description:
|
|
204
|
+
// eslint-disable-next-line max-len
|
|
205
|
+
"Generate a complete UUV test scenario (Gherkin format) to click on an element with specified 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",
|
|
206
|
+
inputSchema: prompt_retriever_service_1.ElementByDomSelectorInputSchema,
|
|
207
|
+
}, async ({ baseUrl, domSelector }) => {
|
|
208
|
+
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.CLICK, baseUrl, domSelector });
|
|
209
|
+
});
|
|
210
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_WITHIN_ROLE_AND_NAME, {
|
|
187
211
|
title: "Generate test that focus within an html element with (role and name) or domSelector",
|
|
188
212
|
description:
|
|
189
213
|
// eslint-disable-next-line max-len
|
|
190
|
-
"Generate a complete UUV test scenario (Gherkin format) that focus within an html element with specified accessible name
|
|
191
|
-
inputSchema:
|
|
192
|
-
}, async ({ baseUrl, accessibleName, accessibleRole
|
|
193
|
-
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.WITHIN, baseUrl, accessibleName, accessibleRole
|
|
214
|
+
"Generate a complete UUV test scenario (Gherkin format) that focus within an html element with specified accessible name. 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",
|
|
215
|
+
inputSchema: prompt_retriever_service_1.ElementByRoleAndNameInputSchema,
|
|
216
|
+
}, async ({ baseUrl, accessibleName, accessibleRole }) => {
|
|
217
|
+
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.WITHIN, baseUrl, accessibleName, accessibleRole });
|
|
194
218
|
});
|
|
195
|
-
server.registerTool(
|
|
196
|
-
title: "Generate test that
|
|
219
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_WITHIN_DOM_SELECTOR, {
|
|
220
|
+
title: "Generate test that focus within an html element with (role and name) or domSelector",
|
|
197
221
|
description:
|
|
198
222
|
// eslint-disable-next-line max-len
|
|
199
|
-
"Generate a complete UUV test scenario (Gherkin format) that
|
|
200
|
-
inputSchema:
|
|
201
|
-
}, async ({ baseUrl,
|
|
202
|
-
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.
|
|
223
|
+
"Generate a complete UUV test scenario (Gherkin format) that focus within an html element with specified 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",
|
|
224
|
+
inputSchema: prompt_retriever_service_1.ElementByDomSelectorInputSchema,
|
|
225
|
+
}, async ({ baseUrl, domSelector }) => {
|
|
226
|
+
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.WITHIN, baseUrl, domSelector });
|
|
203
227
|
});
|
|
204
|
-
server.registerTool(
|
|
205
|
-
title:
|
|
228
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME, {
|
|
229
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME].title,
|
|
230
|
+
description:
|
|
231
|
+
// eslint-disable-next-line max-len
|
|
232
|
+
"Generate a complete UUV test scenario (Gherkin format) that types a value into an html element with specified accessible name and role. 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",
|
|
233
|
+
inputSchema: prompt_retriever_service_1.ElementByRoleAndNameInputSchema,
|
|
234
|
+
}, async ({ baseUrl, accessibleName, accessibleRole }) => {
|
|
235
|
+
return handleElementTestGeneration({ serviceType: expect_service_1.ElementServiceType.TYPE, baseUrl, accessibleName, accessibleRole });
|
|
236
|
+
});
|
|
237
|
+
server.registerTool(prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE, {
|
|
238
|
+
title: prompt_retriever_service_1.uuvPrompts[prompt_retriever_service_1.UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE].title,
|
|
206
239
|
description:
|
|
207
240
|
// eslint-disable-next-line max-len
|
|
208
241
|
"Generate a complete UUV test scenario (Gherkin format) to verify the presence and the content of html table, grid or treegrid given innerHtml. ONLY USE IF ACCESSIBLE ROLE IS grid, treegrid, table, or form",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Use UUV MCP tools:
|
|
2
|
+
1. With uuv_getBaseUrl, retrieve base url
|
|
3
|
+
2. With uuv_genTestClickDomSelector, Generate UUV tests into ./uuv/e2e to click on an element with domSelector "{{{domSelector}}}" exist on the webpage baseUrl
|
|
4
|
+
3. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Use UUV MCP tools:
|
|
2
|
+
1. With uuv_getBaseUrl, retrieve base url
|
|
3
|
+
2. With uuv_genTestClickRoleAndName, Generate UUV tests into ./uuv/e2e to click on an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage baseUrl
|
|
4
|
+
3. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Use UUV MCP tools:
|
|
2
|
+
1. With uuv_getBaseUrl, retrieve base url
|
|
3
|
+
2. With uuv_genTestExpectDomSelector, Generate UUV tests into ./uuv/e2e to verify that an element with domSelector "{{{domSelector}}}" exist on the webpage baseUrl
|
|
4
|
+
3. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Use UUV MCP tools:
|
|
2
|
+
1. With uuv_getBaseUrl, retrieve base url
|
|
3
|
+
2. With uuv_genTestExpectRoleAndName, Generate UUV tests into ./uuv/e2e to verify that an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage baseUrl
|
|
4
|
+
3. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
package/dist/lib/prompts/{generate_test_expect_table.mustache → genTestExpectTable.mustache}
RENAMED
|
@@ -2,7 +2,7 @@ Use the Playwright and UUV MCP tools:
|
|
|
2
2
|
1. Open a browser, then navigate to {{{baseUrl}}}
|
|
3
3
|
2. Evaluate exactly, ensuring that the extracted HTML is not truncated: document.querySelector('table').outerHTML
|
|
4
4
|
3. Write resulting HTML of the previous step into a file named extraction.html in the current project directory
|
|
5
|
-
4. With
|
|
5
|
+
4. With uuv_genTestExpectTable, Generate UUV tests into ./uuv/e2e to verify the html table with relative path ./tmp-extraction.html
|
|
6
6
|
5. Write generated uuv test into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
7
7
|
|
|
8
8
|
IMPORTANT:
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Use UUV MCP tools:
|
|
2
|
+
1. With uuv_getBaseUrl, retrieve base url
|
|
3
|
+
2. With uuv_genTestTypeRoleAndName, Generate UUV tests into ./uuv/e2e to type sentence or value into an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage baseUrl
|
|
4
|
+
3. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Use UUV MCP tools:
|
|
2
|
+
1. With uuv_getBaseUrl, retrieve base url
|
|
3
|
+
2. With uuv_genTestWithinDomSelector, Generate UUV tests into ./uuv/e2e to focus on an element with domSelector "{{{domSelector}}}" exist on the webpage baseUrl
|
|
4
|
+
3. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Use UUV MCP tools:
|
|
2
|
+
1. With uuv_getBaseUrl, retrieve base url
|
|
3
|
+
2. With uuv_genTestWithinRoleAndName, Generate UUV tests into ./uuv/e2e to focus on an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage baseUrl
|
|
4
|
+
3. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getBaseUrl(projectPath: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBaseUrl = getBaseUrl;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
7
|
+
function getBaseUrl(projectPath) {
|
|
8
|
+
// eslint-disable-next-line dot-notation
|
|
9
|
+
const fromEnv = process.env["UUV_BASE_URL"];
|
|
10
|
+
if (fromEnv) {
|
|
11
|
+
return fromEnv;
|
|
12
|
+
}
|
|
13
|
+
const configs = [
|
|
14
|
+
{
|
|
15
|
+
path: path_1.default.resolve(projectPath, "uuv/playwright.config.ts"),
|
|
16
|
+
key: /baseURL\s*:\s*['"`](.*?)['"`]/
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
path: path_1.default.resolve(projectPath, "uuv/cypress.config.ts"),
|
|
20
|
+
key: /baseUrl\s*:\s*['"`](.*?)['"`]/
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
for (const { path: configPath, key } of configs) {
|
|
24
|
+
if (node_fs_1.default.existsSync(configPath)) {
|
|
25
|
+
const content = node_fs_1.default.readFileSync(configPath, "utf-8");
|
|
26
|
+
const match = content.match(key);
|
|
27
|
+
if (match && match[1]) {
|
|
28
|
+
return match[1];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
@@ -4,48 +4,83 @@ export type PromptArgs = {
|
|
|
4
4
|
promptName: UUV_PROMPT;
|
|
5
5
|
} | PromptExtraArgs;
|
|
6
6
|
export declare enum UUV_PROMPT {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
AVAILABLE_SENTENCES = "availableSentences",
|
|
8
|
+
GET_BASE_URL = "getBaseUrl",
|
|
9
|
+
GENERATE_TEST_EXPECT_TABLE = "genTestExpectTable",
|
|
10
|
+
GENERATE_TEST_EXPECT_ROLE_AND_NAME = "genTestExpectRoleAndName",
|
|
11
|
+
GENERATE_TEST_EXPECT_DOM_SELECTOR = "genTestExpectDomSelector",
|
|
12
|
+
GENERATE_TEST_CLICK_ROLE_AND_NAME = "genTestClickRoleAndName",
|
|
13
|
+
GENERATE_TEST_CLICK_DOM_SELECTOR = "genTestClickDomSelector",
|
|
14
|
+
GENERATE_TEST_WITHIN_ROLE_AND_NAME = "genTestWithinRoleAndName",
|
|
15
|
+
GENERATE_TEST_WITHIN_DOM_SELECTOR = "genTestWithinDomSelector",
|
|
16
|
+
GENERATE_TEST_TYPE_ROLE_AND_NAME = "genTestTypeRoleAndName"
|
|
12
17
|
}
|
|
13
18
|
export declare const uuvPrompts: {
|
|
14
|
-
|
|
19
|
+
getBaseUrl: {
|
|
15
20
|
title: string;
|
|
16
21
|
description: string;
|
|
17
22
|
};
|
|
18
|
-
|
|
23
|
+
genTestExpectTable: {
|
|
19
24
|
title: string;
|
|
20
25
|
description: string;
|
|
21
26
|
};
|
|
22
|
-
|
|
27
|
+
genTestExpectRoleAndName: {
|
|
23
28
|
title: string;
|
|
24
29
|
description: string;
|
|
25
30
|
};
|
|
26
|
-
|
|
31
|
+
genTestExpectDomSelector: {
|
|
27
32
|
title: string;
|
|
28
33
|
description: string;
|
|
29
34
|
};
|
|
30
|
-
|
|
35
|
+
genTestClickRoleAndName: {
|
|
31
36
|
title: string;
|
|
32
37
|
description: string;
|
|
33
38
|
};
|
|
39
|
+
genTestClickDomSelector: {
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
genTestWithinRoleAndName: {
|
|
44
|
+
title: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
genTestWithinDomSelector: {
|
|
48
|
+
title: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
genTestTypeRoleAndName: {
|
|
52
|
+
title: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export declare const ElementByRoleAndNameInputSchema: {
|
|
57
|
+
baseUrl: z.ZodString;
|
|
58
|
+
accessibleRole: z.ZodString;
|
|
59
|
+
accessibleName: z.ZodString;
|
|
60
|
+
};
|
|
61
|
+
export declare const ElementByDomSelectorInputSchema: {
|
|
62
|
+
baseUrl: z.ZodString;
|
|
63
|
+
domSelector: z.ZodString;
|
|
34
64
|
};
|
|
35
65
|
export declare const UUVPromptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
66
|
promptName: z.ZodLiteral<UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE>;
|
|
37
67
|
baseUrl: z.ZodString;
|
|
38
68
|
}, z.core.$strip>, z.ZodObject<{
|
|
39
69
|
promptName: z.ZodEnum<{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
70
|
+
genTestExpectRoleAndName: UUV_PROMPT.GENERATE_TEST_EXPECT_ROLE_AND_NAME;
|
|
71
|
+
genTestClickRoleAndName: UUV_PROMPT.GENERATE_TEST_CLICK_ROLE_AND_NAME;
|
|
72
|
+
genTestWithinRoleAndName: UUV_PROMPT.GENERATE_TEST_WITHIN_ROLE_AND_NAME;
|
|
73
|
+
genTestTypeRoleAndName: UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME;
|
|
44
74
|
}>;
|
|
45
|
-
|
|
46
|
-
accessibleName: z.
|
|
47
|
-
|
|
48
|
-
|
|
75
|
+
accessibleRole: z.ZodString;
|
|
76
|
+
accessibleName: z.ZodString;
|
|
77
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
+
promptName: z.ZodEnum<{
|
|
79
|
+
genTestExpectDomSelector: UUV_PROMPT.GENERATE_TEST_EXPECT_DOM_SELECTOR;
|
|
80
|
+
genTestClickDomSelector: UUV_PROMPT.GENERATE_TEST_CLICK_DOM_SELECTOR;
|
|
81
|
+
genTestWithinDomSelector: UUV_PROMPT.GENERATE_TEST_WITHIN_DOM_SELECTOR;
|
|
82
|
+
}>;
|
|
83
|
+
domSelector: z.ZodString;
|
|
49
84
|
}, z.core.$strip>], "promptName">;
|
|
50
85
|
export declare class PromptRetrieverService {
|
|
51
86
|
private static loadPromptTemplate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PromptRetrieverService = exports.UUVPromptInputSchema = exports.uuvPrompts = exports.UUV_PROMPT = void 0;
|
|
3
|
+
exports.PromptRetrieverService = exports.UUVPromptInputSchema = exports.ElementByDomSelectorInputSchema = exports.ElementByRoleAndNameInputSchema = 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"));
|
|
@@ -8,34 +8,65 @@ const zod_1 = require("zod");
|
|
|
8
8
|
const mustache_1 = require("mustache");
|
|
9
9
|
var UUV_PROMPT;
|
|
10
10
|
(function (UUV_PROMPT) {
|
|
11
|
-
UUV_PROMPT["
|
|
12
|
-
UUV_PROMPT["
|
|
13
|
-
UUV_PROMPT["
|
|
14
|
-
UUV_PROMPT["
|
|
15
|
-
UUV_PROMPT["
|
|
11
|
+
UUV_PROMPT["AVAILABLE_SENTENCES"] = "availableSentences";
|
|
12
|
+
UUV_PROMPT["GET_BASE_URL"] = "getBaseUrl";
|
|
13
|
+
UUV_PROMPT["GENERATE_TEST_EXPECT_TABLE"] = "genTestExpectTable";
|
|
14
|
+
UUV_PROMPT["GENERATE_TEST_EXPECT_ROLE_AND_NAME"] = "genTestExpectRoleAndName";
|
|
15
|
+
UUV_PROMPT["GENERATE_TEST_EXPECT_DOM_SELECTOR"] = "genTestExpectDomSelector";
|
|
16
|
+
UUV_PROMPT["GENERATE_TEST_CLICK_ROLE_AND_NAME"] = "genTestClickRoleAndName";
|
|
17
|
+
UUV_PROMPT["GENERATE_TEST_CLICK_DOM_SELECTOR"] = "genTestClickDomSelector";
|
|
18
|
+
UUV_PROMPT["GENERATE_TEST_WITHIN_ROLE_AND_NAME"] = "genTestWithinRoleAndName";
|
|
19
|
+
UUV_PROMPT["GENERATE_TEST_WITHIN_DOM_SELECTOR"] = "genTestWithinDomSelector";
|
|
20
|
+
UUV_PROMPT["GENERATE_TEST_TYPE_ROLE_AND_NAME"] = "genTestTypeRoleAndName";
|
|
16
21
|
})(UUV_PROMPT || (exports.UUV_PROMPT = UUV_PROMPT = {}));
|
|
17
22
|
exports.uuvPrompts = {
|
|
23
|
+
[UUV_PROMPT.GET_BASE_URL]: {
|
|
24
|
+
title: "getBaseUrl",
|
|
25
|
+
description: "Retrieve project base url for generated UUV tests"
|
|
26
|
+
},
|
|
18
27
|
[UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE]: {
|
|
19
28
|
title: "GenerateTestExpectTable",
|
|
20
|
-
description: "
|
|
29
|
+
description: "Generate test for html table or grid or treeGrid"
|
|
30
|
+
},
|
|
31
|
+
[UUV_PROMPT.GENERATE_TEST_EXPECT_ROLE_AND_NAME]: {
|
|
32
|
+
title: "GenerateTestExpectElement",
|
|
33
|
+
description: "Generate test that expects of html element with accessible role and accessible name"
|
|
21
34
|
},
|
|
22
|
-
[UUV_PROMPT.
|
|
35
|
+
[UUV_PROMPT.GENERATE_TEST_EXPECT_DOM_SELECTOR]: {
|
|
23
36
|
title: "GenerateTestExpectElement",
|
|
24
|
-
description: "
|
|
37
|
+
description: "Generate test that expects of html element with domSelector"
|
|
38
|
+
},
|
|
39
|
+
[UUV_PROMPT.GENERATE_TEST_CLICK_ROLE_AND_NAME]: {
|
|
40
|
+
title: "GenerateTestClickElement",
|
|
41
|
+
description: "Generate test that clicks on html element with accessible role and accessible name"
|
|
25
42
|
},
|
|
26
|
-
[UUV_PROMPT.
|
|
43
|
+
[UUV_PROMPT.GENERATE_TEST_CLICK_DOM_SELECTOR]: {
|
|
27
44
|
title: "GenerateTestClickElement",
|
|
28
|
-
description: "
|
|
45
|
+
description: "Generate test that clicks on html element with domSelector"
|
|
46
|
+
},
|
|
47
|
+
[UUV_PROMPT.GENERATE_TEST_WITHIN_ROLE_AND_NAME]: {
|
|
48
|
+
title: "GenerateTestWithinElement",
|
|
49
|
+
description: "Generate test that focus within an html element with accessible role and accessible name"
|
|
29
50
|
},
|
|
30
|
-
[UUV_PROMPT.
|
|
51
|
+
[UUV_PROMPT.GENERATE_TEST_WITHIN_DOM_SELECTOR]: {
|
|
31
52
|
title: "GenerateTestWithinElement",
|
|
32
|
-
description: "
|
|
53
|
+
description: "Generate test that focus within an html element with domSelector"
|
|
33
54
|
},
|
|
34
|
-
[UUV_PROMPT.
|
|
55
|
+
[UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME]: {
|
|
35
56
|
title: "GenerateTestTypeElement",
|
|
36
|
-
description: "
|
|
57
|
+
description: "Generate test that types a value into html element with accessible role and accessible name"
|
|
37
58
|
}
|
|
38
59
|
};
|
|
60
|
+
exports.ElementByRoleAndNameInputSchema = {
|
|
61
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the element is located."),
|
|
62
|
+
accessibleRole: zod_1.z.string().describe("Accessible role of the element"),
|
|
63
|
+
accessibleName: zod_1.z.string().describe("Accessible name of the element"),
|
|
64
|
+
// valueToType: z.string().describe("Value to type"), TODO: implement this arg for UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME
|
|
65
|
+
};
|
|
66
|
+
exports.ElementByDomSelectorInputSchema = {
|
|
67
|
+
baseUrl: zod_1.z.string().describe("The base URL of the page where the element is located."),
|
|
68
|
+
domSelector: zod_1.z.string().describe("Dom selector of the element"),
|
|
69
|
+
};
|
|
39
70
|
exports.UUVPromptInputSchema = zod_1.z.discriminatedUnion("promptName", [
|
|
40
71
|
zod_1.z.object({
|
|
41
72
|
promptName: zod_1.z.literal(UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE),
|
|
@@ -43,31 +74,23 @@ exports.UUVPromptInputSchema = zod_1.z.discriminatedUnion("promptName", [
|
|
|
43
74
|
}),
|
|
44
75
|
zod_1.z.object({
|
|
45
76
|
promptName: zod_1.z.enum([
|
|
46
|
-
UUV_PROMPT.
|
|
47
|
-
UUV_PROMPT.
|
|
48
|
-
UUV_PROMPT.
|
|
49
|
-
UUV_PROMPT.
|
|
77
|
+
UUV_PROMPT.GENERATE_TEST_EXPECT_ROLE_AND_NAME,
|
|
78
|
+
UUV_PROMPT.GENERATE_TEST_CLICK_ROLE_AND_NAME,
|
|
79
|
+
UUV_PROMPT.GENERATE_TEST_WITHIN_ROLE_AND_NAME,
|
|
80
|
+
UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME
|
|
50
81
|
]),
|
|
51
|
-
|
|
52
|
-
accessibleName: zod_1.z.string().
|
|
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"),
|
|
82
|
+
accessibleRole: zod_1.z.string().describe("Accessible role of the element"),
|
|
83
|
+
accessibleName: zod_1.z.string().describe("Accessible name of the element"),
|
|
55
84
|
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
code: zod_1.z.ZodIssueCode.custom,
|
|
66
|
-
message: "You must provide either (accessibleRole AND accessibleName) or domSelector",
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
85
|
+
zod_1.z.object({
|
|
86
|
+
promptName: zod_1.z.enum([
|
|
87
|
+
UUV_PROMPT.GENERATE_TEST_EXPECT_DOM_SELECTOR,
|
|
88
|
+
UUV_PROMPT.GENERATE_TEST_CLICK_DOM_SELECTOR,
|
|
89
|
+
UUV_PROMPT.GENERATE_TEST_WITHIN_DOM_SELECTOR
|
|
90
|
+
]),
|
|
91
|
+
domSelector: zod_1.z.string().describe("Dom selector of the element"),
|
|
92
|
+
}),
|
|
93
|
+
]);
|
|
71
94
|
class PromptRetrieverService {
|
|
72
95
|
static loadPromptTemplate(promptName) {
|
|
73
96
|
const templatePath = path.join(__dirname, "..", "prompts", `${promptName}.mustache`);
|
|
@@ -78,50 +101,20 @@ class PromptRetrieverService {
|
|
|
78
101
|
return (0, mustache_1.render)(template, args);
|
|
79
102
|
}
|
|
80
103
|
static validatePromptGenerationRequest(args) {
|
|
81
|
-
|
|
82
|
-
zod_1.z.object({
|
|
83
|
-
promptName: zod_1.z.literal(UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE),
|
|
84
|
-
baseUrl: zod_1.z.string().describe("The base URL of the page where the table/grid/treegrid is located."),
|
|
85
|
-
}),
|
|
86
|
-
zod_1.z.object({
|
|
87
|
-
promptName: zod_1.z.enum([
|
|
88
|
-
UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT,
|
|
89
|
-
UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT,
|
|
90
|
-
UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT,
|
|
91
|
-
UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT
|
|
92
|
-
]),
|
|
93
|
-
baseUrl: zod_1.z.string().describe("The base URL of the page where the element is located."),
|
|
94
|
-
accessibleName: zod_1.z.string().optional().describe("Accessible name of the element"),
|
|
95
|
-
accessibleRole: zod_1.z.string().optional().describe("Accessible role of the element"),
|
|
96
|
-
domSelector: zod_1.z.string().optional().describe("Dom selector of the element"),
|
|
97
|
-
// valueToType: z.string().describe("Value to type"), TODO: implement this arg for UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT
|
|
98
|
-
})
|
|
99
|
-
]).superRefine((data, ctx) => {
|
|
100
|
-
if (data.promptName === UUV_PROMPT.GENERATE_TEST_EXPECT_ELEMENT ||
|
|
101
|
-
data.promptName === UUV_PROMPT.GENERATE_TEST_CLICK_ELEMENT ||
|
|
102
|
-
data.promptName === UUV_PROMPT.GENERATE_TEST_WITHIN_ELEMENT ||
|
|
103
|
-
data.promptName === UUV_PROMPT.GENERATE_TEST_TYPE_ELEMENT) {
|
|
104
|
-
const hasAccessibleSelector = data.accessibleRole && data.accessibleName;
|
|
105
|
-
const hasDomSelector = data.domSelector;
|
|
106
|
-
if (!hasAccessibleSelector && !hasDomSelector) {
|
|
107
|
-
ctx.addIssue({
|
|
108
|
-
code: zod_1.z.ZodIssueCode.custom,
|
|
109
|
-
message: "You must provide either (accessibleRole AND accessibleName) or domSelector",
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
return promptSchemas.parse(args);
|
|
104
|
+
return exports.UUVPromptInputSchema.parse(args);
|
|
115
105
|
}
|
|
116
106
|
static retrievePrompt(args) {
|
|
117
107
|
const validatedPrompt = PromptRetrieverService.validatePromptGenerationRequest(args);
|
|
118
108
|
let prompt;
|
|
119
109
|
switch (validatedPrompt.promptName) {
|
|
120
110
|
case UUV_PROMPT.GENERATE_TEST_EXPECT_TABLE:
|
|
121
|
-
case UUV_PROMPT.
|
|
122
|
-
case UUV_PROMPT.
|
|
123
|
-
case UUV_PROMPT.
|
|
124
|
-
case UUV_PROMPT.
|
|
111
|
+
case UUV_PROMPT.GENERATE_TEST_EXPECT_ROLE_AND_NAME:
|
|
112
|
+
case UUV_PROMPT.GENERATE_TEST_EXPECT_DOM_SELECTOR:
|
|
113
|
+
case UUV_PROMPT.GENERATE_TEST_CLICK_ROLE_AND_NAME:
|
|
114
|
+
case UUV_PROMPT.GENERATE_TEST_CLICK_DOM_SELECTOR:
|
|
115
|
+
case UUV_PROMPT.GENERATE_TEST_TYPE_ROLE_AND_NAME:
|
|
116
|
+
case UUV_PROMPT.GENERATE_TEST_WITHIN_ROLE_AND_NAME:
|
|
117
|
+
case UUV_PROMPT.GENERATE_TEST_WITHIN_DOM_SELECTOR:
|
|
125
118
|
prompt = PromptRetrieverService.generatePrompt(args);
|
|
126
119
|
break;
|
|
127
120
|
default:
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@modelcontextprotocol/sdk": "1.
|
|
60
|
+
"@modelcontextprotocol/sdk": "1.26.0",
|
|
61
61
|
"@types/mustache": "^4.2.6",
|
|
62
|
-
"@uuv/assistant": "2.
|
|
63
|
-
"@uuv/dictionary": "0.
|
|
62
|
+
"@uuv/assistant": "2.77.0",
|
|
63
|
+
"@uuv/dictionary": "0.5.0",
|
|
64
64
|
"jsdom": "26.1.0",
|
|
65
65
|
"mustache": "^4.2.0",
|
|
66
66
|
"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.8.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",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@modelcontextprotocol/sdk": "1.
|
|
60
|
+
"@modelcontextprotocol/sdk": "1.26.0",
|
|
61
61
|
"@types/mustache": "^4.2.6",
|
|
62
|
-
"@uuv/assistant": "2.
|
|
63
|
-
"@uuv/dictionary": "0.
|
|
62
|
+
"@uuv/assistant": "2.78.0",
|
|
63
|
+
"@uuv/dictionary": "0.6.0",
|
|
64
64
|
"jsdom": "26.1.0",
|
|
65
65
|
"mustache": "^4.2.0",
|
|
66
66
|
"tsconfig-paths": "4.2.0",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Use UUV and Filesystem MCP tools:
|
|
2
|
-
{{#domSelector}}
|
|
3
|
-
1. With uuv_generate_test_click_element, Generate UUV tests into ./uuv/e2e to click on an element with domSelector "{{{domSelector}}}" exist on the webpage {{{baseUrl}}}
|
|
4
|
-
{{/domSelector}}
|
|
5
|
-
{{^domSelector}}
|
|
6
|
-
1. With uuv_generate_test_click_element, Generate UUV tests into ./uuv/e2e to click on an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage {{{baseUrl}}}
|
|
7
|
-
{{/domSelector}}
|
|
8
|
-
2. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Use UUV and Filesystem MCP tools:
|
|
2
|
-
{{#domSelector}}
|
|
3
|
-
1. With uuv_generate_test_expect_element, Generate UUV tests into ./uuv/e2e to verify that an element with domSelector "{{{domSelector}}}" exist on the webpage {{{baseUrl}}}
|
|
4
|
-
{{/domSelector}}
|
|
5
|
-
{{^domSelector}}
|
|
6
|
-
1. With uuv_generate_test_expect_element, Generate UUV tests into ./uuv/e2e to verify that an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage {{{baseUrl}}}
|
|
7
|
-
{{/domSelector}}
|
|
8
|
-
2. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Use UUV and Filesystem MCP tools:
|
|
2
|
-
{{#domSelector}}
|
|
3
|
-
1. With uuv_generate_test_type_element, Generate UUV tests into ./uuv/e2e to type sentence or value into an element with domSelector "{{{domSelector}}}" exist on the webpage {{{baseUrl}}}
|
|
4
|
-
{{/domSelector}}
|
|
5
|
-
{{^domSelector}}
|
|
6
|
-
1. With uuv_generate_test_type_element, Generate UUV tests into ./uuv/e2e to type sentence or value into an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage {{{baseUrl}}}
|
|
7
|
-
{{/domSelector}}
|
|
8
|
-
2. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Use UUV and Filesystem MCP tools:
|
|
2
|
-
{{#domSelector}}
|
|
3
|
-
1. With uuv_generate_test_within_element, Generate UUV tests into ./uuv/e2e to focus on an element with domSelector "{{{domSelector}}}" exist on the webpage {{{baseUrl}}}
|
|
4
|
-
{{/domSelector}}
|
|
5
|
-
{{^domSelector}}
|
|
6
|
-
1. With uuv_generate_test_within_element, Generate UUV tests into ./uuv/e2e to focus on an element with accessibleName "{{accessibleName}}" and accessibleRole "{{accessibleRole}}" exist on the webpage {{{baseUrl}}}
|
|
7
|
-
{{/domSelector}}
|
|
8
|
-
2. Write generated uuv test case into a .feature file in local folder ./uuv/e2e (must use actual line breaks, not literal "\n" characters)
|