xray-mcp 1.2.2 → 1.2.4
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 +2 -1
- package/dist/xray-client.js +33 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,9 +141,10 @@ npm run dev
|
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
**Test Types:**
|
|
144
|
-
- `Manual` -
|
|
144
|
+
- `Manual` - Creates Unstructured tests (maps to "Unstructured" for `add_manual_test_steps` compatibility)
|
|
145
145
|
- `Unstructured` - Free-form text steps (use with `add_manual_test_steps` tool)
|
|
146
146
|
- `Cucumber` - Gherkin/BDD scenarios
|
|
147
|
+
- `Generic` - Other test types
|
|
147
148
|
- `Generic` - Generic automated tests
|
|
148
149
|
|
|
149
150
|
#### Add Manual Test Steps
|
package/dist/xray-client.js
CHANGED
|
@@ -111,50 +111,55 @@ export class XrayClient {
|
|
|
111
111
|
* Create a new test case using GraphQL mutation
|
|
112
112
|
*/
|
|
113
113
|
async createTestCase(testCase) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
// Step 1: Create the test without testType
|
|
115
|
+
const createMutation = `
|
|
116
|
+
mutation CreateTest($testIssueFields: CreateTestInput!) {
|
|
117
|
+
createTest(testIssueFields: $testIssueFields) {
|
|
118
|
+
testIssue {
|
|
118
119
|
issueId
|
|
119
|
-
|
|
120
|
+
key
|
|
120
121
|
}
|
|
121
122
|
warnings
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
`;
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
key: testCase.projectKey
|
|
129
|
-
},
|
|
130
|
-
summary: testCase.summary,
|
|
131
|
-
issuetype: {
|
|
132
|
-
name: 'Test'
|
|
133
|
-
}
|
|
134
|
-
}
|
|
126
|
+
const testIssueFields = {
|
|
127
|
+
projectKey: testCase.projectKey,
|
|
128
|
+
summary: testCase.summary
|
|
135
129
|
};
|
|
136
130
|
if (testCase.description) {
|
|
137
|
-
|
|
131
|
+
testIssueFields.description = testCase.description;
|
|
138
132
|
}
|
|
139
133
|
if (testCase.labels && testCase.labels.length > 0) {
|
|
140
|
-
|
|
134
|
+
testIssueFields.labels = testCase.labels;
|
|
141
135
|
}
|
|
142
136
|
if (testCase.priority) {
|
|
143
|
-
|
|
137
|
+
testIssueFields.priority = testCase.priority;
|
|
144
138
|
}
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
const createResult = await this.graphqlRequest(createMutation, { testIssueFields });
|
|
140
|
+
const issueId = createResult.createTest.testIssue.issueId;
|
|
141
|
+
const issueKey = createResult.createTest.testIssue.key;
|
|
142
|
+
// Step 2: Update test type if specified
|
|
148
143
|
if (testCase.testType) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
// Map "Manual" to "Unstructured" for ADO migration compatibility
|
|
145
|
+
let xrayTestType = testCase.testType;
|
|
146
|
+
if (testCase.testType === 'Manual') {
|
|
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
|
+
});
|
|
152
158
|
}
|
|
153
|
-
const result = await this.graphqlRequest(mutation, variables);
|
|
154
159
|
return {
|
|
155
|
-
id:
|
|
156
|
-
key:
|
|
157
|
-
self: `https://your-jira-instance.atlassian.net/browse/${
|
|
160
|
+
id: issueId,
|
|
161
|
+
key: issueKey,
|
|
162
|
+
self: `https://your-jira-instance.atlassian.net/browse/${issueKey}`
|
|
158
163
|
};
|
|
159
164
|
}
|
|
160
165
|
/**
|