@yasserkhanorg/e2e-agents 0.5.13 → 0.5.14
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;
|
|
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;AA4WD,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,CA2O1B"}
|
package/dist/agent/ai_mapping.js
CHANGED
|
@@ -249,8 +249,11 @@ function selectCandidateTests(flows, tests, maxCandidateTests) {
|
|
|
249
249
|
continue;
|
|
250
250
|
}
|
|
251
251
|
const matched = fallbackKws.filter((k) => haystack.includes(k));
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
// For 3+ tokens, n-1 must match (allows one absent word like "view");
|
|
253
|
+
// for 1-2 tokens all must match.
|
|
254
|
+
const required = fallbackKws.length >= 3 ? fallbackKws.length - 1 : fallbackKws.length;
|
|
255
|
+
if (matched.length < required) {
|
|
256
|
+
continue;
|
|
254
257
|
}
|
|
255
258
|
fallbackCandidates.push({ path: testPath, score: matched.length, matchedKeywords: matched });
|
|
256
259
|
}
|
|
@@ -418,12 +421,11 @@ async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests) {
|
|
|
418
421
|
'Rules:',
|
|
419
422
|
'- Keep at most 5 tests per flow.',
|
|
420
423
|
'- Use exact flowId values from FLOWS.',
|
|
421
|
-
'- Map a test when you have
|
|
424
|
+
'- Map a test when you have behavioral evidence it covers the flow scenario, from the file path OR from test titles in the content. A file named search_user_post_spec.js with titles like "search for message by keyword" covers search_messages. Generic subsystem similarity without behavioral evidence is not enough.',
|
|
422
425
|
'- A flow may only map to tests listed under FLOW_CANDIDATE_SIGNALS for that flow.',
|
|
423
|
-
'-
|
|
424
|
-
'-
|
|
425
|
-
'-
|
|
426
|
-
'- 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.',
|
|
426
|
+
'- When a flow has 3 or more candidate tests that collectively cover its behavioral domain (e.g. multiple search specs for search_messages, multiple messaging specs for view_post_in_channel), map all of them. Collective coverage across multiple files counts as full coverage.',
|
|
427
|
+
'- Only return tests: [] when NO candidate file has clear behavioral overlap to the flow.',
|
|
428
|
+
'- missingScenarios: for flows with no test mappings (tests: []), list 3-5 core scenarios that a new test must cover. For flows WITH test mappings, ONLY list scenarios that are genuinely absent from ALL mapped tests combined — if the mapped tests collectively cover the core user-facing scenarios well, return missingScenarios: []. Do not invent edge-case gaps for well-covered flows.',
|
|
427
429
|
'',
|
|
428
430
|
`FLOWS (${prioritizedFlows.length}):`,
|
|
429
431
|
JSON.stringify(prioritizedFlows.map((flow) => ({
|
|
@@ -246,8 +246,11 @@ function selectCandidateTests(flows, tests, maxCandidateTests) {
|
|
|
246
246
|
continue;
|
|
247
247
|
}
|
|
248
248
|
const matched = fallbackKws.filter((k) => haystack.includes(k));
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
// For 3+ tokens, n-1 must match (allows one absent word like "view");
|
|
250
|
+
// for 1-2 tokens all must match.
|
|
251
|
+
const required = fallbackKws.length >= 3 ? fallbackKws.length - 1 : fallbackKws.length;
|
|
252
|
+
if (matched.length < required) {
|
|
253
|
+
continue;
|
|
251
254
|
}
|
|
252
255
|
fallbackCandidates.push({ path: testPath, score: matched.length, matchedKeywords: matched });
|
|
253
256
|
}
|
|
@@ -415,12 +418,11 @@ export async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests
|
|
|
415
418
|
'Rules:',
|
|
416
419
|
'- Keep at most 5 tests per flow.',
|
|
417
420
|
'- Use exact flowId values from FLOWS.',
|
|
418
|
-
'- Map a test when you have
|
|
421
|
+
'- Map a test when you have behavioral evidence it covers the flow scenario, from the file path OR from test titles in the content. A file named search_user_post_spec.js with titles like "search for message by keyword" covers search_messages. Generic subsystem similarity without behavioral evidence is not enough.',
|
|
419
422
|
'- A flow may only map to tests listed under FLOW_CANDIDATE_SIGNALS for that flow.',
|
|
420
|
-
'-
|
|
421
|
-
'-
|
|
422
|
-
'-
|
|
423
|
-
'- 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.',
|
|
423
|
+
'- When a flow has 3 or more candidate tests that collectively cover its behavioral domain (e.g. multiple search specs for search_messages, multiple messaging specs for view_post_in_channel), map all of them. Collective coverage across multiple files counts as full coverage.',
|
|
424
|
+
'- Only return tests: [] when NO candidate file has clear behavioral overlap to the flow.',
|
|
425
|
+
'- missingScenarios: for flows with no test mappings (tests: []), list 3-5 core scenarios that a new test must cover. For flows WITH test mappings, ONLY list scenarios that are genuinely absent from ALL mapped tests combined — if the mapped tests collectively cover the core user-facing scenarios well, return missingScenarios: []. Do not invent edge-case gaps for well-covered flows.',
|
|
424
426
|
'',
|
|
425
427
|
`FLOWS (${prioritizedFlows.length}):`,
|
|
426
428
|
JSON.stringify(prioritizedFlows.map((flow) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yasserkhanorg/e2e-agents",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.14",
|
|
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",
|