@skyramp/mcp 0.2.5-rc.2 → 0.2.5-rc.3
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.
|
@@ -176,6 +176,28 @@ export function getUIAssertionsPrompt(testFile, enhanceType) {
|
|
|
176
176
|
### First Check
|
|
177
177
|
If the generated test file has no \`expect()\` assertions, you MUST manually add them before anything else. Use \`import { expect } from '@skyramp/skyramp';\` — never from \`@playwright/test\`. If an existing import pulls \`expect\` from \`@playwright/test\`, move it to \`@skyramp/skyramp\` (keep \`test\` on the playwright line).
|
|
178
178
|
|
|
179
|
+
### Flutter Web Check
|
|
180
|
+
If the test targets a Flutter web app (detected by \`flt-semantics\`, \`flt-glass-pane\`, or \`flt-semantics-placeholder\` appearing anywhere in the test file, OR if the test file navigates to a URL that served a Flutter app during recording), you MUST add the following two blocks immediately after \`page.setDefaultTimeout(pageTimeout);\` and before the \`newSkyrampPlaywrightPage\` wrap:
|
|
181
|
+
|
|
182
|
+
\`\`\`typescript
|
|
183
|
+
// Flutter headless fix: patch Event.isTrusted so synthetic clicks activate Flutter semantics
|
|
184
|
+
await page.context().addInitScript(() => {
|
|
185
|
+
Object.defineProperty(Event.prototype, 'isTrusted', { get: () => true, configurable: true });
|
|
186
|
+
});
|
|
187
|
+
\`\`\`
|
|
188
|
+
|
|
189
|
+
And immediately after **every** \`page.goto()\` call in the test, add:
|
|
190
|
+
|
|
191
|
+
\`\`\`typescript
|
|
192
|
+
// Wait for Flutter semantics tree to be fully populated before interacting
|
|
193
|
+
await page.waitForFunction(
|
|
194
|
+
() => document.querySelector('flt-semantics-host')?.children?.length > 0,
|
|
195
|
+
{ timeout: 10000 }
|
|
196
|
+
);
|
|
197
|
+
\`\`\`
|
|
198
|
+
|
|
199
|
+
This is required because Flutter web accessibility semantics are not activated by default in headless Chromium — synthetic click events are marked as untrusted and ignored by Flutter's gate. The \`isTrusted\` patch makes the click trusted; the \`waitForFunction\` after EVERY \`goto()\` ensures the ARIA tree is fully populated before any \`getByRole\` queries or \`click()\` calls run. Without both additions, Flutter interactions will time out in CI/Docker execution.
|
|
200
|
+
|
|
179
201
|
### Pre-Edit Assertion Analysis
|
|
180
202
|
Before editing the given test file, you must output a \`<thinking>\` block. The aim of the \`<thinking>\` block is to analyze each in-scope item (action, selector, or captured network response) in the given test file and output a JSON array that ensures no assertion rule is overlooked. The JSON array should match the template below — every assertion category and every rule title under it must appear as a key, even when the value is \`[]\`.
|
|
181
203
|
1. Selector inventory — list every selector already present in the generated test file (\`data-testid\`, role + name, text, label, etc.). New assertions may use only selectors from this list. 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,7 +131,7 @@ ${userPrompt ? "Generate only the tests that the user requested from the Additio
|
|
|
131
131
|
- Example: If enrichment reveals that sending \`discount_value\` without \`discount_type\` silently orphans the value (a concrete bug), complete all planned GENERATE items first, then generate this discovered scenario as an extra test and report it in \`newTestsCreated\`.
|
|
132
132
|
- Total generated: Follow the "Budget: N generate" line in the Execution Plan. Process every GENERATE-tagged item in order. Backfill from ADDITIONAL candidates (highest-ranked first) until \`newTestsCreated\` reaches ${maxGenerate} or all candidates are exhausted.
|
|
133
133
|
- **UI test priority**: If the PR scope assessment shows any UI/E2E budget OR \`uiContext.changedFrontendFiles\` is non-empty (the deterministic server signal — populated for all supported frontend file types including \`.tsx\`/\`.jsx\`/\`.vue\`/\`.svelte\`/\`.dart\`), you MUST attempt to generate at least one UI test. Use \`browser_navigate\` to the app's base URL — if the app responds, record a trace and generate the test.
|
|
134
|
-
**Flutter web apps:** Skyramp's Playwright tools automatically enable Flutter's accessibility semantics tree on every \`browser_navigate\` call — you do NOT need to manually click \`flt-semantics-placeholder\` or add any activation step to the trace. Do NOT log an \`issuesFound\` entry about Flutter canvas rendering or accessibility activation — this is handled transparently.
|
|
134
|
+
**Flutter web apps:** Skyramp's Playwright tools automatically enable Flutter's accessibility semantics tree on every \`browser_navigate\` call — you do NOT need to manually click \`flt-semantics-placeholder\` or add any activation step to the trace. Do NOT log an \`issuesFound\` entry about Flutter canvas rendering or accessibility activation — this is handled transparently. **Do NOT skip test generation or abstain from recording based on what you see in the Flutter source code** (e.g. \`SemanticsBinding.ensureSemantics()\` commented out, \`IS_TESTING\` flag absent, or similar) — Skyramp enables accessibility from the browser side regardless of the app's Dart code. Proceed with \`browser_navigate\` and test recording as normal.
|
|
135
135
|
**Skip only if one of these conditions is met:**
|
|
136
136
|
- **(a) App is unreachable** — \`browser_navigate\` fails or connection is refused.
|
|
137
137
|
- **(b) Unintegrated non-route component** — the changed file is a leaf component (not a framework route/entrypoint) that has no integration point in the running app. To confirm:
|