xray-mcp 1.2.4 → 1.2.5
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 +4 -5
- package/dist/index.js +4 -4
- package/dist/xray-client.d.ts +1 -1
- package/dist/xray-client.js +29 -33
- package/package.json +1 -1
- package/workingsrcforreplacement/index.ts +936 -0
- package/workingsrcforreplacement/xray-client.ts +955 -0
package/README.md
CHANGED
|
@@ -134,22 +134,21 @@ npm run dev
|
|
|
134
134
|
"projectKey": "ABC",
|
|
135
135
|
"summary": "Verify login functionality",
|
|
136
136
|
"description": "Test that users can log in with valid credentials",
|
|
137
|
-
"testType": "
|
|
137
|
+
"testType": "Manual",
|
|
138
138
|
"labels": ["login", "authentication"],
|
|
139
139
|
"priority": "High"
|
|
140
140
|
}
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
**Test Types:**
|
|
144
|
-
- `Manual` -
|
|
145
|
-
- `Unstructured` - Free-form text steps (use with `add_manual_test_steps` tool)
|
|
144
|
+
- `Manual` - Manual tests (default, use with `add_manual_test_steps` for unstructured steps)
|
|
146
145
|
- `Cucumber` - Gherkin/BDD scenarios
|
|
147
146
|
- `Generic` - Other test types
|
|
148
147
|
- `Generic` - Generic automated tests
|
|
149
148
|
|
|
150
149
|
#### Add Manual Test Steps
|
|
151
150
|
|
|
152
|
-
**Important:** Test cases
|
|
151
|
+
**Important:** Test cases can use this tool regardless of test type.
|
|
153
152
|
|
|
154
153
|
```json
|
|
155
154
|
{
|
|
@@ -169,7 +168,7 @@ npm run dev
|
|
|
169
168
|
```
|
|
170
169
|
|
|
171
170
|
**Migration from Azure DevOps:** This tool is perfect for migrating test cases from ADO:
|
|
172
|
-
1. Create test case with `testType: "
|
|
171
|
+
1. Create test case with `testType: "Manual"` (default)
|
|
173
172
|
2. Use the returned `issueId` with `add_manual_test_steps`
|
|
174
173
|
3. Steps are formatted as pipe-delimited text: "1. Action|Data|Result"
|
|
175
174
|
|
package/dist/index.js
CHANGED
|
@@ -37,9 +37,9 @@ const tools = [
|
|
|
37
37
|
},
|
|
38
38
|
testType: {
|
|
39
39
|
type: 'string',
|
|
40
|
-
enum: ['
|
|
41
|
-
description: 'The type of test case
|
|
42
|
-
default: '
|
|
40
|
+
enum: ['Manual', 'Cucumber', 'Generic'],
|
|
41
|
+
description: 'The type of test case',
|
|
42
|
+
default: 'Manual',
|
|
43
43
|
},
|
|
44
44
|
labels: {
|
|
45
45
|
type: 'array',
|
|
@@ -554,7 +554,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
554
554
|
projectKey: args.projectKey,
|
|
555
555
|
summary: args.summary,
|
|
556
556
|
description: args.description,
|
|
557
|
-
testType: args.testType || '
|
|
557
|
+
testType: args.testType || 'Manual',
|
|
558
558
|
labels: args.labels,
|
|
559
559
|
priority: args.priority,
|
|
560
560
|
};
|
package/dist/xray-client.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface TestCase {
|
|
|
12
12
|
key?: string;
|
|
13
13
|
summary: string;
|
|
14
14
|
description?: string;
|
|
15
|
-
testType?: '
|
|
15
|
+
testType?: 'Manual' | 'Cucumber' | 'Generic';
|
|
16
16
|
projectKey: string;
|
|
17
17
|
labels?: string[];
|
|
18
18
|
components?: string[];
|
package/dist/xray-client.js
CHANGED
|
@@ -111,55 +111,51 @@ export class XrayClient {
|
|
|
111
111
|
* Create a new test case using GraphQL mutation
|
|
112
112
|
*/
|
|
113
113
|
async createTestCase(testCase) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
testIssue {
|
|
114
|
+
const mutation = `
|
|
115
|
+
mutation CreateTest($jira: JSON!, $testType: UpdateTestTypeInput, $unstructured: String) {
|
|
116
|
+
createTest(jira: $jira, testType: $testType, unstructured: $unstructured) {
|
|
117
|
+
test {
|
|
119
118
|
issueId
|
|
120
|
-
key
|
|
119
|
+
jira(fields: ["key"])
|
|
121
120
|
}
|
|
122
121
|
warnings
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
124
|
`;
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
const jiraFields = {
|
|
126
|
+
fields: {
|
|
127
|
+
project: {
|
|
128
|
+
key: testCase.projectKey
|
|
129
|
+
},
|
|
130
|
+
summary: testCase.summary,
|
|
131
|
+
issuetype: {
|
|
132
|
+
name: 'Test'
|
|
133
|
+
}
|
|
134
|
+
}
|
|
129
135
|
};
|
|
130
136
|
if (testCase.description) {
|
|
131
|
-
|
|
137
|
+
jiraFields.fields.description = testCase.description;
|
|
132
138
|
}
|
|
133
139
|
if (testCase.labels && testCase.labels.length > 0) {
|
|
134
|
-
|
|
140
|
+
jiraFields.fields.labels = testCase.labels;
|
|
135
141
|
}
|
|
136
142
|
if (testCase.priority) {
|
|
137
|
-
|
|
143
|
+
jiraFields.fields.priority = { name: testCase.priority };
|
|
138
144
|
}
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
const variables = {
|
|
146
|
+
jira: jiraFields,
|
|
147
|
+
unstructured: testCase.description || ''
|
|
148
|
+
};
|
|
143
149
|
if (testCase.testType) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
xrayTestType = 'Unstructured';
|
|
148
|
-
}
|
|
149
|
-
const updateTypeMutation = `
|
|
150
|
-
mutation UpdateTestType($issueId: String!, $testType: UpdateTestTypeInput!) {
|
|
151
|
-
updateTestType(issueId: $issueId, testType: $testType)
|
|
152
|
-
}
|
|
153
|
-
`;
|
|
154
|
-
await this.graphqlRequest(updateTypeMutation, {
|
|
155
|
-
issueId,
|
|
156
|
-
testType: { name: xrayTestType }
|
|
157
|
-
});
|
|
150
|
+
variables.testType = {
|
|
151
|
+
name: testCase.testType
|
|
152
|
+
};
|
|
158
153
|
}
|
|
154
|
+
const result = await this.graphqlRequest(mutation, variables);
|
|
159
155
|
return {
|
|
160
|
-
id: issueId,
|
|
161
|
-
key:
|
|
162
|
-
self: `https://your-jira-instance.atlassian.net/browse/${
|
|
156
|
+
id: result.createTest.test.issueId,
|
|
157
|
+
key: result.createTest.test.jira.key,
|
|
158
|
+
self: `https://your-jira-instance.atlassian.net/browse/${result.createTest.test.jira.key}`
|
|
163
159
|
};
|
|
164
160
|
}
|
|
165
161
|
/**
|