wopee-mcp 1.7.1 → 1.8.1
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.
|
@@ -3,10 +3,17 @@ export const createFetchFileInput = (input) => {
|
|
|
3
3
|
const { WOPEE_PROJECT_UUID } = getConfig();
|
|
4
4
|
if (!WOPEE_PROJECT_UUID)
|
|
5
5
|
throw new Error("WOPEE_PROJECT_UUID is not set");
|
|
6
|
+
let testCaseId;
|
|
7
|
+
if (input.identifier) {
|
|
8
|
+
// Temporary solution for fetching playwright code for a specific test case TODO: replace with proper identifier later
|
|
9
|
+
const [usId, tcId] = input.identifier.split(":");
|
|
10
|
+
testCaseId = `${usId}/${tcId}`;
|
|
11
|
+
}
|
|
6
12
|
return {
|
|
7
13
|
projectUuid: WOPEE_PROJECT_UUID,
|
|
8
14
|
suiteUuid: input.suiteUuid,
|
|
9
15
|
bucket: input.bucket,
|
|
16
|
+
...(testCaseId ? { testCaseId } : {}),
|
|
10
17
|
};
|
|
11
18
|
};
|
|
12
19
|
export const createGenerateAIDataInput = (input) => {
|
|
@@ -35,10 +42,18 @@ export const createUpdateFileInput = (input) => {
|
|
|
35
42
|
const { WOPEE_PROJECT_UUID } = getConfig();
|
|
36
43
|
if (!WOPEE_PROJECT_UUID)
|
|
37
44
|
throw new Error("WOPEE_PROJECT_UUID is not set");
|
|
45
|
+
let userStoryId;
|
|
46
|
+
let testCaseId;
|
|
47
|
+
if (input.identifier) {
|
|
48
|
+
[userStoryId, testCaseId] = input.identifier.split(":");
|
|
49
|
+
}
|
|
38
50
|
return {
|
|
39
51
|
bucket: input.bucket,
|
|
40
52
|
projectUuid: WOPEE_PROJECT_UUID,
|
|
41
53
|
suiteUuid: input.suiteUuid,
|
|
42
|
-
[input.outputType === "markdown"
|
|
54
|
+
[input.outputType === "markdown" || input.outputType === "typescript"
|
|
55
|
+
? "code"
|
|
56
|
+
: "json"]: input.fileContent,
|
|
57
|
+
...(userStoryId && testCaseId ? { testCaseId, userStoryId } : {}),
|
|
43
58
|
};
|
|
44
59
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const FetchFile = `
|
|
2
|
-
query FetchFile($projectUuid: ID!, $suiteUuid: ID!, $bucket: String
|
|
3
|
-
fetchFile(projectUuid: $projectUuid, suiteUuid: $suiteUuid, bucket: $bucket)
|
|
2
|
+
query FetchFile($projectUuid: ID!, $suiteUuid: ID!, $bucket: String!, $testCaseId: String) {
|
|
3
|
+
fetchFile(projectUuid: $projectUuid, suiteUuid: $suiteUuid, bucket: $bucket, testCaseId: $testCaseId)
|
|
4
4
|
}
|
|
5
5
|
`;
|
|
6
6
|
export const DispatchAgent = `
|
|
@@ -79,6 +79,14 @@ function parseFileType(type) {
|
|
|
79
79
|
outputType: "json",
|
|
80
80
|
description: "generate test case steps for test cases in user stories for selected suite",
|
|
81
81
|
};
|
|
82
|
+
case FileType.PLAYWRIGHT_CODE:
|
|
83
|
+
return {
|
|
84
|
+
query: null,
|
|
85
|
+
dataKey: null,
|
|
86
|
+
bucket: Bucket.PLAYWRIGHT_CODE,
|
|
87
|
+
outputType: "typescript",
|
|
88
|
+
description: "fetch playwright code for selected test case",
|
|
89
|
+
};
|
|
82
90
|
default:
|
|
83
91
|
return {
|
|
84
92
|
query: null,
|
|
@@ -104,6 +112,7 @@ export async function fetchFile(input) {
|
|
|
104
112
|
const fetchFileInput = createFetchFileInput({
|
|
105
113
|
bucket,
|
|
106
114
|
suiteUuid: input.suiteUuid,
|
|
115
|
+
identifier: input.identifier,
|
|
107
116
|
});
|
|
108
117
|
const parsedInput = FetchFileInputSchema.parse(fetchFileInput);
|
|
109
118
|
const result = await requestClient(FetchFile, parsedInput);
|
|
@@ -181,6 +190,7 @@ export async function updateFile(input) {
|
|
|
181
190
|
outputType,
|
|
182
191
|
suiteUuid: input.suiteUuid,
|
|
183
192
|
fileContent: input.fileContent,
|
|
193
|
+
identifier: input.identifier,
|
|
184
194
|
});
|
|
185
195
|
const parsedInput = UpdateFileInputSchema.parse(updateFileInput);
|
|
186
196
|
const updateFileResult = await requestClient(UpdateFile, {
|
|
@@ -15,7 +15,7 @@ export const SuiteAnalysisConfigSchema = z.object({
|
|
|
15
15
|
additionalVariables: z.string().nullable().default(null),
|
|
16
16
|
});
|
|
17
17
|
export const GenerateAIDataHandlerInputSchema = z.object({
|
|
18
|
-
fileType: z.
|
|
18
|
+
fileType: z.enum(Object.values(FileType).filter((type) => type !== FileType.PLAYWRIGHT_CODE), {
|
|
19
19
|
description: "Chosen type of file(artifact) to generate",
|
|
20
20
|
}),
|
|
21
21
|
suiteUuid: z
|
|
@@ -39,15 +39,22 @@ export const FetchFileHandlerInputSchema = z.object({
|
|
|
39
39
|
suiteUuid: z
|
|
40
40
|
.string({ description: "UUID of the suite to fetch the file from" })
|
|
41
41
|
.min(1, "Suite UUID is required"),
|
|
42
|
+
identifier: z
|
|
43
|
+
.string({
|
|
44
|
+
description: "Identifier for the test case to fetch playwright code for, ex. `US004:TC006`, should be provided only for `PLAYWRIGHT_CODE` file type",
|
|
45
|
+
})
|
|
46
|
+
.optional(),
|
|
42
47
|
});
|
|
43
48
|
export const FetchFileFactoryInputSchema = z.object({
|
|
44
49
|
suiteUuid: z.string().min(1, "Suite UUID is required"),
|
|
45
50
|
bucket: z.nativeEnum(Bucket),
|
|
51
|
+
identifier: z.string().nullish(),
|
|
46
52
|
});
|
|
47
53
|
export const FetchFileInputSchema = z.object({
|
|
48
54
|
projectUuid: z.string().min(1, "Project UUID is required"),
|
|
49
55
|
suiteUuid: z.string().min(1, "Suite UUID is required"),
|
|
50
56
|
bucket: z.nativeEnum(Bucket),
|
|
57
|
+
testCaseId: z.string().nullish(),
|
|
51
58
|
});
|
|
52
59
|
export const UpdateFileHandlerInputSchema = z.object({
|
|
53
60
|
fileType: z.nativeEnum(FileType, {
|
|
@@ -59,12 +66,18 @@ export const UpdateFileHandlerInputSchema = z.object({
|
|
|
59
66
|
suiteUuid: z
|
|
60
67
|
.string({ description: "UUID of the suite to update the file for" })
|
|
61
68
|
.min(1, "Suite UUID is required"),
|
|
69
|
+
identifier: z
|
|
70
|
+
.string({
|
|
71
|
+
description: "Identifier for the test case to update playwright code for, ex. `US004:TC006`, should be provided only for `PLAYWRIGHT_CODE` file type",
|
|
72
|
+
})
|
|
73
|
+
.optional(),
|
|
62
74
|
});
|
|
63
75
|
export const UpdateFileFactoryInputSchema = z.object({
|
|
64
76
|
bucket: z.nativeEnum(Bucket),
|
|
65
77
|
suiteUuid: z.string().min(1, "Suite UUID is required"),
|
|
66
78
|
fileContent: z.string(),
|
|
67
|
-
outputType: z.enum(["markdown", "json"]),
|
|
79
|
+
outputType: z.enum(["markdown", "json", "typescript"]),
|
|
80
|
+
identifier: z.string().optional(),
|
|
68
81
|
});
|
|
69
82
|
export const UpdateFileInputSchema = z.object({
|
|
70
83
|
projectUuid: z.string().min(1, "Project UUID is required"),
|
|
@@ -72,4 +85,6 @@ export const UpdateFileInputSchema = z.object({
|
|
|
72
85
|
bucket: z.nativeEnum(Bucket),
|
|
73
86
|
json: z.string().nullish(),
|
|
74
87
|
code: z.string().nullish(),
|
|
88
|
+
testCaseId: z.string().nullish(),
|
|
89
|
+
userStoryId: z.string().nullish(),
|
|
75
90
|
});
|
|
@@ -25,6 +25,7 @@ export var FileType;
|
|
|
25
25
|
FileType["TEST_CASE_STEPS"] = "TEST_CASE_STEPS";
|
|
26
26
|
FileType["REUSABLE_TEST_CASES"] = "REUSABLE_TEST_CASES";
|
|
27
27
|
FileType["REUSABLE_TEST_CASE_STEPS"] = "REUSABLE_TEST_CASE_STEPS";
|
|
28
|
+
FileType["PLAYWRIGHT_CODE"] = "PLAYWRIGHT_CODE";
|
|
28
29
|
})(FileType || (FileType = {}));
|
|
29
30
|
export var SuiteType;
|
|
30
31
|
(function (SuiteType) {
|