@activate-core/test-forge 0.9.5 → 0.9.7
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.
|
@@ -121,9 +121,16 @@ export function buildPrompt(journey, map, testPath, focus, harnessPath) {
|
|
|
121
121
|
].join('\n')
|
|
122
122
|
: [
|
|
123
123
|
`Because this is a web journey, write Playwright tests that drive`,
|
|
124
|
-
`the UI.
|
|
125
|
-
`
|
|
126
|
-
`
|
|
124
|
+
`the UI. FIRST find the REAL selectors: with your read-only tools,`,
|
|
125
|
+
`locate and READ this page's actual React/Vue components (grep the`,
|
|
126
|
+
`webapp source for the route, page name, and on-screen text, then`,
|
|
127
|
+
`open those component files). Use the selectors that genuinely`,
|
|
128
|
+
`exist there — data-testid/data-cy, input name/id, aria-role,`,
|
|
129
|
+
`label text, or button text — via Playwright locators`,
|
|
130
|
+
`(getByRole/getByLabel/getByTestId/getByText). Only leave a`,
|
|
131
|
+
`"// TODO: confirm selector" when the element truly cannot be`,
|
|
132
|
+
`found in the component source; do NOT default everything to a`,
|
|
133
|
+
`TODO. Never invent a selector as if it were real.`,
|
|
127
134
|
`CRITICAL Playwright API: import { test, expect } from`,
|
|
128
135
|
`'@playwright/test'. There is NO test.todo / it.* / describe.skip`,
|
|
129
136
|
`in Playwright — using them throws at collection and breaks the`,
|
|
@@ -215,6 +215,15 @@ export async function runGenerate(docsDir, useAI = true, force = false, only, ar
|
|
|
215
215
|
if (harnessByArea.has(area))
|
|
216
216
|
return harnessByArea.get(area) ?? undefined;
|
|
217
217
|
const info = harnessInfo(areaDir, framework, ext);
|
|
218
|
+
// REUSE an existing testkit instead of regenerating it. This is what
|
|
219
|
+
// makes one-by-one (`generate --journey X`) cheap: the first journey
|
|
220
|
+
// in an area builds the testkit, every later journey reuses it — no
|
|
221
|
+
// extra AI call (and no risk of that call eating the token limit).
|
|
222
|
+
// Pass --force to rebuild a stale testkit (e.g. after upgrading).
|
|
223
|
+
if (!force && existsSync(info.path)) {
|
|
224
|
+
harnessByArea.set(area, info.path);
|
|
225
|
+
return info.path;
|
|
226
|
+
}
|
|
218
227
|
const kit = await generateValidatedAsync(() => generateHarnessAsync(info.path, framework), ext.endsWith('.js') ? '.js' : '.ts');
|
|
219
228
|
if (kit === null) {
|
|
220
229
|
harnessByArea.set(area, null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activate-core/test-forge",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "AI-powered QA automation. Scans a project, drafts journey docs, and generates seeded Jest/Playwright tests. Works in any project, with any AI CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|