@empiricalrun/test-gen 0.38.32 → 0.38.34
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @empiricalrun/test-gen
|
|
2
2
|
|
|
3
|
+
## 0.38.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f3519a9: fix: maintain test alias in imports after master agent
|
|
8
|
+
|
|
9
|
+
## 0.38.33
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [65061d8]
|
|
14
|
+
- @empiricalrun/llm@0.9.28
|
|
15
|
+
|
|
3
16
|
## 0.38.32
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAclC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EACL,oBAAoB,EAErB,MAAM,aAAa,CAAC;AAsBrB,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;;;
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAclC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EACL,oBAAoB,EAErB,MAAM,aAAa,CAAC;AAsBrB,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;;;GA6VA"}
|
package/dist/agent/master/run.js
CHANGED
|
@@ -64,7 +64,6 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
64
64
|
});
|
|
65
65
|
let skills = [];
|
|
66
66
|
if (testCase) {
|
|
67
|
-
//Fetching available skills
|
|
68
67
|
skills = await (0, skills_retriever_1.getAppropriateSkills)({
|
|
69
68
|
testCase,
|
|
70
69
|
trace,
|
|
@@ -80,7 +79,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
80
79
|
const masterAgentActions = [];
|
|
81
80
|
let failedActions = [];
|
|
82
81
|
let disableSkills = false;
|
|
83
|
-
//Run the loop until task is done or we have reached max retry limit
|
|
82
|
+
// Run the loop until task is done or we have reached max retry limit
|
|
84
83
|
while (!isGivenTaskDone) {
|
|
85
84
|
if (await (0, session_1.shouldStopSession)()) {
|
|
86
85
|
break;
|
|
@@ -93,7 +92,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
93
92
|
failedActions,
|
|
94
93
|
},
|
|
95
94
|
});
|
|
96
|
-
//Provides a plan to master agent to execute, also verifies whether task is done or not
|
|
95
|
+
// Provides a plan to master agent to execute, also verifies whether task is done or not
|
|
97
96
|
const plannerResp = await (0, run_time_planner_1.runtimePlanner)({
|
|
98
97
|
trace: masterAgentSpan,
|
|
99
98
|
task,
|
|
@@ -115,8 +114,6 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
115
114
|
// inject scripts in the page
|
|
116
115
|
await (0, utils_2.injectPwLocatorGenerator)(testGenPage.pwPageInstance);
|
|
117
116
|
const buffer = await page.screenshot({
|
|
118
|
-
//This is done to improve element annotation accuracy, anyways it doesn't annotate elements which are out of viewport
|
|
119
|
-
// fullPage: true,
|
|
120
117
|
// path: `screenshots/screenshot-${screenshotIndex++}.png`, // enable this and screenshotIndex var for local debugging
|
|
121
118
|
});
|
|
122
119
|
const testGenReporter = new reporter_1.TestGenUpdatesReporter();
|
|
@@ -127,7 +124,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
127
124
|
if (await (0, session_1.shouldStopSession)()) {
|
|
128
125
|
break;
|
|
129
126
|
}
|
|
130
|
-
//Provides next action that needs to be taken
|
|
127
|
+
// Provides next action that needs to be taken
|
|
131
128
|
const toolCall = await (0, next_action_1.getNextAction)({
|
|
132
129
|
task,
|
|
133
130
|
executedActions: masterAgentActions,
|
|
@@ -190,8 +187,6 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
190
187
|
await page.waitForTimeout(2000);
|
|
191
188
|
let annotatedPageScreenshot;
|
|
192
189
|
const annonationBuffer = await page.screenshot({
|
|
193
|
-
//This is done to improve element annotation accuracy, anyways it doesn't annotate elements which are out of viewport
|
|
194
|
-
// fullPage: true,
|
|
195
190
|
// path: `screenshots/screenshot-${screenshotIndex++}.png`,
|
|
196
191
|
});
|
|
197
192
|
annotatedPageScreenshot = annonationBuffer.toString("base64");
|
|
@@ -212,8 +207,8 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
212
207
|
const annotationMapString = annotationKeys
|
|
213
208
|
?.map((a) => `${a.elementID}:${a.text}`)
|
|
214
209
|
.join("\n");
|
|
215
|
-
//Provides the annotations for all the element present on screen
|
|
216
|
-
//Also provides the annotation of element on which the action needs to be taken
|
|
210
|
+
// Provides the annotations for all the element present on screen
|
|
211
|
+
// Also provides the annotation of element on which the action needs to be taken
|
|
217
212
|
elementAnnotation = await (0, element_annotation_1.getElementAnnotation)({
|
|
218
213
|
elementDescription: JSON.parse(toolCall.function.arguments)
|
|
219
214
|
.element_description,
|
|
@@ -232,7 +227,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
|
|
|
232
227
|
generatedAnnotations: annotationKeys,
|
|
233
228
|
},
|
|
234
229
|
});
|
|
235
|
-
//Provides the action whether its a click, fill etc.
|
|
230
|
+
// Provides the action whether its a click, fill etc.
|
|
236
231
|
const result = await (0, with_hints_1.triggerHintsFlow)({
|
|
237
232
|
outputFromGetNextAction: output,
|
|
238
233
|
generatedAnnotations: annotationKeys,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,IAAI,EAEJ,UAAU,EAEX,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,eAAO,MAAM,gCAAgC,eAC/B,UAAU,KACrB,MAgBF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG;IACF,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB,CA2CA;AAwBD,wBAAsB,0CAA0C,CAC9D,QAAQ,EAAE,MAAM,oBA+BjB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,IAAI,GAAG,SAAS,CA4BlB;AAED,wBAAgB,i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,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,iBA8CA;AAED,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EAAE,iBA2BzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,WAYA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,UAOA;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA4B5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQnD"}
|
|
@@ -310,9 +310,11 @@ function replaceCreateTestWithNewCode(filePath, contents, generatedCode) {
|
|
|
310
310
|
node.getText().includes("fixtures")));
|
|
311
311
|
if (fixtureImportNode) {
|
|
312
312
|
const importClause = fixtureImportNode.getImportClause();
|
|
313
|
-
const namedImports = importClause
|
|
314
|
-
.
|
|
315
|
-
|
|
313
|
+
const namedImports = importClause.getNamedImports().map((imp) => {
|
|
314
|
+
// aliasNode is truthy if the import is aliased (e.g. import { test as setup } ...)
|
|
315
|
+
const aliasNode = imp.getAliasNode();
|
|
316
|
+
return aliasNode?.getText() || imp.getName();
|
|
317
|
+
});
|
|
316
318
|
const isComplete = namedImports.includes(testAlias) && namedImports.includes("expect");
|
|
317
319
|
if (!isComplete) {
|
|
318
320
|
const expectedImports = `import { test, expect } from "${getFixtureImportPath(filePath)}";`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.34",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"ts-morph": "^24.0.0",
|
|
68
68
|
"tsx": "^4.16.2",
|
|
69
69
|
"typescript": "^5.3.3",
|
|
70
|
-
"@empiricalrun/llm": "^0.9.
|
|
71
|
-
"@empiricalrun/
|
|
72
|
-
"@empiricalrun/
|
|
70
|
+
"@empiricalrun/llm": "^0.9.28",
|
|
71
|
+
"@empiricalrun/r2-uploader": "^0.3.7",
|
|
72
|
+
"@empiricalrun/reporter": "^0.21.4"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/detect-port": "^1.3.5",
|