@skyramp/mcp 0.0.21 → 0.0.22
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,35 +3,38 @@ export function getModularizationPrompt(filePath, language) {
|
|
|
3
3
|
**CRITICAL: Refactor code with modularization principles. Respond with complete, modularized code only WITHOUT ERRORS AND WRITTEN BACK TO THE FILE ${filePath}**
|
|
4
4
|
|
|
5
5
|
**CRITICAL: DO NOT CHANGE THE FUNCTIONALITY OF THE TESTS. ONLY MODULARIZE THE CODE.**
|
|
6
|
+
|
|
7
|
+
**ABSOLUTELY FORBIDDEN: DO NOT CREATE ANY INTERFACES, CLASSES, TYPES, OR NEW DATA STRUCTURES. USE INLINE TYPES ONLY.**
|
|
8
|
+
|
|
6
9
|
Only if NO existing function can be reused:
|
|
7
10
|
1. Group related lines logically (e.g., login steps together) to improve readability and parameterize the test function(s) with meaningful parameters to make it more flexible.
|
|
8
11
|
2. If functions are already modularized (like breakpoint_section_0, breakpoint_section_1), then rename them with meaningful names WITHOUT ANY OTHER CHANGES.
|
|
9
12
|
3. KEEP CHANGES TO A MINIMUM. DO NOT MODIFY THE FUNCTIONALITY OF THE TESTS. ONLY MODULARIZE THE CODE.
|
|
10
13
|
4. Parameterize the test function(s) with meaningful parameters to make it more flexible. Preserve the original order of code lines within each function.
|
|
11
|
-
5. Only extract reusable logical sections into helper functions
|
|
12
|
-
6.
|
|
13
|
-
|
|
14
|
-
**EXECUTION CHECKLIST - YOU MUST COMPLETE EACH:**
|
|
15
|
-
- [ ] STEP 1: Searched for existing files using grep_search or file_search
|
|
16
|
-
- [ ] STEP 2: Found reusable functions and imported them at the top of the file
|
|
17
|
-
- [ ] STEP 3: Replaced duplicate code with imported function calls
|
|
18
|
-
- [ ] STEP 4: Created minimal new helpers only where needed
|
|
19
|
-
- [ ] Verified import paths are correct
|
|
20
|
-
- [ ] Verified original functionality is maintained
|
|
14
|
+
5. Only extract reusable logical sections into helper functions. Use inline parameter types instead of creating interfaces or type definitions.
|
|
15
|
+
6. **If extracting UI operations, ensure each helper function is self-contained** and leaves the UI in a clean state for the next operation WITHOUT UPDATING THE LOGIC OF THE TESTS.
|
|
21
16
|
|
|
22
|
-
**CRITICAL
|
|
17
|
+
**CRITICAL CONSTRAINTS:**
|
|
18
|
+
- NO interfaces, classes, types, or data structures
|
|
19
|
+
- NO new test cases or logic
|
|
20
|
+
- NO additional files
|
|
21
|
+
- ONLY helper functions with inline types
|
|
22
|
+
- PRESERVE original functionality exactly
|
|
23
23
|
|
|
24
|
-
**CRITICAL: FIX ERRORS IN MODULARIZED CODE USING skyramp_fix_errors TOOL**
|
|
24
|
+
**CRITICAL: If you skip any step, the modularization is incomplete. You MUST complete all steps before proceeding.FIX ERRORS IN MODULARIZED CODE USING skyramp_fix_errors TOOL**
|
|
25
25
|
`;
|
|
26
26
|
}
|
|
27
27
|
export function getFixErrorsPrompt() {
|
|
28
28
|
return `
|
|
29
29
|
**Fix errors in refactored code.**
|
|
30
30
|
|
|
31
|
-
1. **Parameter Passing:** Identify functions using variables from outside scope (like
|
|
31
|
+
1. **Parameter Passing:** Identify functions using variables from outside scope (like 'page' object). Pass these as parameters.
|
|
32
32
|
2. **Validate Correctness:** Ensure code is free of reference errors, undefined variables, runtime issues.
|
|
33
33
|
3. **Import Paths:** Ensure import paths are correct and there are no circular imports.
|
|
34
|
+
4. **UI State Management:** Check for UI state conflicts, modal interference, or element interaction issues.
|
|
35
|
+
5. **Sequential Operations:** Ensure UI operations don't interfere with each other when called in sequence.
|
|
34
36
|
|
|
35
37
|
**KEY: Variables not defined within function scope MUST be passed as parameters.**
|
|
38
|
+
**UI KEY: Helper functions that perform UI operations must be self-contained and not leave modals/dialogs open.**
|
|
36
39
|
`;
|
|
37
40
|
}
|
|
@@ -92,7 +92,7 @@ Let us generate an E2E test with backend trace file skyramp-traces.json and fron
|
|
|
92
92
|
\`\`\`
|
|
93
93
|
|
|
94
94
|
**UI TEST:**
|
|
95
|
-
- Purpose: Generate UI tests using Playwright traces
|
|
95
|
+
- Purpose: Generate UI tests using Playwright traces captured using skyramp_start_trace_collection tool
|
|
96
96
|
- Requirements: A frontend playwright trace file, test language, test framework
|
|
97
97
|
|
|
98
98
|
**Sample UI Test Prompt:**
|
|
@@ -6,7 +6,7 @@ const e2eTestSchema = {
|
|
|
6
6
|
...baseTraceSchema.shape,
|
|
7
7
|
playwrightInput: z
|
|
8
8
|
.string()
|
|
9
|
-
.describe("MUST be absolute path to the playwright input file like /path/to/playwright-ui-test.zip and MUST be a zip file"),
|
|
9
|
+
.describe("MUST be absolute path to the playwright input file like /path/to/playwright-ui-test.zip and MUST be a zip file captured using start_trace_collection tool"),
|
|
10
10
|
};
|
|
11
11
|
export class E2ETestService extends TestGenerationService {
|
|
12
12
|
getTestType() {
|
|
@@ -30,7 +30,7 @@ export function registerE2ETestTool(server) {
|
|
|
30
30
|
End-to-End tests validate complete user journeys by testing the entire application flow from frontend UI interactions to backend API responses. They ensure that all components work together correctly in realistic user scenarios, providing the highest confidence in application functionality.
|
|
31
31
|
|
|
32
32
|
TRACE & UI INTEGRATION:
|
|
33
|
-
E2E tests require both trace files (capturing backend API interactions) and Playwright recordings (capturing UI interactions) to generate comprehensive tests that validate the complete user experience.`,
|
|
33
|
+
E2E tests require both trace files (capturing backend API interactions) and Playwright recordings (capturing UI interactions captured using start_trace_collection tool) to generate comprehensive tests that validate the complete user experience.`,
|
|
34
34
|
inputSchema: e2eTestSchema,
|
|
35
35
|
annotations: {
|
|
36
36
|
keywords: ["e2e test", "end-to-end test"],
|
|
@@ -21,7 +21,7 @@ const uiTestSchema = {
|
|
|
21
21
|
...languageSchema.shape,
|
|
22
22
|
playwrightInput: z
|
|
23
23
|
.string()
|
|
24
|
-
.describe("MUST be absolute path to the playwright input file like /path/to/playwright-ui-test.zip and MUST be a zip file"),
|
|
24
|
+
.describe("MUST be absolute path to the playwright input file like /path/to/playwright-ui-test.zip and MUST be a zip file captured using start_trace_collection tool"),
|
|
25
25
|
output: baseSchema.shape.output,
|
|
26
26
|
outputDir: baseSchema.shape.outputDir,
|
|
27
27
|
force: baseSchema.shape.force,
|