targetprocess-mcp-server 2.0.2 → 2.0.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 -2
- package/build/index.js +36 -24
- package/build/tp.js +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,8 +60,8 @@ Cards — Write
|
|
|
60
60
|
- `add_test_cases` — Create a test plan and add generated test cases to it in one call (resourceId, testPlanTitle, testCases array of {name, description}, optional resourceType)
|
|
61
61
|
|
|
62
62
|
Test Case Workflows
|
|
63
|
-
- `write_test_cases` — Fetch a card (UserStory, Bug, or Feature) by ID and trigger the full test case writing workflow: Claude analyzes the card, generates detailed
|
|
64
|
-
- `add_test_cases_to_test_plan` — Add
|
|
63
|
+
- `write_test_cases` — Fetch a card (UserStory, Bug, or Feature) by ID and trigger the full test case writing workflow: Claude analyzes the card, generates detailed test cases covering happy path, edge cases, and error scenarios, creates a linked test plan via `create_test_plan`, then calls `add_test_cases_to_test_plan`. Each test case description contains Preconditions and Test Type as HTML; steps are passed as a structured array (resourceId, optional resourceType)
|
|
64
|
+
- `add_test_cases_to_test_plan` — Add pre-generated test cases to an existing test plan. Each test case has a `name`, an HTML `description` (Preconditions and Test Type only), and a `steps` array of `{ description, result }` objects — steps are created via the TP test step API rather than embedded in the description (testPlanId, testCases array of {name, description, steps})
|
|
65
65
|
|
|
66
66
|
Projects
|
|
67
67
|
- `get_projects` — Get all Targetprocess projects (no params needed)
|
package/build/index.js
CHANGED
|
@@ -597,8 +597,8 @@ server.registerTool('create_bug_based_on_card', {
|
|
|
597
597
|
CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
|
|
598
598
|
1) IF you already have user story or bug card content, proceed to step 3 skipping step 2;
|
|
599
599
|
2) ELSE call "get_user_story_content" tool or "get_bug_content" tool to get user story or bug card content;
|
|
600
|
-
3) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior;
|
|
601
|
-
4) add a comment to the card with bug Id
|
|
600
|
+
3) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior sections (note: section titles should be wrapped in <h3> tags, e.g. <h3>Issue Description</h3>);
|
|
601
|
+
4) add a comment to the card with created bug Id and its Title`,
|
|
602
602
|
inputSchema: {
|
|
603
603
|
title: z.string()
|
|
604
604
|
.describe('Bug card title that summarizes the problem in concise, descriptive, and actionable manner, enabling a developer to understand the issue without opening the report'),
|
|
@@ -652,7 +652,7 @@ server.registerTool('create_bug', {
|
|
|
652
652
|
description: `Create a new bug card that summarizes the problem in concise, descriptive manner answering questions "What? Where? When?" and content explaining what happened in detail.
|
|
653
653
|
NOTE: this tool does not require a user story or bug card referenced.
|
|
654
654
|
CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
|
|
655
|
-
1) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior;
|
|
655
|
+
1) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior sections (note: section titles should be wrapped in <h3> tags, e.g. <h3>Issue Description</h3>);
|
|
656
656
|
2) add a comment to the newly created bug with its Id and Title`,
|
|
657
657
|
inputSchema: {
|
|
658
658
|
title: z.string()
|
|
@@ -952,15 +952,12 @@ server.registerTool('write_test_cases', {
|
|
|
952
952
|
CRITICAL WORKFLOW — after receiving the card content, you MUST:
|
|
953
953
|
1) Thoroughly analyze the card name and description to understand the feature or issue being tested
|
|
954
954
|
2) Write detailed test cases covering: happy path, edge cases, boundary conditions, and error scenarios
|
|
955
|
-
3)
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
</div>
|
|
962
|
-
4) Call "create_test_plan" tool passing: resourceId (the card id), resourceType, testPlanTitle (use the card name prefixed with "Test Plan: "), and the testCases array
|
|
963
|
-
5) Call "add_test_case_to_test_plan" tool passing: testPlanId (the test plan id), and the testCases array`,
|
|
955
|
+
3) For each test case produce:
|
|
956
|
+
- name: concise action-oriented title
|
|
957
|
+
- description: HTML <div> with Preconditions and Test Type sections only (no steps here)
|
|
958
|
+
- steps: ordered array of { description: "<step action>", result: "<expected result>" }
|
|
959
|
+
4) Call "create_test_plan" tool passing: resourceId (the card id), resourceType, testPlanTitle (use the card name/title)
|
|
960
|
+
5) Call "add_test_cases_to_test_plan" tool passing: testPlanId (the test plan id), and the testCases array with name, description, and steps`,
|
|
964
961
|
inputSchema: {
|
|
965
962
|
resourceId: z.string()
|
|
966
963
|
.min(5)
|
|
@@ -1018,35 +1015,50 @@ server.registerTool('add_test_cases_to_test_plan', {
|
|
|
1018
1015
|
testPlanId: z.string()
|
|
1019
1016
|
.min(5)
|
|
1020
1017
|
.max(6)
|
|
1021
|
-
.describe('
|
|
1018
|
+
.describe('Test plan ID to add test cases to (e.g. 145789)'),
|
|
1022
1019
|
testCases: z.array(z.object({
|
|
1023
1020
|
name: z.string()
|
|
1024
1021
|
.describe('Test case title (concise, action-oriented)'),
|
|
1025
1022
|
description: z.string()
|
|
1026
|
-
.describe('Test case
|
|
1023
|
+
.describe('Test case context formatted as HTML — include Preconditions and Test Type sections, but NOT test steps (those go in the steps field)'),
|
|
1024
|
+
steps: z.array(z.object({
|
|
1025
|
+
description: z.string()
|
|
1026
|
+
.describe('Step action text'),
|
|
1027
|
+
result: z.string()
|
|
1028
|
+
.describe('Expected result for this step'),
|
|
1029
|
+
}))
|
|
1030
|
+
.min(1)
|
|
1031
|
+
.describe('Ordered list of test steps with their expected results'),
|
|
1027
1032
|
}))
|
|
1028
1033
|
.min(1)
|
|
1029
|
-
.describe('Array of test cases to create in the
|
|
1034
|
+
.describe('Array of test cases to create in the test plan'),
|
|
1030
1035
|
},
|
|
1031
1036
|
}, async ({ testPlanId, testCases }) => {
|
|
1032
1037
|
const created = [];
|
|
1033
1038
|
const failed = [];
|
|
1034
1039
|
for (const tc of testCases) {
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1037
|
-
created.push({ id: result.Id, name: result.Name });
|
|
1038
|
-
}
|
|
1039
|
-
else {
|
|
1040
|
+
const testCase = await tp.createTestCase(tc.name, tc.description, String(testPlanId));
|
|
1041
|
+
if (!testCase) {
|
|
1040
1042
|
failed.push(tc.name);
|
|
1043
|
+
continue;
|
|
1044
|
+
}
|
|
1045
|
+
let stepsAdded = 0;
|
|
1046
|
+
let stepsFailed = 0;
|
|
1047
|
+
for (const step of tc.steps) {
|
|
1048
|
+
const stepResult = await tp.addTestStep(String(testCase.Id), step);
|
|
1049
|
+
if (stepResult) {
|
|
1050
|
+
stepsAdded++;
|
|
1051
|
+
}
|
|
1052
|
+
else {
|
|
1053
|
+
stepsFailed++;
|
|
1054
|
+
}
|
|
1041
1055
|
}
|
|
1056
|
+
created.push({ id: testCase.Id, name: testCase.Name, stepsAdded, stepsFailed });
|
|
1042
1057
|
}
|
|
1043
1058
|
return {
|
|
1044
1059
|
content: [{
|
|
1045
1060
|
type: 'text',
|
|
1046
|
-
text: JSON.stringify({
|
|
1047
|
-
created,
|
|
1048
|
-
failed,
|
|
1049
|
-
})
|
|
1061
|
+
text: JSON.stringify({ created, failed })
|
|
1050
1062
|
}]
|
|
1051
1063
|
};
|
|
1052
1064
|
});
|
package/build/tp.js
CHANGED
|
@@ -192,7 +192,7 @@ export class TpClient {
|
|
|
192
192
|
}
|
|
193
193
|
async createTestPlan(title, resourceId, resourceType = 'UserStory', options) {
|
|
194
194
|
const testPlan = {
|
|
195
|
-
"Name": title
|
|
195
|
+
"Name": `Test Plan: ${title}`,
|
|
196
196
|
"Project": {
|
|
197
197
|
"Id": config.tp.projectId
|
|
198
198
|
},
|
|
@@ -242,6 +242,17 @@ export class TpClient {
|
|
|
242
242
|
param: { "format": "json" },
|
|
243
243
|
}, commentData);
|
|
244
244
|
}
|
|
245
|
+
async addTestStep(testCaseId, testStep) {
|
|
246
|
+
const testStepData = {
|
|
247
|
+
"Description": testStep.description,
|
|
248
|
+
"Result": testStep.result,
|
|
249
|
+
"TestCase": { "Id": testCaseId },
|
|
250
|
+
};
|
|
251
|
+
return this.post({
|
|
252
|
+
pathParam: { "testSteps": '' },
|
|
253
|
+
param: { "format": "json" },
|
|
254
|
+
}, testStepData);
|
|
255
|
+
}
|
|
245
256
|
async getBugComments(bugId, results = 25) {
|
|
246
257
|
const response = await this.get({
|
|
247
258
|
pathParam: {
|