Skip to content

Commit 922ca2e

Browse files
authored
Providing Links to Test case project and folders (#46)
1 parent 79b9906 commit 922ca2e

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/tools/testmanagement-utils/create-project-folder.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import config from "../../config.js";
33
import { z } from "zod";
44
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
55
import { formatAxiosError } from "../../lib/error.js"; // or correct path
6+
import { projectIdentifierToId } from "../testmanagement-utils/TCG-utils/api.js";
67

78
// Schema for combined project/folder creation
89
export const CreateProjFoldSchema = z.object({
@@ -112,11 +113,17 @@ export async function createProjectOrFolder(
112113
// Folder created successfully
113114

114115
const folder = res.data.folder;
116+
const projectId = await projectIdentifierToId(projId);
117+
115118
return {
116119
content: [
117120
{
118121
type: "text",
119-
text: `Folder created: ID=${folder.id}, name=${folder.name} in project with identifier ${projId}`,
122+
text: `Folder successfully created:
123+
- ID: ${folder.id}
124+
- Name: ${folder.name}
125+
- Project Identifier: ${projId}
126+
Access it here: https://test-management.browserstack.com/projects/${projectId}/folder/${folder.id}/`,
120127
},
121128
],
122129
};

src/tools/testmanagement-utils/create-testcase.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import config from "../../config.js";
33
import { z } from "zod";
44
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
55
import { formatAxiosError } from "../../lib/error.js"; // or correct
6+
import { projectIdentifierToId } from "./TCG-utils/api.js";
67

78
interface TestCaseStep {
89
step: string;
@@ -174,13 +175,22 @@ export async function createTestCase(
174175
}
175176

176177
const tc = data.test_case;
178+
const projectId = await projectIdentifierToId(params.project_identifier);
179+
177180
return {
178181
content: [
179182
{
180183
type: "text",
181-
text: `Successfully created test case ${tc.identifier}: ${tc.title}`,
184+
text: `Test case successfully created:
185+
- Identifier: ${tc.identifier}
186+
- Title: ${tc.title}
187+
188+
You can view it here: https://test-management.browserstack.com/projects/${projectId}/folder/search?q=${tc.identifier}`,
189+
},
190+
{
191+
type: "text",
192+
text: JSON.stringify(tc, null, 2),
182193
},
183-
{ type: "text", text: JSON.stringify(tc, null, 2) },
184194
],
185195
};
186196
} catch (err) {

0 commit comments

Comments
 (0)