@activate-core/test-forge 0.18.4 → 0.18.6

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.
@@ -508,6 +508,12 @@ export async function runGenerate(docsDir, useAI = true, force = false, only, ar
508
508
  // the counter reset and the stubs behind; redo such a journey once, as soon
509
509
  // as the AI is answering — the stubs are all it costs.
510
510
  const stubbed = new Set();
511
+ // Areas whose test framework is not installed. A Playwright spec MUST import
512
+ // "@playwright/test"; without it every generated file is refused by the
513
+ // dependency gate and becomes a deferred stub. That is an environment
514
+ // problem, not something to discover thirteen times over a night, so the
515
+ // area is skipped with the install command and no AI is called at all.
516
+ const blockedAreas = new Map();
511
517
  for (let i = 0; i < files.length; i++) {
512
518
  const file = files[i];
513
519
  // Redo the journey BEFORE this one: it degraded into stubs while the AI
@@ -592,6 +598,24 @@ export async function runGenerate(docsDir, useAI = true, force = false, only, ar
592
598
  // AI can't fall back to an uninstalled convention (e.g. supertest).
593
599
  const allowedModules = installedModules(testDir);
594
600
  const transport = transportHint(testDir, framework);
601
+ // The area's OWN framework is always allowed, installed or not. Refusing
602
+ // it confuses two different things: output that reached for a module the
603
+ // project does not use (genuinely wrong — still refused), and output that
604
+ // is perfectly correct while the project has simply not installed the
605
+ // runner it is configured to use. The second is an environment gap, and
606
+ // throwing away a correct test for it loses real work — the test is
607
+ // written, and the run says the framework must be installed to run it.
608
+ const frameworkPkg = framework === 'playwright' ? '@playwright/test' : 'jest';
609
+ if (!allowedModules.has(frameworkPkg)) {
610
+ allowedModules.add(frameworkPkg);
611
+ const blocked = blockedAreas.get(journey.area) ?? {
612
+ pkg: frameworkPkg,
613
+ dir: areaDir,
614
+ count: 0,
615
+ };
616
+ blocked.count += 1;
617
+ blockedAreas.set(journey.area, blocked);
618
+ }
595
619
  // F10 — selector grounding (Playwright areas only): the real test-hooks
596
620
  // in this area's components, so a generated UI test can't invent one.
597
621
  let knownSelectors;
@@ -818,6 +842,21 @@ export async function runGenerate(docsDir, useAI = true, force = false, only, ar
818
842
  warnings: warnings.length ? warnings : undefined,
819
843
  });
820
844
  }
845
+ for (const [area, b] of blockedAreas) {
846
+ const browsers = b.pkg === '@playwright/test' ? ' && npx playwright install' : '';
847
+ results.push({
848
+ journeyName: `${area}: tests written, but ${b.pkg} is not installed`,
849
+ testDir: '',
850
+ testFiles: [],
851
+ seedPath: '',
852
+ status: 'skipped',
853
+ seedStatus: 'none',
854
+ warnings: [
855
+ `${b.count} ${area} journey(s) were generated normally and are complete. They cannot RUN ` +
856
+ `until the runner is installed: npm i -D ${b.pkg}${browsers}`,
857
+ ],
858
+ });
859
+ }
821
860
  if (notAttempted > 0 && aiUnavailable) {
822
861
  // One line, not one per journey: the operator needs the reason and the
823
862
  // count, then to re-run once the CLI is back.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activate-core/test-forge",
3
- "version": "0.18.4",
3
+ "version": "0.18.6",
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": {