@skyramp/mcp 0.4.3 → 0.4.4-rc.2
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/build/index.js +239 -210
- package/build/playwright/PlaywrightTraceService.d.ts +1 -1
- package/build/playwright/blueprintDigestStore.d.ts +1 -1
- package/build/playwright/registerPlaywrightTools.d.ts +1 -1
- package/build/playwright/traceRecordingPrompt.d.ts +1 -1
- package/build/playwright/traceRecordingPrompt.js +4 -3
- package/build/prompts/local-dev/local-dev-prompts.d.ts +1 -1
- package/build/prompts/local-dev/local-dev-prompts.js +2 -2
- package/build/prompts/orderAssertionRule.d.ts +9 -0
- package/build/prompts/orderAssertionRule.js +9 -0
- package/build/prompts/startTraceCollectionPrompts.d.ts +1 -1
- package/build/prompts/startTraceCollectionPrompts.js +2 -3
- package/build/prompts/test-maintenance/driftAnalysisShared.js +2 -0
- package/build/prompts/test-recommendation/registerRecommendTestsPrompt.d.ts +1 -1
- package/build/prompts/test-recommendation/registerRecommendTestsPrompt.js +2 -2
- package/build/prompts/testbot/testbot-prompts.d.ts +1 -1
- package/build/prompts/testbot/testbot-prompts.js +9 -9
- package/build/recommendation/answers.d.ts +3 -3
- package/build/recommendation/answers.js +3 -2
- package/build/recommendation/verifierContracts.d.ts +4 -4
- package/build/recommendation/verifierContracts.js +6 -5
- package/build/recommendation/verifiers/coverage.js +25 -25
- package/build/recommendation/verifiers/deliveredMatchesPlan.js +3 -3
- package/build/resources/analysisResources.d.ts +1 -1
- package/build/resources/analysisResources.js +1 -1
- package/build/resources/progressResource.d.ts +1 -1
- package/build/resources/sutSetupResource.d.ts +1 -1
- package/build/resources/sutSetupResource.js +1 -1
- package/build/resources/testbotResource.d.ts +1 -1
- package/build/resources/testbotResource.js +1 -1
- package/build/services/AnalyticsService.d.ts +1 -1
- package/build/services/FleetExecutionService.d.ts +130 -0
- package/build/services/FleetExecutionService.js +391 -0
- package/build/services/ModularizationService.d.ts +1 -1
- package/build/services/TestExecutionService.d.ts +7 -0
- package/build/services/TestExecutionService.js +21 -0
- package/build/services/TestGenerationService.d.ts +1 -1
- package/build/tool-phases.js +2 -0
- package/build/tools/auth/loginTool.d.ts +1 -1
- package/build/tools/auth/loginTool.js +2 -2
- package/build/tools/auth/logoutTool.d.ts +1 -1
- package/build/tools/auth/logoutTool.js +2 -2
- package/build/tools/code-refactor/alignAssertionsTool.d.ts +1 -1
- package/build/tools/code-refactor/alignAssertionsTool.js +1 -1
- package/build/tools/code-refactor/assertionSkillTools.d.ts +1 -1
- package/build/tools/code-refactor/assertionSkillTools.js +2 -2
- package/build/tools/code-refactor/codeReuseTool.d.ts +1 -1
- package/build/tools/code-refactor/codeReuseTool.js +2 -2
- package/build/tools/code-refactor/enhanceAssertionsTool.d.ts +1 -1
- package/build/tools/code-refactor/enhanceAssertionsTool.js +1 -1
- package/build/tools/code-refactor/modularizationTool.d.ts +1 -1
- package/build/tools/code-refactor/modularizationTool.js +2 -2
- package/build/tools/enrichTestWithMocksTool.d.ts +1 -1
- package/build/tools/enrichTestWithMocksTool.js +2 -2
- package/build/tools/executeFleetTool.d.ts +28 -0
- package/build/tools/executeFleetTool.js +107 -0
- package/build/tools/executeSkyrampTestTool.d.ts +8 -5
- package/build/tools/executeSkyrampTestTool.js +13 -5
- package/build/tools/fixErrorTool.d.ts +1 -1
- package/build/tools/fixErrorTool.js +1 -1
- package/build/tools/generate-tests/batchMockGenerationTool.d.ts +6 -57
- package/build/tools/generate-tests/batchMockGenerationTool.js +3 -3
- package/build/tools/generate-tests/generateBatchScenarioRestTool.d.ts +9 -45
- package/build/tools/generate-tests/generateBatchScenarioRestTool.js +29 -11
- package/build/tools/generate-tests/generateContractRestTool.d.ts +1 -2
- package/build/tools/generate-tests/generateContractRestTool.js +1 -1
- package/build/tools/generate-tests/generateE2ERestTool.d.ts +2 -2
- package/build/tools/generate-tests/generateE2ERestTool.js +10 -2
- package/build/tools/generate-tests/generateFuzzRestTool.d.ts +1 -1
- package/build/tools/generate-tests/generateFuzzRestTool.js +1 -1
- package/build/tools/generate-tests/generateIntegrationRestTool.d.ts +1 -2
- package/build/tools/generate-tests/generateIntegrationRestTool.js +1 -1
- package/build/tools/generate-tests/generateLoadRestTool.d.ts +1 -2
- package/build/tools/generate-tests/generateLoadRestTool.js +2 -1
- package/build/tools/generate-tests/generateMockRestTool.d.ts +1 -2
- package/build/tools/generate-tests/generateMockRestTool.js +3 -3
- package/build/tools/generate-tests/generateSmokeRestTool.d.ts +1 -1
- package/build/tools/generate-tests/generateSmokeRestTool.js +1 -1
- package/build/tools/generate-tests/generateUILoadRestTool.d.ts +64 -0
- package/build/tools/generate-tests/generateUILoadRestTool.js +512 -0
- package/build/tools/generate-tests/generateUIRestTool.d.ts +8 -7
- package/build/tools/generate-tests/generateUIRestTool.js +10 -2
- package/build/tools/generate-tests/loadTestSchema.d.ts +15 -15
- package/build/tools/generate-tests/trace-reuse-guard.d.ts +1 -1
- package/build/tools/generateEnrichedIntegrationTestTool.d.ts +1 -2
- package/build/tools/generateEnrichedIntegrationTestTool.js +1 -1
- package/build/tools/localDevWorkerComposeTool.d.ts +1 -1
- package/build/tools/localDevWorkerComposeTool.js +2 -2
- package/build/tools/one-click/oneClickTool.d.ts +1 -1
- package/build/tools/one-click/oneClickTool.js +1 -1
- package/build/tools/preflightMockCheckTool.d.ts +1 -1
- package/build/tools/preflightMockCheckTool.js +3 -3
- package/build/tools/queryProxyMocksTool.d.ts +1 -1
- package/build/tools/queryProxyMocksTool.js +3 -3
- package/build/tools/submitReportTool.d.ts +111 -414
- package/build/tools/submitReportTool.js +88 -38
- package/build/tools/test-management/actionsTool.d.ts +1 -1
- package/build/tools/test-management/actionsTool.js +7 -7
- package/build/tools/test-management/analyzeChangesTool.d.ts +22 -118
- package/build/tools/test-management/analyzeChangesTool.js +4 -4
- package/build/tools/test-management/analyzeTestHealthTool.d.ts +1 -1
- package/build/tools/test-management/analyzeTestHealthTool.js +4 -4
- package/build/tools/test-management/registerTestPlanTool.d.ts +107 -733
- package/build/tools/test-management/registerTestPlanTool.js +12 -12
- package/build/tools/test-management/resolveScreenTool.d.ts +1 -1
- package/build/tools/test-management/resolveScreenTool.js +6 -2
- package/build/tools/trace/startTraceCollectionTool.d.ts +1 -1
- package/build/tools/trace/startTraceCollectionTool.js +4 -4
- package/build/tools/trace/stopTraceCollectionTool.d.ts +1 -1
- package/build/tools/trace/stopTraceCollectionTool.js +2 -2
- package/build/tools/verifyTestDependenciesTool.d.ts +1 -1
- package/build/tools/verifyTestDependenciesTool.js +1 -1
- package/build/tools/workspace/initScanWorkspaceTool.d.ts +1 -1
- package/build/tools/workspace/initScanWorkspaceTool.js +1 -1
- package/build/tools/workspace/initializeWorkspaceTool.d.ts +1 -1
- package/build/tools/workspace/initializeWorkspaceTool.js +1 -1
- package/build/types/RepositoryAnalysis.d.ts +164 -1170
- package/build/types/RepositoryAnalysis.js +12 -10
- package/build/types/StepMethod.d.ts +24 -1
- package/build/types/StepMethod.js +1 -1
- package/build/types/TestTypes.d.ts +41 -133
- package/build/types/TestTypes.js +25 -3
- package/build/types/TestbotReport.d.ts +4 -1
- package/build/utils/assertion-verify/metrics.js +12 -0
- package/build/utils/docker.d.ts +29 -7
- package/build/utils/docker.js +83 -27
- package/build/utils/findUp.d.ts +20 -0
- package/build/utils/findUp.js +59 -0
- package/build/utils/initAgent.d.ts +3 -3
- package/build/utils/initAgent.js +58 -26
- package/build/utils/language-helper.js +1 -1
- package/build/utils/progress.d.ts +3 -4
- package/build/utils/progress.js +4 -4
- package/build/utils/repoSdkVersion.d.ts +16 -0
- package/build/utils/repoSdkVersion.js +88 -0
- package/build/utils/testDependencyPolicy.d.ts +20 -0
- package/build/utils/testDependencyPolicy.js +64 -4
- package/build/utils/utils-verify/typecheck.js +3 -18
- package/build/utils/utils.d.ts +1 -1
- package/build/utils/versions.d.ts +3 -3
- package/build/utils/versions.js +1 -1
- package/build/workspace/workspace.d.ts +117 -538
- package/build/workspace/workspace.js +2 -2
- package/node_modules/playwright/lib/mcp/skyramp/assertOrder.js +66 -0
- package/node_modules/playwright/lib/mcp/skyramp/assertTool.js +12 -3
- package/node_modules/playwright/lib/mcp/skyramp/common/liveReadError.js +40 -0
- package/node_modules/playwright/lib/mcp/skyramp/loadTraceTool.js +21 -0
- package/node_modules/playwright/lib/mcp/skyramp/skyRampImport.js +2 -1
- package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +96 -16
- package/node_modules/playwright/lib/mcp/test/skyRampExport.js +10 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/server/codegen/skyramp/jsonlReader.js +1 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +22 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/utils/isomorphic/elementOrder.js +57 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/utils.js +2 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{index.uiPTFncY.js → index.0MJW0uG7.js} +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.html +1 -1
- package/node_modules/playwright/node_modules/playwright-core/package.json +1 -1
- package/node_modules/playwright/node_modules/playwright-core/src/server/codegen/skyramp/jsonlReader.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/src/server/recorder/recorderRunner.ts +26 -1
- package/node_modules/playwright/node_modules/playwright-core/src/utils/isomorphic/elementOrder.ts +83 -0
- package/node_modules/playwright/node_modules/playwright-core/src/utils.ts +1 -0
- package/node_modules/playwright/package.json +1 -1
- package/package.json +9 -6
- package/plugin/prompts/plan-tests.md +9 -17
- package/plugin/skills/enhance-assertions/reference/shared-rules.md +1 -1
- package/plugin/skills/enhance-assertions/reference/ui.md +2 -2
- package/plugin/skills/fix-test-import-errors/SKILL.md +1 -1
- package/plugin/skills/repair-staged-files/SKILL.md +17 -0
package/node_modules/playwright/node_modules/playwright-core/src/utils/isomorphic/elementOrder.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// SKYR-4544: the one definition of an order assertion ("A starts before B on an
|
|
18
|
+
// axis"). The MCP recorder, the MCP trace export and seeding, the MCP trace
|
|
19
|
+
// replay and the core recorder replay all use it, so record and replay cannot
|
|
20
|
+
// drift apart. (The generated test's comparison lives in the Go codegen, which
|
|
21
|
+
// cannot import this; its goldens and the live demoshop check pin it.)
|
|
22
|
+
|
|
23
|
+
/** Where the asserted element sits relative to the other one. */
|
|
24
|
+
export const ORDER_RELATIONS = ['left-of', 'right-of', 'above', 'below'] as const;
|
|
25
|
+
export type OrderRelation = typeof ORDER_RELATIONS[number];
|
|
26
|
+
|
|
27
|
+
export function isOrderRelation(value: unknown): value is OrderRelation {
|
|
28
|
+
return typeof value === 'string' && (ORDER_RELATIONS as readonly string[]).includes(value);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The part of a box the comparison reads: its origin. */
|
|
32
|
+
export type OrderBox = { x: number, y: number };
|
|
33
|
+
|
|
34
|
+
export type OrderResult = {
|
|
35
|
+
ok: boolean,
|
|
36
|
+
/** x for left-of/right-of, y for above/below. */
|
|
37
|
+
axis: 'x' | 'y',
|
|
38
|
+
edgeA: number,
|
|
39
|
+
edgeB: number,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Whether `a` is `relation` of `b`: each box's origin — the left edge (x) for
|
|
44
|
+
* left-of/right-of, the top edge (y) for above/below — compared strictly. It
|
|
45
|
+
* says where each element STARTS, not that one lies wholly beyond the other,
|
|
46
|
+
* and equal edges never hold.
|
|
47
|
+
*/
|
|
48
|
+
export function orderHolds(relation: OrderRelation, a: OrderBox, b: OrderBox): OrderResult {
|
|
49
|
+
const axis = relation === 'left-of' || relation === 'right-of' ? 'x' : 'y';
|
|
50
|
+
const edgeA = a[axis];
|
|
51
|
+
const edgeB = b[axis];
|
|
52
|
+
const ok = relation === 'left-of' || relation === 'above' ? edgeA < edgeB : edgeA > edgeB;
|
|
53
|
+
return { ok, axis, edgeA, edgeB };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type OrderFields = {
|
|
57
|
+
selector: string,
|
|
58
|
+
otherSelector: string,
|
|
59
|
+
relation: OrderRelation,
|
|
60
|
+
locator?: object,
|
|
61
|
+
otherLocator?: object,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The fields of an order assertion — a JSONL `assertOrder` line or a recorded
|
|
66
|
+
* browser_assert type "order" action's args — or null when it is malformed (no
|
|
67
|
+
* selector, no other end, or a relation outside ORDER_RELATIONS). Export, seeding
|
|
68
|
+
* and both replays parse through this, so they accept and drop exactly the same
|
|
69
|
+
* lines.
|
|
70
|
+
*/
|
|
71
|
+
export function parseOrderFields(raw: any): OrderFields | null {
|
|
72
|
+
if (!raw || typeof raw !== 'object')
|
|
73
|
+
return null;
|
|
74
|
+
const { selector, otherSelector, relation, locator, otherLocator } = raw;
|
|
75
|
+
if (typeof selector !== 'string' || !selector || typeof otherSelector !== 'string' || !otherSelector || !isOrderRelation(relation))
|
|
76
|
+
return null;
|
|
77
|
+
const fields: OrderFields = { selector, otherSelector, relation };
|
|
78
|
+
if (locator && typeof locator === 'object')
|
|
79
|
+
fields.locator = locator;
|
|
80
|
+
if (otherLocator && typeof otherLocator === 'object')
|
|
81
|
+
fields.otherLocator = otherLocator;
|
|
82
|
+
return fields;
|
|
83
|
+
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
export * from './utils/isomorphic/ariaSnapshot';
|
|
18
18
|
export * from './utils/isomorphic/assert';
|
|
19
19
|
export * from './utils/isomorphic/colors';
|
|
20
|
+
export * from './utils/isomorphic/elementOrder';
|
|
20
21
|
export * from './utils/isomorphic/headers';
|
|
21
22
|
export * from './utils/isomorphic/locatorGenerators';
|
|
22
23
|
export * from './utils/isomorphic/locatorParser';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyramp/mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4-rc.2",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./build/index.js",
|
|
@@ -69,19 +69,21 @@
|
|
|
69
69
|
"url": "https://github.com/skyramp/mcp/issues"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@modelcontextprotocol/
|
|
72
|
+
"@modelcontextprotocol/client": "^2.0.0",
|
|
73
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
73
74
|
"@playwright/test": "^1.55.0",
|
|
74
|
-
"@skyramp/skyramp": "1.3.
|
|
75
|
+
"@skyramp/skyramp": "1.3.50",
|
|
75
76
|
"dockerode": "^5.0.0",
|
|
76
77
|
"fast-glob": "^3.3.3",
|
|
77
78
|
"js-yaml": "^4.1.1",
|
|
78
79
|
"picomatch": "^4.0.5",
|
|
79
|
-
"playwright": "file:vendor/skyramp-playwright-1.58.2-skyramp.8.14.
|
|
80
|
+
"playwright": "file:vendor/skyramp-playwright-1.58.2-skyramp.8.14.14.tgz",
|
|
81
|
+
"semver": "^7.8.5",
|
|
80
82
|
"simple-git": "^3.30.0",
|
|
81
83
|
"smol-toml": "^1.8.0",
|
|
82
84
|
"ts-is-record": "^3.0.5",
|
|
83
85
|
"typescript": "^5.8.3",
|
|
84
|
-
"zod": "^
|
|
86
|
+
"zod": "^4.2.0"
|
|
85
87
|
},
|
|
86
88
|
"devDependencies": {
|
|
87
89
|
"@types/dockerode": "^3.3.39",
|
|
@@ -90,6 +92,7 @@
|
|
|
90
92
|
"@types/mocha": "^10.0.10",
|
|
91
93
|
"@types/node": "^22.15.19",
|
|
92
94
|
"@types/picomatch": "^4.0.3",
|
|
95
|
+
"@types/semver": "^7.8.0",
|
|
93
96
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
94
97
|
"@typescript-eslint/parser": "^8.0.0",
|
|
95
98
|
"eslint": "^9.0.0",
|
|
@@ -98,6 +101,6 @@
|
|
|
98
101
|
"ts-jest": "^29.3.4"
|
|
99
102
|
},
|
|
100
103
|
"engines": {
|
|
101
|
-
"node": ">=
|
|
104
|
+
"node": ">=22"
|
|
102
105
|
}
|
|
103
106
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
## Terms
|
|
5
5
|
|
|
6
|
-
You decide what to test.
|
|
6
|
+
You decide what to test.
|
|
7
7
|
|
|
8
8
|
A **change** is one thing the pull request should make happen, or reject, for a user or a caller. Say on each change whether it is on the API, on a page, or both.
|
|
9
9
|
|
|
10
|
-
A **behaviour** is one rule about one endpoint or one page. One change can carry two behaviours, one on the API and one on the page. A test may prove several behaviours. Every behaviour has at least one test that proves it. Rejections the application already handles share one test, one test case each
|
|
10
|
+
A **behaviour** is one rule about one endpoint or one page. One change can carry two behaviours, one on the API and one on the page. A test may prove several behaviours. Every behaviour has at least one test that proves it. Rejections the application already handles share one test, one test case each.
|
|
11
11
|
|
|
12
12
|
## The procedure
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ Do the steps in this order.
|
|
|
18
18
|
3. **Write the changes.** List every change, one line each, with a short id and where you read it. Write the list in your reply before you go on.
|
|
19
19
|
Keep each line through the rest of the procedure. Do not fold a change into another one or drop it because no test covers it.
|
|
20
20
|
For each edit in the diff, write one line: what it makes different for a user or a caller.
|
|
21
|
-
For each requirement the title, the description or a requirements file states, write one line, even when no edit in the diff serves it.
|
|
21
|
+
For each requirement the title, the description or a requirements file states, write one line, even when no edit in the diff serves it.
|
|
22
22
|
4. **Declare the test cases each request must refuse.**
|
|
23
23
|
- For each input a request takes, declare one test case with a value the request must reject. Declare it even when the code does not reject that value today.
|
|
24
24
|
- For each list a request takes, declare one test case that is valid except for one item in the list. Give the test case one `param` and one `value`: the invalid item. The step that sends the test case carries the rest of the list.
|
|
@@ -27,33 +27,25 @@ Do the steps in this order.
|
|
|
27
27
|
- For each state a record can be in that the request must refuse, declare one test case that puts the record in that state first and then sends the request.
|
|
28
28
|
- A request that names a record by id, in the path, in a query parameter, or in the body, must reject a record that does not exist or does not belong to the parent.
|
|
29
29
|
- A record that belongs to another user is its own test case, even when the answer is the same.
|
|
30
|
-
- For each rule the pull request states, declare the test cases that catch a wrong implementation: each bound, one value past each bound, one value far past a bound, and each value the rule forbids. Take their values from the rule, not from an example.
|
|
30
|
+
- For each rule the pull request states, declare the test cases that catch a wrong implementation: each bound, one value past each bound, one value far past a bound, and each value the rule forbids. Take their values from the rule, not from an example. If an input accepts only values from a list, declare an accept test case for every value in it, even when the values share code or make the test long.
|
|
31
31
|
- A reject test case expects the request to be refused and the record to be unchanged. Declare an exact status code or error text only when the pull request or a requirements file states it.
|
|
32
32
|
5. **Declare what each response value must be.**
|
|
33
33
|
- For each value the response carries that this change decides, declare what that value must be and where you read it: the pull request title or description, a requirements file the description names, or a rule the application already follows in code this pull request did not change.
|
|
34
34
|
- Quote a value only when it holds for every input the test case can send: a fixed constant, a bound, or one of the allowed names. A value the inputs decide is `derived`, even when the source shows it in an example.
|
|
35
|
-
- If no source states the value, declare none and assert its shape instead.
|
|
36
35
|
- Never take the value from the running application: that is the one source a defect cannot contradict.
|
|
37
36
|
6. **Find where each change is served.** Read the code that declares routes and pages, and write each route's full path with its mount prefix. Follow the callers of a changed file that has no route of its own to the endpoint or page that runs it. Read the code that writes each stored value the new code reads; any rule on that value is a rejection to list.
|
|
38
|
-
7. **Review the code that serves each change.** Read the handler and the functions it calls to read or write data. For a changed screen, read the component and what it calls. Read these files even when the diff does not contain them; a defect often sits in the code the change depends on. Write each defect as one line with an id, the file, the line, and what is wrong. Write the list in your reply before you go on. An empty list is a statement: you read the code and found nothing.
|
|
39
|
-
- A computed field that is not recalculated after a mutation, such as `total_amount` unchanged after items are added or removed
|
|
40
|
-
- Incomplete CRUD: a create with no cleanup, an update that adds new records and does not remove the old ones
|
|
41
|
-
- Missing input validation on a new endpoint
|
|
42
|
-
- A frontend rendering error visible in the code, such as an invalid prop, a missing required attribute, or a value shown without the formatting its neighbours use
|
|
43
|
-
- Incorrect arithmetic in business logic, such as a discount calculation or a price aggregation
|
|
37
|
+
7. **Review the code that serves each change.** Read the handler and the functions it calls to read or write data. For a changed screen, read the component and what it calls. Read these files even when the diff does not contain them; a defect often sits in the code the change depends on. Write each defect as one line with an id, the file, the line, and what is wrong. Write the list in your reply before you go on. An empty list is a statement: you read the code and found nothing.
|
|
44
38
|
8. **Read the existing tests that reach a change.** The analysis lists the repository's test files. Read the ones that import a changed file, call a changed route, or open a changed page.
|
|
45
39
|
9. **Group the changes into behaviours and decide each.** A planned test names every change it covers. A change gets no test only when a test already in the repository proves it; the size of the edit or the kind of file is never a reason. A change no behaviour needs gets one sentence that says why.
|
|
46
|
-
When the test that proves a change is one you are editing, declare that test in `maintains` and name the changes it covers. Those changes are then covered and get no planned test of their own
|
|
47
|
-
A requirement the title, the description or a named requirements file states and the code does not meet is a defect; its file is the code that contradicts it. A defect gets a planned test that names it in `defects` and expects to fail.
|
|
40
|
+
When the test that proves a change is one you are editing, or one you will run unchanged as a VERIFY, declare that test in `maintains` and name the changes it covers. Those changes are then covered and get no planned test of their own.
|
|
41
|
+
A requirement the title, the description or a named requirements file states and the code does not meet is a defect; its file is the code that contradicts it. A defect gets a planned test that names it in `defects` and expects to fail. If a test you ran unchanged as a VERIFY failed on the defect, name the defect in that test's `maintains` entry instead; the defect then needs no planned test. A defect gets no test only when something stopped the test: say what.
|
|
48
42
|
If a state comes from time passing, create the record with the nearest allowed deadline and wait for it.
|
|
49
43
|
10. **Walk each page behaviour once, as its test will run.** Start at login, do the steps of the behaviour, run `browser_blueprint` on each page you use, and export the trace when the flow ends. Name only elements from those captures. Do not try other values or read messages; the recording is the test.
|
|
50
|
-
11. **Declare each planned test.**
|
|
44
|
+
11. **Declare each planned test.**
|
|
51
45
|
- A test that expects a rejection sends an accepted request first. That request is the test's setup.
|
|
52
|
-
- Two planned tests on one endpoint each say how they differ.
|
|
53
46
|
- A test that expects to fail proves one test case: its first assertion after setup is the one the defect breaks, and a red step stops every step after it. Declare one such test per test case the defect breaks, so each test case reports on its own.
|
|
54
47
|
- Accepted test cases may share one test that expects to pass.
|
|
55
|
-
|
|
56
|
-
12. **Register the whole plan in one call to `skyramp_register_test_plan`.** The call carries `changes`, `defects` and `plannedTests`.
|
|
48
|
+
12. **Register the whole plan in one call to `skyramp_register_test_plan`.**
|
|
57
49
|
13. **Answer each objection, or change the plan and register it again.**
|
|
58
50
|
An answer that says a state cannot be produced says what you tried.
|
|
59
51
|
14. **Stop when every objection has an answer.** Disagreeing in the answer closes it too.
|
|
@@ -26,7 +26,7 @@ Apply only to new test functions you are adding and existing test functions affe
|
|
|
26
26
|
|
|
27
27
|
Before editing `$2`, you must output a `<thinking>` block. It states the behaviour each test evaluates, then works through the rules for the responses that behaviour depends on, so no rule that applies is overlooked. The JSON array must match the `rule_checklist` template that accompanies the `$0` rules. Use the template's keys verbatim; each key is the slug shown in that rule's heading. Every key must appear — `[]` where the rule does not apply.
|
|
28
28
|
|
|
29
|
-
1. For each test function in scope, name the behaviour it evaluates in one line, taken from the recommendation it came from.
|
|
29
|
+
1. For each test function in scope, name the behaviour it evaluates in one line, taken from the recommendation it came from. A generated test function may carry a name that states its behaviour — trust that name when it does. A function still named `test_integration` or `testUi` claims nothing, so use the name only when it is specific enough to add something, and never treat a generic one as evidence the test has no single behaviour. Then scan `$2` and the expected responses for the code change tested.
|
|
30
30
|
2. Classify each response first by its response status type and then assign the applicable assertion rules to the response.
|
|
31
31
|
- Success with body (2xx with a response body): all assertion rules below may apply — echo-back of request fields, computed response fields, array / items validation, and chained values across steps.
|
|
32
32
|
- Success with no body (200/202/204 with an empty body — e.g. logout/cancel/submit action endpoints): assert the status code only. Also apply chained-values rules if a follow-up step uses this response's ID.
|
|
@@ -126,7 +126,7 @@ if (await existingSecret.isVisible().catch(() => false)) {
|
|
|
126
126
|
|
|
127
127
|
Before editing `$2`, you must output a `<thinking>` block. It states the behaviour each test evaluates, then works through the rules for the items that behaviour depends on, so no rule that applies is overlooked. The JSON array should match the template below — every assertion category and every rule title under it must appear as a key, with `[]` where the rule does not apply.
|
|
128
128
|
|
|
129
|
-
1. For each test in scope, name the behaviour it evaluates in one line, taken from the recommendation it came from, and name the page where that behaviour shows.
|
|
129
|
+
1. For each test in scope, name the behaviour it evaluates in one line, taken from the recommendation it came from, and name the page where that behaviour shows. A generated spec may carry a title that names its behaviour — trust that title when it does. A spec still named `testUi` claims nothing, so use the name only when it is specific enough to add something.
|
|
130
130
|
2. Selector inventory — list every selector already present in `$2` (`data-testid`, role + name, text, label, etc.). New assertions may use only selectors from this list. An assertion the recorder dropped because it failed during recording may use the selector of the element named in that recording's blueprint capture. Do not invent `data-testid` values, role names, or aria attributes. Also note captured network responses, repeated element patterns, exact rendered text/value/attribute from trace/source, and existing `toBeVisible()` assertions whose exact text is knowable.
|
|
131
131
|
3. Process — Replay → Identify → Fix or Add — walk through these three steps explicitly.
|
|
132
132
|
a. Replay the scenario mentally. At each state-changing action (form submit, item add/edit/delete), ask: "What is the EXPECTED outcome based on the action performed?"
|
|
@@ -206,7 +206,7 @@ expect(trigger).to_be_focused()
|
|
|
206
206
|
When the PR changes how an element looks or where it sits (colour, class, size, `flex-direction`, a moved block), assert the changed property on the element that OWNS it — `flex-direction` belongs to the flex container, not the clicked child, and an order check needs both compared elements. Use a selector already in the file; if the owner has none, report a recording gap in your `<thinking>` block — do not invent one or screenshot it.
|
|
207
207
|
|
|
208
208
|
- Colour / class: a class assertion recorded at capture is already written as a bounded regex (`toHaveClass(/(^|\s)bg-blue-600(\s|$)/)`) — leave it as generated. Use `toContainClass('bg-blue-600')` only for a class assertion you add yourself (1.52+; it matches one token, unlike a bare `/bg-blue-600/` which also passes on `hover:bg-blue-600`). For a style, `toHaveCSS('background-color', <the value the app computes>)` — take it from the app, do not convert the diff's hex: Tailwind v4 serializes `oklch(...)`, not `rgb(...)`.
|
|
209
|
-
- Order:
|
|
209
|
+
- Order: an order assertion recorded at capture (`browser_assert` type `order`) is already in the file as two `boundingBox()` reads compared on one axis (inside `expect(async () => …).toPass()` in TS/JS) — leave it as generated. When none was recorded, add that comparison on the changed axis (holds for `flex-direction` / `order` / `dir` / grid / reordered markup): wait for both elements, read each one's box (`const aBox = await a.boundingBox()`), then compare the boxes' `x` (left/right) or `y` (above/below), e.g. `expect(aBox.x).toBeLessThan(bBox.x)` for "a left of b" — a locator itself has no `.x`; `toHaveCSS('flex-direction', 'row-reverse')` only when the container is `display: flex` with an unconditional class.
|
|
210
210
|
- Size: `toHaveCSS('width', <the computed width>)`. Name the value; never copy a `...` or `/…/` placeholder.
|
|
211
211
|
|
|
212
212
|
A `toHaveScreenshot()` baseline is right only for a look no property expresses (image, gradient, chart) or to refresh an already-committed baseline (SKYR-4298) — never a new one for a colour, class or order change.
|
|
@@ -56,7 +56,7 @@ python3 -m robot <robot-file>.robot
|
|
|
56
56
|
|
|
57
57
|
Inspect package.json before installing anything:
|
|
58
58
|
|
|
59
|
-
- If a required package is already declared, install from the existing manifest without changing its version.
|
|
59
|
+
- If a required package is already declared, install from the existing manifest without changing its version, unless `skyramp_execute_test` refuses the run over an older Skyramp SDK. Then do what the refusal says.
|
|
60
60
|
- If no JavaScript/TypeScript manifest exists at the test project root, create `package.json` with only `{ "devDependencies": {} }` before adding the missing approved package.
|
|
61
61
|
- If an approved package is missing, add it with the repository's package manager as a devDependency. For npm, use `npm install --save-dev --legacy-peer-deps <package>`.
|
|
62
62
|
- Never add, upgrade, or downgrade Playwright or @playwright/test when either is already declared. If its version is incompatible with Skyramp, report the conflict.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repair-staged-files
|
|
3
|
+
description: Get the files a Testbot run created or modified ready to commit under the target repo's own standards — lint, format, typecheck, naming, CI, dependencies, commit message and PR title, credential safety. Use once, after all generation, maintenance, and execution are done, before the report is submitted.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Repair staged files
|
|
7
|
+
|
|
8
|
+
**Goal:** the files this run created or modified are ready to deliver: `git commit` passes the repo's hooks, and the PR passes the repo's own checks. Find the staged and unstaged changed files with git commands.
|
|
9
|
+
|
|
10
|
+
1. **Lint and format.** Find the repo's linter, formatter, type checker, and every commit hook — husky, lint-staged, the pre-commit framework, or a plain script — wherever git runs them from. The files and planned commit message must pass each. Hooks check only staged files; one that checked none of them has not passed. Run them on the files and fix every violation; a formatter's rewrite is the fix. Where a hook fails on warnings (`--max-warnings=0`), fix warnings too. `.editorconfig` and `.gitattributes` apply to every file. A tool applies per file, by that file's language, the repo's own included. Re-run until clean; record the command.
|
|
11
|
+
2. **Conventions.** A new file must match the repo's test naming and directory convention (see existing tests and runner config). Fix a mismatch by renaming or moving the new file, and update every reference to it, the report included. Edit a maintained test in place; never rename or move it.
|
|
12
|
+
3. **CI readiness.** Confirm CI will run the new files; if not, name the change the author must make — a note, not a blocker.
|
|
13
|
+
4. **Dependencies.** Declare every package a test imports in the right manifest, and update its lockfile; both ship with the tests. For an import that does not resolve, use the `fix-test-import-errors` skill.
|
|
14
|
+
5. **Commit and PR text.** Find every rule the repo applies to commit messages and PR titles, wherever it is defined; write both to satisfy all of it, and check them with the repo's own tool where one exists. Only when the repo has none, use "Skyramp Testbot: <concise>". Keep each within 72 characters, and add a body summarizing the tests added and maintained, naming the CODEOWNERS team and covering the PR template.
|
|
15
|
+
- DCO (Developer Certificate of Origin) sign-off is a `Signed-off-by: Skyramp Testbot <test-bot@skyramp.dev>` trailer in the commit message. Add it only when a CI check or the contributing docs require it. It is not a cryptographic signature: do not GPG- or SSH-sign the commit.
|
|
16
|
+
|
|
17
|
+
Re-run any test you edit; its outcome must not change. Never weaken or remove an assertion, and never edit the repo's lint, format, or runner config, disable a rule, or add an ignore comment (`# noqa`, `eslint-disable`) to make a file pass. No real secret in a delivered file, the report, or the PR comment — that path skips every hook. If a finding can't be fixed without breaking these rules, stop and say what blocks the commit.
|