xray-mcp 1.0.1 → 1.1.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/dist/index.js +47 -0
- package/dist/xray-client.d.ts +10 -0
- package/dist/xray-client.js +28 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113,6 +113,42 @@ const tools = [
|
|
|
113
113
|
required: ['testKey'],
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
|
+
{
|
|
117
|
+
name: 'add_manual_test_steps',
|
|
118
|
+
description: 'Add or update manual test steps for a test case',
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {
|
|
122
|
+
issueId: {
|
|
123
|
+
type: 'string',
|
|
124
|
+
description: 'The test case issue ID (e.g., "58309")',
|
|
125
|
+
},
|
|
126
|
+
steps: {
|
|
127
|
+
type: 'array',
|
|
128
|
+
items: {
|
|
129
|
+
type: 'object',
|
|
130
|
+
properties: {
|
|
131
|
+
action: {
|
|
132
|
+
type: 'string',
|
|
133
|
+
description: 'The action/step to perform',
|
|
134
|
+
},
|
|
135
|
+
data: {
|
|
136
|
+
type: 'string',
|
|
137
|
+
description: 'Test data for the step (optional)',
|
|
138
|
+
},
|
|
139
|
+
result: {
|
|
140
|
+
type: 'string',
|
|
141
|
+
description: 'Expected result of the step',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
required: ['action', 'result'],
|
|
145
|
+
},
|
|
146
|
+
description: 'Array of test steps to add',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
required: ['issueId', 'steps'],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
116
152
|
{
|
|
117
153
|
name: 'search_test_cases',
|
|
118
154
|
description: 'Search for test cases using JQL (Jira Query Language)',
|
|
@@ -574,6 +610,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
574
610
|
],
|
|
575
611
|
};
|
|
576
612
|
}
|
|
613
|
+
case 'add_manual_test_steps': {
|
|
614
|
+
await xrayClient.addManualTestSteps(args.issueId, args.steps);
|
|
615
|
+
return {
|
|
616
|
+
content: [
|
|
617
|
+
{
|
|
618
|
+
type: 'text',
|
|
619
|
+
text: `Test steps added successfully to issue ${args.issueId}`,
|
|
620
|
+
},
|
|
621
|
+
],
|
|
622
|
+
};
|
|
623
|
+
}
|
|
577
624
|
case 'search_test_cases': {
|
|
578
625
|
const result = await xrayClient.searchTestCases(args.jql, args.maxResults);
|
|
579
626
|
return {
|
package/dist/xray-client.d.ts
CHANGED
|
@@ -107,6 +107,16 @@ export declare class XrayClient {
|
|
|
107
107
|
* For general Jira field updates (summary, description, labels), use Jira REST API directly
|
|
108
108
|
*/
|
|
109
109
|
updateTestCase(testKey: string, updates: Partial<TestCase>): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Add or update manual test steps for a test case
|
|
112
|
+
* @param issueId - The test case issue ID (e.g., "58309")
|
|
113
|
+
* @param steps - Array of test steps with action, data, and result
|
|
114
|
+
*/
|
|
115
|
+
addManualTestSteps(issueId: string, steps: Array<{
|
|
116
|
+
action: string;
|
|
117
|
+
data?: string;
|
|
118
|
+
result: string;
|
|
119
|
+
}>): Promise<void>;
|
|
110
120
|
/**
|
|
111
121
|
* Delete a test case using GraphQL mutation
|
|
112
122
|
* First retrieves the issueId from the test key, then deletes it
|
package/dist/xray-client.js
CHANGED
|
@@ -208,6 +208,34 @@ export class XrayClient {
|
|
|
208
208
|
'Use specific Xray mutations for test definition updates: ' +
|
|
209
209
|
'updateUnstructuredTestDefinition, updateGherkinTestDefinition, updateTestType, etc.');
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Add or update manual test steps for a test case
|
|
213
|
+
* @param issueId - The test case issue ID (e.g., "58309")
|
|
214
|
+
* @param steps - Array of test steps with action, data, and result
|
|
215
|
+
*/
|
|
216
|
+
async addManualTestSteps(issueId, steps) {
|
|
217
|
+
// Format steps for Xray API
|
|
218
|
+
const formattedSteps = steps.map((step, index) => ({
|
|
219
|
+
index: index,
|
|
220
|
+
fields: {
|
|
221
|
+
Action: step.action,
|
|
222
|
+
Data: step.data || '',
|
|
223
|
+
'Expected Result': step.result
|
|
224
|
+
}
|
|
225
|
+
}));
|
|
226
|
+
const mutation = `
|
|
227
|
+
mutation UpdateManualTestSteps($issueId: String!, $steps: [ManualTestStepInput!]!) {
|
|
228
|
+
updateManualTestSteps(issueId: $issueId, steps: $steps) {
|
|
229
|
+
issueId
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
`;
|
|
233
|
+
const variables = {
|
|
234
|
+
issueId: issueId,
|
|
235
|
+
steps: formattedSteps
|
|
236
|
+
};
|
|
237
|
+
await this.graphqlRequest(mutation, variables);
|
|
238
|
+
}
|
|
211
239
|
/**
|
|
212
240
|
* Delete a test case using GraphQL mutation
|
|
213
241
|
* First retrieves the issueId from the test key, then deletes it
|