@yasserkhanorg/e2e-agents 0.5.11 → 0.5.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ai_mapping.d.ts","sourceRoot":"","sources":["../../src/agent/ai_mapping.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AA4BvD,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAuTD,wBAAsB,iBAAiB,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,qBAAqB,EAC7B,KAAK,EAAE,UAAU,EAAE,EACnB,KAAK,EAAE,QAAQ,EAAE,GAClB,OAAO,CAAC,eAAe,CAAC,CA0O1B"}
1
+ {"version":3,"file":"ai_mapping.d.ts","sourceRoot":"","sources":["../../src/agent/ai_mapping.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AA4BvD,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAuTD,wBAAsB,iBAAiB,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,qBAAqB,EAC7B,KAAK,EAAE,UAAU,EAAE,EACnB,KAAK,EAAE,QAAQ,EAAE,GAClB,OAAO,CAAC,eAAe,CAAC,CA4O1B"}
@@ -376,8 +376,7 @@ async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests) {
376
376
  '- Treat single-keyword or broad subsystem overlap as insufficient evidence.',
377
377
  '- If the candidate path overlap is weak or ambiguous, return tests: [].',
378
378
  '- If unsure for a flow, return tests: [].',
379
- '- For every flow you map to tests, read CANDIDATE_TEST_CONTENT and list up to 5 specific test scenarios NOT yet covered by those tests. Write each as a short imperative statement (e.g. "Search messages with date filter"). Only include missingScenarios you can clearly identify; return [] if unsure.',
380
- '- If tests: [], set missingScenarios: [] as well — do not invent scenarios for unmapped flows.',
379
+ '- For EVERY flow (whether or not tests were found), return missingScenarios with 3-5 key user-facing test scenarios that must be covered. Write each as a short imperative statement starting with a verb (e.g. "Search for a message by keyword and verify results appear"). For mapped flows, focus on what the existing tests do NOT cover; for unmapped flows, describe the core scenarios a new test should include.',
381
380
  '',
382
381
  `FLOWS (${prioritizedFlows.length}):`,
383
382
  JSON.stringify(prioritizedFlows.map((flow) => ({
@@ -444,6 +443,16 @@ async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests) {
444
443
  if (!entry || !allowedFlowIds.has(entry.flowId) || !Array.isArray(entry.tests)) {
445
444
  continue;
446
445
  }
446
+ // Capture scenario suggestions for ALL flows up-front — before any early returns —
447
+ // so unmapped flows (tests: []) still get their suggested scenarios in the gap report.
448
+ if (Array.isArray(entry.missingScenarios) && entry.missingScenarios.length > 0) {
449
+ const scenarios = entry.missingScenarios
450
+ .filter((s) => typeof s === 'string' && s.trim().length > 0)
451
+ .slice(0, 5);
452
+ if (scenarios.length > 0) {
453
+ scenarioGaps.set(entry.flowId, scenarios);
454
+ }
455
+ }
447
456
  const flow = prioritizedFlowsById.get(entry.flowId);
448
457
  const confidence = typeof entry.confidence === 'number' ? entry.confidence : undefined;
449
458
  const allowedTestsForFlow = candidateSelection.byFlow.get(entry.flowId);
@@ -462,15 +471,6 @@ async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests) {
462
471
  for (const testPath of valid) {
463
472
  matchedTests.add(testPath);
464
473
  }
465
- // Store missing scenarios identified by the AI for this flow.
466
- if (Array.isArray(entry.missingScenarios) && entry.missingScenarios.length > 0) {
467
- const scenarios = entry.missingScenarios
468
- .filter((s) => typeof s === 'string' && s.trim().length > 0)
469
- .slice(0, 5);
470
- if (scenarios.length > 0) {
471
- scenarioGaps.set(entry.flowId, scenarios);
472
- }
473
- }
474
474
  }
475
475
  // Post-AI exact-name fallback: for any flow still uncovered, search all test paths
476
476
  // for a file or directory whose name exactly matches the flow ID. This handles flows
@@ -373,8 +373,7 @@ export async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests
373
373
  '- Treat single-keyword or broad subsystem overlap as insufficient evidence.',
374
374
  '- If the candidate path overlap is weak or ambiguous, return tests: [].',
375
375
  '- If unsure for a flow, return tests: [].',
376
- '- For every flow you map to tests, read CANDIDATE_TEST_CONTENT and list up to 5 specific test scenarios NOT yet covered by those tests. Write each as a short imperative statement (e.g. "Search messages with date filter"). Only include missingScenarios you can clearly identify; return [] if unsure.',
377
- '- If tests: [], set missingScenarios: [] as well — do not invent scenarios for unmapped flows.',
376
+ '- For EVERY flow (whether or not tests were found), return missingScenarios with 3-5 key user-facing test scenarios that must be covered. Write each as a short imperative statement starting with a verb (e.g. "Search for a message by keyword and verify results appear"). For mapped flows, focus on what the existing tests do NOT cover; for unmapped flows, describe the core scenarios a new test should include.',
378
377
  '',
379
378
  `FLOWS (${prioritizedFlows.length}):`,
380
379
  JSON.stringify(prioritizedFlows.map((flow) => ({
@@ -441,6 +440,16 @@ export async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests
441
440
  if (!entry || !allowedFlowIds.has(entry.flowId) || !Array.isArray(entry.tests)) {
442
441
  continue;
443
442
  }
443
+ // Capture scenario suggestions for ALL flows up-front — before any early returns —
444
+ // so unmapped flows (tests: []) still get their suggested scenarios in the gap report.
445
+ if (Array.isArray(entry.missingScenarios) && entry.missingScenarios.length > 0) {
446
+ const scenarios = entry.missingScenarios
447
+ .filter((s) => typeof s === 'string' && s.trim().length > 0)
448
+ .slice(0, 5);
449
+ if (scenarios.length > 0) {
450
+ scenarioGaps.set(entry.flowId, scenarios);
451
+ }
452
+ }
444
453
  const flow = prioritizedFlowsById.get(entry.flowId);
445
454
  const confidence = typeof entry.confidence === 'number' ? entry.confidence : undefined;
446
455
  const allowedTestsForFlow = candidateSelection.byFlow.get(entry.flowId);
@@ -459,15 +468,6 @@ export async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests
459
468
  for (const testPath of valid) {
460
469
  matchedTests.add(testPath);
461
470
  }
462
- // Store missing scenarios identified by the AI for this flow.
463
- if (Array.isArray(entry.missingScenarios) && entry.missingScenarios.length > 0) {
464
- const scenarios = entry.missingScenarios
465
- .filter((s) => typeof s === 'string' && s.trim().length > 0)
466
- .slice(0, 5);
467
- if (scenarios.length > 0) {
468
- scenarioGaps.set(entry.flowId, scenarios);
469
- }
470
- }
471
471
  }
472
472
  // Post-AI exact-name fallback: for any flow still uncovered, search all test paths
473
473
  // for a file or directory whose name exactly matches the flow ID. This handles flows
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasserkhanorg/e2e-agents",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "Pluggable LLM provider library for AI-powered test automation. Use Claude, Ollama, or your own LLM. Integrate with Playwright, Jest, or any test framework. MCP server for test agents, cost tracking, and hybrid provider mode.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",