comfy-qa 1.7.0 → 1.7.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/package.json +1 -1
- package/src/agent/qa-research.ts +10 -4
package/package.json
CHANGED
package/src/agent/qa-research.ts
CHANGED
|
@@ -710,9 +710,11 @@ ${segments.join("\n")}
|
|
|
710
710
|
// ---------------------------------------------------------------------------
|
|
711
711
|
|
|
712
712
|
async function runSpec(specPath: string, label: string): Promise<{ ok: boolean; output: string }> {
|
|
713
|
-
|
|
713
|
+
// Use -c demo/ to override testDir so specs in demo/ are found
|
|
714
|
+
const testDir = path.dirname(specPath);
|
|
715
|
+
console.log(`\n${label}\n Running: bunx playwright test -c ${testDir}/ ${specPath}\n`);
|
|
714
716
|
try {
|
|
715
|
-
const result = await $`bunx playwright test ${specPath} --reporter=list 2>&1`.text();
|
|
717
|
+
const result = await $`bunx playwright test -c ${testDir}/ ${specPath} --reporter=list 2>&1`.text();
|
|
716
718
|
// Match Playwright's summary line: "N passed" or "N failed"
|
|
717
719
|
const passMatch = result.match(/(\d+) passed/);
|
|
718
720
|
const failMatch = result.match(/(\d+) failed/);
|
|
@@ -750,8 +752,8 @@ async function debugLoop(specPath: string, maxRetries = 3): Promise<boolean> {
|
|
|
750
752
|
RULES:
|
|
751
753
|
- Only fix the specific error. Don't rewrite the whole spec.
|
|
752
754
|
- Keep the same structure (title, segments, outro).
|
|
753
|
-
-
|
|
754
|
-
- If
|
|
755
|
+
- NEVER change import paths. Keep them exactly as they are.
|
|
756
|
+
- If a selector timed out, try a more robust selector.
|
|
755
757
|
- Return the COMPLETE fixed spec file (not just the diff).
|
|
756
758
|
|
|
757
759
|
## Current spec:
|
|
@@ -784,6 +786,10 @@ Return ONLY the fixed TypeScript file content, no markdown fences.`;
|
|
|
784
786
|
const balancedBraces = (fixedContent.match(/\{/g)?.length ?? 0) === (fixedContent.match(/\}/g)?.length ?? 0);
|
|
785
787
|
|
|
786
788
|
if (hasImport && hasTest && hasEnd && balancedBraces) {
|
|
789
|
+
// Force correct import paths (LLM sometimes changes them)
|
|
790
|
+
fixedContent = fixedContent
|
|
791
|
+
.replace(/from\s+["'].*?fixtures\/fixture["']/g, 'from "./fixtures/fixture"')
|
|
792
|
+
.replace(/from\s+["'].*?demowright\/dist\/[^"']*["']/g, 'from "../lib/demowright/dist/index.mjs"');
|
|
787
793
|
fs.writeFileSync(specPath, fixedContent);
|
|
788
794
|
console.log(` ✏️ Spec updated, retrying...`);
|
|
789
795
|
} else {
|