@activate-core/test-forge 0.18.4 → 0.18.5

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,19 @@ 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
+ // Playwright is the one framework whose import is mandatory in every spec
602
+ // (jest's describe/it/expect are ambient, so a jest area generates fine
603
+ // either way). If it is missing, stop before spending a single AI call.
604
+ if (framework === 'playwright' && !allowedModules.has('@playwright/test')) {
605
+ const blocked = blockedAreas.get(journey.area) ?? {
606
+ pkg: '@playwright/test',
607
+ dir: areaDir,
608
+ count: 0,
609
+ };
610
+ blocked.count += 1;
611
+ blockedAreas.set(journey.area, blocked);
612
+ continue;
613
+ }
595
614
  // F10 — selector grounding (Playwright areas only): the real test-hooks
596
615
  // in this area's components, so a generated UI test can't invent one.
597
616
  let knownSelectors;
@@ -818,6 +837,21 @@ export async function runGenerate(docsDir, useAI = true, force = false, only, ar
818
837
  warnings: warnings.length ? warnings : undefined,
819
838
  });
820
839
  }
840
+ for (const [area, b] of blockedAreas) {
841
+ results.push({
842
+ journeyName: `${b.count} ${area} journey(s) not attempted — ${b.pkg} is not installed`,
843
+ testDir: '',
844
+ testFiles: [],
845
+ seedPath: '',
846
+ status: 'skipped',
847
+ seedStatus: 'none',
848
+ warnings: [
849
+ `every ${area} spec must import ${b.pkg}, so without it the dependency gate ` +
850
+ `refuses each generated file and leaves a deferred stub — hours of AI calls for nothing. ` +
851
+ `Install it, then re-run: npm i -D ${b.pkg} && npx playwright install`,
852
+ ],
853
+ });
854
+ }
821
855
  if (notAttempted > 0 && aiUnavailable) {
822
856
  // One line, not one per journey: the operator needs the reason and the
823
857
  // 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.5",
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": {