xray-mcp 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/xray-client.js +15 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ This MCP server exposes tools to manage test cases and test executions in Xray C
|
|
|
9
9
|
### Test Cases (Test Management)
|
|
10
10
|
- **create_test_case**: Create a new test case (uses GraphQL mutation `createTest`)
|
|
11
11
|
- **get_test_case**: Retrieve details of a specific test case (uses GraphQL query `getTests`)
|
|
12
|
+
- **add_manual_test_steps**: Add or update manual test steps for a test case (uses GraphQL mutation `updateUnstructuredTestDefinition`)
|
|
12
13
|
- **delete_test_case**: Delete a test case (uses GraphQL mutation `deleteTest`)
|
|
13
14
|
- **search_test_cases**: Search test cases using JQL (Jira Query Language)
|
|
14
15
|
- **get_project_test_cases**: Retrieve all test cases for a project
|
package/dist/xray-client.js
CHANGED
|
@@ -214,25 +214,27 @@ export class XrayClient {
|
|
|
214
214
|
* @param steps - Array of test steps with action, data, and result
|
|
215
215
|
*/
|
|
216
216
|
async addManualTestSteps(issueId, steps) {
|
|
217
|
-
// Format steps for Xray
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
217
|
+
// Format steps as a string for Xray's unstructured test definition
|
|
218
|
+
// Format: "1. Action|Data|Result\n2. Action|Data|Result"
|
|
219
|
+
const unstructuredSteps = steps
|
|
220
|
+
.map((step, index) => {
|
|
221
|
+
const stepNumber = index + 1;
|
|
222
|
+
const parts = [step.action];
|
|
223
|
+
if (step.data) {
|
|
224
|
+
parts.push(step.data);
|
|
224
225
|
}
|
|
225
|
-
|
|
226
|
+
parts.push(step.result);
|
|
227
|
+
return `${stepNumber}. ${parts.join('|')}`;
|
|
228
|
+
})
|
|
229
|
+
.join('\n');
|
|
226
230
|
const mutation = `
|
|
227
|
-
mutation
|
|
228
|
-
|
|
229
|
-
issueId
|
|
230
|
-
}
|
|
231
|
+
mutation UpdateUnstructuredTest($issueId: String!, $unstructured: String!) {
|
|
232
|
+
updateUnstructuredTestDefinition(issueId: $issueId, unstructured: $unstructured)
|
|
231
233
|
}
|
|
232
234
|
`;
|
|
233
235
|
const variables = {
|
|
234
236
|
issueId: issueId,
|
|
235
|
-
|
|
237
|
+
unstructured: unstructuredSteps
|
|
236
238
|
};
|
|
237
239
|
await this.graphqlRequest(mutation, variables);
|
|
238
240
|
}
|