@empiricalrun/test-gen 0.52.7 → 0.52.8
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
package/dist/bin/utils/index.js
CHANGED
|
@@ -69,7 +69,7 @@ function printBanner() {
|
|
|
69
69
|
{o,o}
|
|
70
70
|
/)__)
|
|
71
71
|
--"-"-`;
|
|
72
|
-
const version = require("
|
|
72
|
+
const version = require("../../../package.json").version;
|
|
73
73
|
const logLine1 = `Running test-gen v${version}`;
|
|
74
74
|
const logLine2 = `from ${__dirname}`;
|
|
75
75
|
// Process ASCII art
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAwEnD,eAAO,MAAM,4BAA4B,EAAE,IA0E1C,CAAC"}
|
|
@@ -46,8 +46,22 @@ For the above file, the browser environment will execute the steps before the TO
|
|
|
46
46
|
to the browser agent. The agent will do the actions described in the TODO comment and then resume control back to the
|
|
47
47
|
test code.
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
Note that you CANNOT add TODO comments in the middle of a multi-line statement. This will break the tool.
|
|
50
|
+
|
|
51
|
+
For example, this is invalid:
|
|
52
|
+
|
|
53
|
+
\`\`\`
|
|
54
|
+
await extPage
|
|
55
|
+
.getByTestId("virtuoso-item-list")
|
|
56
|
+
// TODO(agent): Click on the STARS button
|
|
57
|
+
.getByText("STARS", { exact: true })
|
|
58
|
+
.click();
|
|
59
|
+
// This is invalid, because the TODO is in the middle of a multi-line statement
|
|
60
|
+
// Instead, add the TODO before or after the multi-line statement
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
After execution, the browser agent will return a summary of actions that it took, and the generated Playwright code for them.
|
|
64
|
+
You can then use the text editor tool to replace the TODO comment with the generated Playwright code.
|
|
51
65
|
`;
|
|
52
66
|
exports.generateTestWithBrowserAgent = {
|
|
53
67
|
schema: {
|