@zibby/core 0.3.7 → 0.3.8
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/dist/package.json
CHANGED
|
@@ -28,7 +28,18 @@ export const generateScriptNode = {
|
|
|
28
28
|
const recorded = loadRecordedActions(state.sessionPath);
|
|
29
29
|
const setupHint = formatSetupHint(detectLoginPattern(recorded));
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// `state.outputPath` is computed from `state.specPath` by the
|
|
32
|
+
// framework. For `zibby test <spec>` runs it's set. For
|
|
33
|
+
// `workflow trigger` runs there's no spec file on disk, so
|
|
34
|
+
// outputPath comes back undefined and the prompt rendered
|
|
35
|
+
// "Generate and verify Playwright test at undefined" — which
|
|
36
|
+
// caused the LLM to literally write to a file named `undefined`.
|
|
37
|
+
// Fall back to a path under the session dir so the test always
|
|
38
|
+
// lands somewhere sensible.
|
|
39
|
+
const outputPath = state.outputPath
|
|
40
|
+
|| (state.sessionPath ? `${state.sessionPath}/generate_script/generated-test.spec.js` : 'tests/generated-test.spec.js');
|
|
41
|
+
|
|
42
|
+
return `Generate and verify Playwright test at ${outputPath}
|
|
32
43
|
|
|
33
44
|
Test Spec:
|
|
34
45
|
${state.testSpec}
|
|
@@ -85,9 +96,9 @@ RULES:
|
|
|
85
96
|
|
|
86
97
|
WORKFLOW:
|
|
87
98
|
1. Study the codebase FIRST — search tests/ for existing helpers, fixtures, and shared setup files. Read them. Reuse what exists. Do NOT create files that duplicate existing ones.
|
|
88
|
-
2. Write test to ${
|
|
99
|
+
2. Write test to ${outputPath} (after the run, a copy is mirrored under ${state.sessionPath}/generate_script/ for Studio — you may also write directly there if you prefer)
|
|
89
100
|
3. Verify syntax: run node --check on the file. If it fails, fix and re-check before proceeding.
|
|
90
|
-
4. Run: PLAYWRIGHT_HEADLESS=1 npx playwright test ${
|
|
101
|
+
4. Run: PLAYWRIGHT_HEADLESS=1 npx playwright test ${outputPath} --reporter=line --timeout=60000
|
|
91
102
|
5. If fails: try selectors in order — (a) getByRole (b) getByText (c) getByTestId (d) add waitForSelector. Never retry the same selector twice.
|
|
92
103
|
6. MAX 2 ATTEMPTS then STOP
|
|
93
104
|
|
package/package.json
CHANGED
|
@@ -28,7 +28,18 @@ export const generateScriptNode = {
|
|
|
28
28
|
const recorded = loadRecordedActions(state.sessionPath);
|
|
29
29
|
const setupHint = formatSetupHint(detectLoginPattern(recorded));
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// `state.outputPath` is computed from `state.specPath` by the
|
|
32
|
+
// framework. For `zibby test <spec>` runs it's set. For
|
|
33
|
+
// `workflow trigger` runs there's no spec file on disk, so
|
|
34
|
+
// outputPath comes back undefined and the prompt rendered
|
|
35
|
+
// "Generate and verify Playwright test at undefined" — which
|
|
36
|
+
// caused the LLM to literally write to a file named `undefined`.
|
|
37
|
+
// Fall back to a path under the session dir so the test always
|
|
38
|
+
// lands somewhere sensible.
|
|
39
|
+
const outputPath = state.outputPath
|
|
40
|
+
|| (state.sessionPath ? `${state.sessionPath}/generate_script/generated-test.spec.js` : 'tests/generated-test.spec.js');
|
|
41
|
+
|
|
42
|
+
return `Generate and verify Playwright test at ${outputPath}
|
|
32
43
|
|
|
33
44
|
Test Spec:
|
|
34
45
|
${state.testSpec}
|
|
@@ -85,9 +96,9 @@ RULES:
|
|
|
85
96
|
|
|
86
97
|
WORKFLOW:
|
|
87
98
|
1. Study the codebase FIRST — search tests/ for existing helpers, fixtures, and shared setup files. Read them. Reuse what exists. Do NOT create files that duplicate existing ones.
|
|
88
|
-
2. Write test to ${
|
|
99
|
+
2. Write test to ${outputPath} (after the run, a copy is mirrored under ${state.sessionPath}/generate_script/ for Studio — you may also write directly there if you prefer)
|
|
89
100
|
3. Verify syntax: run node --check on the file. If it fails, fix and re-check before proceeding.
|
|
90
|
-
4. Run: PLAYWRIGHT_HEADLESS=1 npx playwright test ${
|
|
101
|
+
4. Run: PLAYWRIGHT_HEADLESS=1 npx playwright test ${outputPath} --reporter=line --timeout=60000
|
|
91
102
|
5. If fails: try selectors in order — (a) getByRole (b) getByText (c) getByTestId (d) add waitForSelector. Never retry the same selector twice.
|
|
92
103
|
6. MAX 2 ATTEMPTS then STOP
|
|
93
104
|
|