donobu 2.18.0 → 2.18.1

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
- 1156
1
+ 1159
@@ -1 +1 @@
1
- 1156
1
+ 1159
@@ -0,0 +1,56 @@
1
+ /**
2
+ * A class that handles the updating of test files based on test failures.
3
+ */
4
+ export declare class TestFileUpdater {
5
+ /**
6
+ * Updates a specific test case in a test file with new test code.
7
+ *
8
+ * @param testFilePath The path to the test file to update
9
+ * @param testName The name of the test case to update
10
+ * @param newTestCode The new test code to replace the old test with
11
+ * @param options Options for updating the file
12
+ * @returns True if the update was successful, false otherwise
13
+ */
14
+ static updateTestCase(testFilePath: string, testName: string, newTestCode: string): Promise<boolean>;
15
+ /**
16
+ * Extracts a specific test case from source code.
17
+ *
18
+ * @param sourceFile The TypeScript source file
19
+ * @param sourceCode The original source code string
20
+ * @param testName The name of the test to extract
21
+ * @returns The extracted test code or null if not found
22
+ */
23
+ private static extractTestCase;
24
+ /**
25
+ * Finds a specific test case in the original code and replaces it with new code.
26
+ *
27
+ * @param sourceFile The TypeScript source file
28
+ * @param sourceCode The original source code string
29
+ * @param testName The name of the test to replace
30
+ * @param newTestCode The new test code to insert
31
+ * @returns The updated source code
32
+ */
33
+ private static findAndReplaceTestCase;
34
+ /**
35
+ * Checks if a node is a test definition (test or it function call).
36
+ */
37
+ private static isTestNode;
38
+ /**
39
+ * Gets the title string from a test node.
40
+ */
41
+ private static getTestTitle;
42
+ /**
43
+ * Checks if a test title matches the target test name.
44
+ */
45
+ private static testTitleMatches;
46
+ /**
47
+ * Updates a test file based on a Playwright JSON reporter output.
48
+ *
49
+ * @param jsonReportPath Path to the Playwright JSON report
50
+ * @param testFilePath Path to the test file to update (if not specified, will be extracted from the report)
51
+ * @param newTestCode The new test code
52
+ * @returns True if the update was successful, false otherwise
53
+ */
54
+ static updateFromPlaywrightReport(jsonReportPath: string, newTestCode: string, testFilePath?: string): Promise<boolean>;
55
+ }
56
+ //# sourceMappingURL=TestFileUpdater.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestFileUpdater.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/TestFileUpdater.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,qBAAa,eAAe;IAC1B;;;;;;;;OAQG;WACiB,cAAc,CAChC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC;IAuEnB;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAsB9B;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IA2BrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAUzB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAc3B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAM/B;;;;;;;OAOG;WACiB,0BAA0B,CAC5C,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC;CAmDpB"}
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.TestFileUpdater = void 0;
40
+ const fs = __importStar(require("fs"));
41
+ const typescript_1 = __importDefault(require("typescript"));
42
+ const Logger_1 = require("../../utils/Logger");
43
+ /**
44
+ * A class that handles the updating of test files based on test failures.
45
+ */
46
+ class TestFileUpdater {
47
+ /**
48
+ * Updates a specific test case in a test file with new test code.
49
+ *
50
+ * @param testFilePath The path to the test file to update
51
+ * @param testName The name of the test case to update
52
+ * @param newTestCode The new test code to replace the old test with
53
+ * @param options Options for updating the file
54
+ * @returns True if the update was successful, false otherwise
55
+ */
56
+ static async updateTestCase(testFilePath, testName, newTestCode) {
57
+ try {
58
+ // Verify the test file exists
59
+ if (!fs.existsSync(testFilePath)) {
60
+ Logger_1.appLogger.error(`Test file does not exist: ${testFilePath}`);
61
+ return false;
62
+ }
63
+ // Read the original test file
64
+ const originalTestCode = await fs.promises.readFile(testFilePath, 'utf8');
65
+ // Parse the original and new test code
66
+ const sourceFile = typescript_1.default.createSourceFile(testFilePath, originalTestCode, typescript_1.default.ScriptTarget.Latest, true);
67
+ const newTestSourceFile = typescript_1.default.createSourceFile('new-test.ts', newTestCode, typescript_1.default.ScriptTarget.Latest, true);
68
+ // Extract the new test case
69
+ const extractedNewTest = this.extractTestCase(newTestSourceFile, newTestCode, testName);
70
+ if (!extractedNewTest) {
71
+ Logger_1.appLogger.warn(`Could not extract the new test case "${testName}" from the provided code`);
72
+ await fs.promises.writeFile(testFilePath, newTestCode, 'utf8');
73
+ Logger_1.appLogger.info(`Replaced entire test file with new code`);
74
+ return true;
75
+ }
76
+ // Find and replace the old test case
77
+ const updatedCode = this.findAndReplaceTestCase(sourceFile, originalTestCode, testName, extractedNewTest);
78
+ if (updatedCode === originalTestCode) {
79
+ Logger_1.appLogger.warn(`Could not find the test case "${testName}" in the original file`);
80
+ await fs.promises.writeFile(testFilePath, newTestCode, 'utf8');
81
+ Logger_1.appLogger.info(`Replaced entire test file with new code`);
82
+ return true;
83
+ }
84
+ // Write the updated code back to the test file
85
+ await fs.promises.writeFile(testFilePath, updatedCode, 'utf8');
86
+ Logger_1.appLogger.info(`Successfully updated test case "${testName}" in ${testFilePath}`);
87
+ return true;
88
+ }
89
+ catch (error) {
90
+ Logger_1.appLogger.error(`Error updating test file ${testFilePath}:`, error);
91
+ return false;
92
+ }
93
+ }
94
+ /**
95
+ * Extracts a specific test case from source code.
96
+ *
97
+ * @param sourceFile The TypeScript source file
98
+ * @param sourceCode The original source code string
99
+ * @param testName The name of the test to extract
100
+ * @returns The extracted test code or null if not found
101
+ */
102
+ static extractTestCase(sourceFile, sourceCode, testName) {
103
+ let extractedTest = null;
104
+ typescript_1.default.forEachChild(sourceFile, (node) => {
105
+ if (extractedTest)
106
+ return; // Already found
107
+ if (this.isTestNode(node)) {
108
+ const title = this.getTestTitle(node);
109
+ if (title && this.testTitleMatches(title, testName)) {
110
+ extractedTest = sourceCode.substring(node.pos, node.end);
111
+ }
112
+ }
113
+ });
114
+ return extractedTest;
115
+ }
116
+ /**
117
+ * Finds a specific test case in the original code and replaces it with new code.
118
+ *
119
+ * @param sourceFile The TypeScript source file
120
+ * @param sourceCode The original source code string
121
+ * @param testName The name of the test to replace
122
+ * @param newTestCode The new test code to insert
123
+ * @returns The updated source code
124
+ */
125
+ static findAndReplaceTestCase(sourceFile, sourceCode, testName, newTestCode) {
126
+ let updatedCode = sourceCode;
127
+ typescript_1.default.forEachChild(sourceFile, (node) => {
128
+ if (updatedCode !== sourceCode)
129
+ return; // Already replaced
130
+ if (this.isTestNode(node)) {
131
+ const title = this.getTestTitle(node);
132
+ if (title && this.testTitleMatches(title, testName)) {
133
+ // Replace the test
134
+ updatedCode =
135
+ sourceCode.substring(0, node.pos) +
136
+ newTestCode +
137
+ sourceCode.substring(node.end);
138
+ }
139
+ }
140
+ });
141
+ return updatedCode;
142
+ }
143
+ /**
144
+ * Checks if a node is a test definition (test or it function call).
145
+ */
146
+ static isTestNode(node) {
147
+ return (typescript_1.default.isExpressionStatement(node) &&
148
+ typescript_1.default.isCallExpression(node.expression) &&
149
+ typescript_1.default.isIdentifier(node.expression.expression) &&
150
+ (node.expression.expression.text === 'test' ||
151
+ node.expression.expression.text === 'it'));
152
+ }
153
+ /**
154
+ * Gets the title string from a test node.
155
+ */
156
+ static getTestTitle(node) {
157
+ if (!this.isTestNode(node))
158
+ return null;
159
+ const callExpr = node
160
+ .expression;
161
+ const args = callExpr.arguments;
162
+ if (args.length >= 1 && typescript_1.default.isStringLiteral(args[0])) {
163
+ return args[0].text;
164
+ }
165
+ return null;
166
+ }
167
+ /**
168
+ * Checks if a test title matches the target test name.
169
+ */
170
+ static testTitleMatches(title, testName) {
171
+ return (title === testName || testName.includes(title) || title.includes(testName));
172
+ }
173
+ /**
174
+ * Updates a test file based on a Playwright JSON reporter output.
175
+ *
176
+ * @param jsonReportPath Path to the Playwright JSON report
177
+ * @param testFilePath Path to the test file to update (if not specified, will be extracted from the report)
178
+ * @param newTestCode The new test code
179
+ * @returns True if the update was successful, false otherwise
180
+ */
181
+ static async updateFromPlaywrightReport(jsonReportPath, newTestCode, testFilePath) {
182
+ try {
183
+ // Read and parse the Playwright report
184
+ const reportContent = await fs.promises.readFile(jsonReportPath, 'utf8');
185
+ const testResults = JSON.parse(reportContent);
186
+ // Extract failed test information
187
+ const failedTests = [];
188
+ for (const suite of testResults.suites || []) {
189
+ const file = suite.file;
190
+ for (const spec of suite.specs || []) {
191
+ if (!spec.ok) {
192
+ for (const test of spec.tests || []) {
193
+ if (!test.ok) {
194
+ failedTests.push({
195
+ file,
196
+ title: `${spec.title} ${test.title}`.trim(),
197
+ });
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ if (failedTests.length === 0) {
204
+ Logger_1.appLogger.warn('No failed tests found in the report');
205
+ return false;
206
+ }
207
+ // If test file path is not specified, use the first failed test's file
208
+ const targetTestFilePath = testFilePath || failedTests[0].file;
209
+ const targetTestName = failedTests[0].title;
210
+ if (!targetTestFilePath) {
211
+ Logger_1.appLogger.error('Could not determine test file path from report');
212
+ return false;
213
+ }
214
+ // Update the test file
215
+ return await this.updateTestCase(targetTestFilePath, targetTestName, newTestCode);
216
+ }
217
+ catch (error) {
218
+ Logger_1.appLogger.error(`Error updating from Playwright report:`, error);
219
+ return false;
220
+ }
221
+ }
222
+ }
223
+ exports.TestFileUpdater = TestFileUpdater;
224
+ //# sourceMappingURL=TestFileUpdater.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestFileUpdater.js","sourceRoot":"","sources":["../../../../src/lib/utils/TestFileUpdater.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,4DAA4B;AAC5B,+CAA+C;AAE/C;;GAEG;AACH,MAAa,eAAe;IAC1B;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,cAAc,CAChC,YAAoB,EACpB,QAAgB,EAChB,WAAmB;QAEnB,IAAI,CAAC;YACH,8BAA8B;YAC9B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBACjC,kBAAS,CAAC,KAAK,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;gBAC7D,OAAO,KAAK,CAAC;YAC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,CAAC;YAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,kBAAS,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;gBACtD,OAAO,KAAK,CAAC;YACf,CAAC;YAED,uEAAuE;YACvE,MAAM,kBAAkB,GAAG,YAAY,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC/D,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAE5C,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBACxB,kBAAS,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBAClE,OAAO,KAAK,CAAC;YACf,CAAC;YAED,uBAAuB;YACvB,OAAO,MAAM,IAAI,CAAC,cAAc,CAC9B,kBAAkB,EAClB,cAAc,EACd,WAAW,CACZ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,kBAAS,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;YACjE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AA7PD,0CA6PC"}
@@ -1,7 +1,3 @@
1
1
  import { DonobuStack } from '../../managers/DonobuStack';
2
- /**
3
- * Creates a snapshot of process.env as a Record<string, string>
4
- */
5
- export declare function getEnvSnapshot(): Record<string, string>;
6
2
  export declare function getOrCreateDonobuStack(): Promise<DonobuStack>;
7
3
  //# sourceMappingURL=donobuTestStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"donobuTestStack.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,4BAA4B,CAAC;AAO3E;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUvD;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,WAAW,CAAC,CAWnE"}
1
+ {"version":3,"file":"donobuTestStack.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,4BAA4B,CAAC;AAsB3E,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,WAAW,CAAC,CAWnE"}
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEnvSnapshot = getEnvSnapshot;
4
3
  exports.getOrCreateDonobuStack = getOrCreateDonobuStack;
5
4
  const DonobuStack_1 = require("../../managers/DonobuStack");
6
5
  const RequestContextHolder_1 = require("../../managers/RequestContextHolder");
@@ -1 +1 @@
1
- {"version":3,"file":"donobuTestStack.js","sourceRoot":"","sources":["../../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":";;AAUA,wCAUC;AAED,wDAWC;AAjCD,4DAA2E;AAC3E,8EAA2E;AAC3E,yFAAsF;AACtF,0FAAuF;AAEvF,IAAI,WAAW,GAA4B,SAAS,CAAC;AAErD;;GAEG;AACH,SAAgB,cAAc;IAC5B,MAAM,SAAS,GAA2B,EAAE,CAAC;IAE7C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC;AAEM,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,MAAM,IAAA,8BAAgB,EAClC,yDAA2B,CAAC,KAAK,EACjC,IAAI,2CAAoB,EAAE,EAC1B,IAAI,+CAAsB,CAAC,cAAc,EAAE,CAAC,CAC7C,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"donobuTestStack.js","sourceRoot":"","sources":["../../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":";;AAsBA,wDAWC;AAjCD,4DAA2E;AAC3E,8EAA2E;AAC3E,yFAAsF;AACtF,0FAAuF;AAEvF,IAAI,WAAW,GAA4B,SAAS,CAAC;AAErD;;GAEG;AACH,SAAS,cAAc;IACrB,MAAM,SAAS,GAA2B,EAAE,CAAC;IAE7C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC;AAEM,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,MAAM,IAAA,8BAAgB,EAClC,yDAA2B,CAAC,KAAK,EACjC,IAAI,2CAAoB,EAAE,EAC1B,IAAI,+CAAsB,CAAC,cAAc,EAAE,CAAC,CAC7C,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"selfHealing.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/selfHealing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,YAAY,GAC/B,OAAO,CAAC,IAAI,CAAC,CAqGf"}
1
+ {"version":3,"file":"selfHealing.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/selfHealing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAoDpD;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,YAAY,GAC/B,OAAO,CAAC,IAAI,CAAC,CA0Gf"}
@@ -2,8 +2,54 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.selfHeal = selfHeal;
4
4
  const donobuTestStack_1 = require("./donobuTestStack");
5
- const TestFileUpdater_1 = require("../../managers/TestFileUpdater");
5
+ const TestFileUpdater_1 = require("./TestFileUpdater");
6
6
  const Logger_1 = require("../../utils/Logger");
7
+ const AnalyzePageTextTool_1 = require("../../tools/AnalyzePageTextTool");
8
+ const AssertPageTextTool_1 = require("../../tools/AssertPageTextTool");
9
+ const AssertTool_1 = require("../../tools/AssertTool");
10
+ const ChangeWebBrowserTabTool_1 = require("../../tools/ChangeWebBrowserTabTool");
11
+ const ChooseSelectOptionTool_1 = require("../../tools/ChooseSelectOptionTool");
12
+ const ClickTool_1 = require("../../tools/ClickTool");
13
+ const CreateBrowserCookieReportTool_1 = require("../../tools/CreateBrowserCookieReportTool");
14
+ const DetectBrokenLinksTool_1 = require("../../tools/DetectBrokenLinksTool");
15
+ const GoForwardOrBackTool_1 = require("../../tools/GoForwardOrBackTool");
16
+ const GoToWebpageTool_1 = require("../../tools/GoToWebpageTool");
17
+ const HandleBrowserDialogTool_1 = require("../../tools/HandleBrowserDialogTool");
18
+ const HoverOverElementTool_1 = require("../../tools/HoverOverElementTool");
19
+ const InputRandomizedEmailAddressTool_1 = require("../../tools/InputRandomizedEmailAddressTool");
20
+ const InputTextTool_1 = require("../../tools/InputTextTool");
21
+ const MarkObjectiveCompleteTool_1 = require("../../tools/MarkObjectiveCompleteTool");
22
+ const MarkObjectiveNotCompletableTool_1 = require("../../tools/MarkObjectiveNotCompletableTool");
23
+ const PressKeyTool_1 = require("../../tools/PressKeyTool");
24
+ const RunAccessibilityTestTool_1 = require("../../tools/RunAccessibilityTestTool");
25
+ const ScrollPageTool_1 = require("../../tools/ScrollPageTool");
26
+ const SummarizeLearningsTool_1 = require("../../tools/SummarizeLearningsTool");
27
+ const WaitTool_1 = require("../../tools/WaitTool");
28
+ const SolveMfaChallenge_1 = require("../../tools/SolveMfaChallenge");
29
+ const DEFAULT_TOOLS_FOR_SELF_HEALING = [
30
+ AnalyzePageTextTool_1.AnalyzePageTextTool.NAME,
31
+ AssertTool_1.AssertTool.NAME,
32
+ AssertPageTextTool_1.AssertPageTextTool.NAME,
33
+ CreateBrowserCookieReportTool_1.CreateBrowserCookieReportTool.NAME,
34
+ ChangeWebBrowserTabTool_1.ChangeWebBrowserTabTool.NAME,
35
+ ChooseSelectOptionTool_1.ChooseSelectOptionTool.NAME,
36
+ ClickTool_1.ClickTool.NAME,
37
+ DetectBrokenLinksTool_1.DetectBrokenLinksTool.NAME,
38
+ GoForwardOrBackTool_1.GoForwardOrBackTool.NAME,
39
+ GoToWebpageTool_1.GoToWebpageTool.NAME,
40
+ HandleBrowserDialogTool_1.HandleBrowserDialogTool.NAME,
41
+ HoverOverElementTool_1.HoverOverElementTool.NAME,
42
+ InputRandomizedEmailAddressTool_1.InputRandomizedEmailAddressTool.NAME,
43
+ InputTextTool_1.InputTextTool.NAME,
44
+ MarkObjectiveCompleteTool_1.MarkObjectiveCompleteTool.NAME,
45
+ MarkObjectiveNotCompletableTool_1.MarkObjectiveNotCompletableTool.NAME,
46
+ PressKeyTool_1.PressKeyTool.NAME,
47
+ RunAccessibilityTestTool_1.RunAccessibilityTestTool.NAME,
48
+ SolveMfaChallenge_1.SolveMfaChallengeTool.NAME,
49
+ ScrollPageTool_1.ScrollPageTool.NAME,
50
+ SummarizeLearningsTool_1.SummarizeLearningsTool.NAME,
51
+ WaitTool_1.WaitTool.NAME,
52
+ ];
7
53
  /**
8
54
  * Self-heals a test that has failed by creating and running a new autonomous
9
55
  * flow using the same objective of the failed test. If the new flow is
@@ -26,6 +72,11 @@ async function selfHeal(gptClient, testInfo, donobuFlowMetadata) {
26
72
  testInfo.setTimeout(testInfo.timeout + selfHealTimeoutMs);
27
73
  Logger_1.appLogger.info(`Extending the test timeout ${selfHealTimeoutMs}ms for self-healing...`);
28
74
  Logger_1.appLogger.info('Attempting to self-heal by creating a new autonomous flow...');
75
+ // Always add the default tools to the allowed tools for self-healing.
76
+ const allowedTools = donobuFlowMetadata.allowedTools
77
+ ? [...donobuFlowMetadata.allowedTools, ...DEFAULT_TOOLS_FOR_SELF_HEALING]
78
+ : DEFAULT_TOOLS_FOR_SELF_HEALING;
79
+ // Create a new autonomous flow with the same objective as the failed test.
29
80
  const newFlow = await donobu.flowsManager.createFlow({
30
81
  targetWebsite: donobuFlowMetadata.targetWebsite,
31
82
  overallObjective: donobuFlowMetadata.overallObjective,
@@ -39,7 +90,7 @@ async function selfHeal(gptClient, testInfo, donobuFlowMetadata) {
39
90
  defaultMessageDuration: undefined,
40
91
  initialRunMode: 'AUTONOMOUS',
41
92
  isControlPanelEnabled: false,
42
- allowedTools: undefined,
93
+ allowedTools: allowedTools,
43
94
  toolCallsOnStart: undefined,
44
95
  resultJsonSchema: undefined,
45
96
  }, gptClient);
@@ -1 +1 @@
1
- {"version":3,"file":"selfHealing.js","sourceRoot":"","sources":["../../../../src/lib/utils/selfHealing.ts"],"names":[],"mappings":";;AAiBA,4BAyGC;AAvHD,uDAA2D;AAC3D,oEAAiE;AACjE,+CAA+C;A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E,CAAC;oBACzB,kBAAS,CAAC,KAAK,CACb,4BAA4B,YAAY,GAAG,EAC3C,eAAe,CAChB,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,kBAAS,CAAC,IAAI,CACZ,8DAA8D,CAC/D,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,kBAAS,CAAC,KAAK,CACb,0EAA0E,CAC3E,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kBAAS,CAAC,KAAK,CACb,uDAAuD,EACvD,KAAK,CACN,CAAC;QACF,OAAO;IACT,CAAC;AACH,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * A class that handles the updating of test files based on test failures.
3
+ */
4
+ export declare class TestFileUpdater {
5
+ /**
6
+ * Updates a specific test case in a test file with new test code.
7
+ *
8
+ * @param testFilePath The path to the test file to update
9
+ * @param testName The name of the test case to update
10
+ * @param newTestCode The new test code to replace the old test with
11
+ * @param options Options for updating the file
12
+ * @returns True if the update was successful, false otherwise
13
+ */
14
+ static updateTestCase(testFilePath: string, testName: string, newTestCode: string): Promise<boolean>;
15
+ /**
16
+ * Extracts a specific test case from source code.
17
+ *
18
+ * @param sourceFile The TypeScript source file
19
+ * @param sourceCode The original source code string
20
+ * @param testName The name of the test to extract
21
+ * @returns The extracted test code or null if not found
22
+ */
23
+ private static extractTestCase;
24
+ /**
25
+ * Finds a specific test case in the original code and replaces it with new code.
26
+ *
27
+ * @param sourceFile The TypeScript source file
28
+ * @param sourceCode The original source code string
29
+ * @param testName The name of the test to replace
30
+ * @param newTestCode The new test code to insert
31
+ * @returns The updated source code
32
+ */
33
+ private static findAndReplaceTestCase;
34
+ /**
35
+ * Checks if a node is a test definition (test or it function call).
36
+ */
37
+ private static isTestNode;
38
+ /**
39
+ * Gets the title string from a test node.
40
+ */
41
+ private static getTestTitle;
42
+ /**
43
+ * Checks if a test title matches the target test name.
44
+ */
45
+ private static testTitleMatches;
46
+ /**
47
+ * Updates a test file based on a Playwright JSON reporter output.
48
+ *
49
+ * @param jsonReportPath Path to the Playwright JSON report
50
+ * @param testFilePath Path to the test file to update (if not specified, will be extracted from the report)
51
+ * @param newTestCode The new test code
52
+ * @returns True if the update was successful, false otherwise
53
+ */
54
+ static updateFromPlaywrightReport(jsonReportPath: string, newTestCode: string, testFilePath?: string): Promise<boolean>;
55
+ }
56
+ //# sourceMappingURL=TestFileUpdater.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestFileUpdater.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/TestFileUpdater.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,qBAAa,eAAe;IAC1B;;;;;;;;OAQG;WACiB,cAAc,CAChC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC;IAuEnB;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAsB9B;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IA2BrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAUzB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAc3B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAM/B;;;;;;;OAOG;WACiB,0BAA0B,CAC5C,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC;CAmDpB"}
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.TestFileUpdater = void 0;
40
+ const fs = __importStar(require("fs"));
41
+ const typescript_1 = __importDefault(require("typescript"));
42
+ const Logger_1 = require("../../utils/Logger");
43
+ /**
44
+ * A class that handles the updating of test files based on test failures.
45
+ */
46
+ class TestFileUpdater {
47
+ /**
48
+ * Updates a specific test case in a test file with new test code.
49
+ *
50
+ * @param testFilePath The path to the test file to update
51
+ * @param testName The name of the test case to update
52
+ * @param newTestCode The new test code to replace the old test with
53
+ * @param options Options for updating the file
54
+ * @returns True if the update was successful, false otherwise
55
+ */
56
+ static async updateTestCase(testFilePath, testName, newTestCode) {
57
+ try {
58
+ // Verify the test file exists
59
+ if (!fs.existsSync(testFilePath)) {
60
+ Logger_1.appLogger.error(`Test file does not exist: ${testFilePath}`);
61
+ return false;
62
+ }
63
+ // Read the original test file
64
+ const originalTestCode = await fs.promises.readFile(testFilePath, 'utf8');
65
+ // Parse the original and new test code
66
+ const sourceFile = typescript_1.default.createSourceFile(testFilePath, originalTestCode, typescript_1.default.ScriptTarget.Latest, true);
67
+ const newTestSourceFile = typescript_1.default.createSourceFile('new-test.ts', newTestCode, typescript_1.default.ScriptTarget.Latest, true);
68
+ // Extract the new test case
69
+ const extractedNewTest = this.extractTestCase(newTestSourceFile, newTestCode, testName);
70
+ if (!extractedNewTest) {
71
+ Logger_1.appLogger.warn(`Could not extract the new test case "${testName}" from the provided code`);
72
+ await fs.promises.writeFile(testFilePath, newTestCode, 'utf8');
73
+ Logger_1.appLogger.info(`Replaced entire test file with new code`);
74
+ return true;
75
+ }
76
+ // Find and replace the old test case
77
+ const updatedCode = this.findAndReplaceTestCase(sourceFile, originalTestCode, testName, extractedNewTest);
78
+ if (updatedCode === originalTestCode) {
79
+ Logger_1.appLogger.warn(`Could not find the test case "${testName}" in the original file`);
80
+ await fs.promises.writeFile(testFilePath, newTestCode, 'utf8');
81
+ Logger_1.appLogger.info(`Replaced entire test file with new code`);
82
+ return true;
83
+ }
84
+ // Write the updated code back to the test file
85
+ await fs.promises.writeFile(testFilePath, updatedCode, 'utf8');
86
+ Logger_1.appLogger.info(`Successfully updated test case "${testName}" in ${testFilePath}`);
87
+ return true;
88
+ }
89
+ catch (error) {
90
+ Logger_1.appLogger.error(`Error updating test file ${testFilePath}:`, error);
91
+ return false;
92
+ }
93
+ }
94
+ /**
95
+ * Extracts a specific test case from source code.
96
+ *
97
+ * @param sourceFile The TypeScript source file
98
+ * @param sourceCode The original source code string
99
+ * @param testName The name of the test to extract
100
+ * @returns The extracted test code or null if not found
101
+ */
102
+ static extractTestCase(sourceFile, sourceCode, testName) {
103
+ let extractedTest = null;
104
+ typescript_1.default.forEachChild(sourceFile, (node) => {
105
+ if (extractedTest)
106
+ return; // Already found
107
+ if (this.isTestNode(node)) {
108
+ const title = this.getTestTitle(node);
109
+ if (title && this.testTitleMatches(title, testName)) {
110
+ extractedTest = sourceCode.substring(node.pos, node.end);
111
+ }
112
+ }
113
+ });
114
+ return extractedTest;
115
+ }
116
+ /**
117
+ * Finds a specific test case in the original code and replaces it with new code.
118
+ *
119
+ * @param sourceFile The TypeScript source file
120
+ * @param sourceCode The original source code string
121
+ * @param testName The name of the test to replace
122
+ * @param newTestCode The new test code to insert
123
+ * @returns The updated source code
124
+ */
125
+ static findAndReplaceTestCase(sourceFile, sourceCode, testName, newTestCode) {
126
+ let updatedCode = sourceCode;
127
+ typescript_1.default.forEachChild(sourceFile, (node) => {
128
+ if (updatedCode !== sourceCode)
129
+ return; // Already replaced
130
+ if (this.isTestNode(node)) {
131
+ const title = this.getTestTitle(node);
132
+ if (title && this.testTitleMatches(title, testName)) {
133
+ // Replace the test
134
+ updatedCode =
135
+ sourceCode.substring(0, node.pos) +
136
+ newTestCode +
137
+ sourceCode.substring(node.end);
138
+ }
139
+ }
140
+ });
141
+ return updatedCode;
142
+ }
143
+ /**
144
+ * Checks if a node is a test definition (test or it function call).
145
+ */
146
+ static isTestNode(node) {
147
+ return (typescript_1.default.isExpressionStatement(node) &&
148
+ typescript_1.default.isCallExpression(node.expression) &&
149
+ typescript_1.default.isIdentifier(node.expression.expression) &&
150
+ (node.expression.expression.text === 'test' ||
151
+ node.expression.expression.text === 'it'));
152
+ }
153
+ /**
154
+ * Gets the title string from a test node.
155
+ */
156
+ static getTestTitle(node) {
157
+ if (!this.isTestNode(node))
158
+ return null;
159
+ const callExpr = node
160
+ .expression;
161
+ const args = callExpr.arguments;
162
+ if (args.length >= 1 && typescript_1.default.isStringLiteral(args[0])) {
163
+ return args[0].text;
164
+ }
165
+ return null;
166
+ }
167
+ /**
168
+ * Checks if a test title matches the target test name.
169
+ */
170
+ static testTitleMatches(title, testName) {
171
+ return (title === testName || testName.includes(title) || title.includes(testName));
172
+ }
173
+ /**
174
+ * Updates a test file based on a Playwright JSON reporter output.
175
+ *
176
+ * @param jsonReportPath Path to the Playwright JSON report
177
+ * @param testFilePath Path to the test file to update (if not specified, will be extracted from the report)
178
+ * @param newTestCode The new test code
179
+ * @returns True if the update was successful, false otherwise
180
+ */
181
+ static async updateFromPlaywrightReport(jsonReportPath, newTestCode, testFilePath) {
182
+ try {
183
+ // Read and parse the Playwright report
184
+ const reportContent = await fs.promises.readFile(jsonReportPath, 'utf8');
185
+ const testResults = JSON.parse(reportContent);
186
+ // Extract failed test information
187
+ const failedTests = [];
188
+ for (const suite of testResults.suites || []) {
189
+ const file = suite.file;
190
+ for (const spec of suite.specs || []) {
191
+ if (!spec.ok) {
192
+ for (const test of spec.tests || []) {
193
+ if (!test.ok) {
194
+ failedTests.push({
195
+ file,
196
+ title: `${spec.title} ${test.title}`.trim(),
197
+ });
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ if (failedTests.length === 0) {
204
+ Logger_1.appLogger.warn('No failed tests found in the report');
205
+ return false;
206
+ }
207
+ // If test file path is not specified, use the first failed test's file
208
+ const targetTestFilePath = testFilePath || failedTests[0].file;
209
+ const targetTestName = failedTests[0].title;
210
+ if (!targetTestFilePath) {
211
+ Logger_1.appLogger.error('Could not determine test file path from report');
212
+ return false;
213
+ }
214
+ // Update the test file
215
+ return await this.updateTestCase(targetTestFilePath, targetTestName, newTestCode);
216
+ }
217
+ catch (error) {
218
+ Logger_1.appLogger.error(`Error updating from Playwright report:`, error);
219
+ return false;
220
+ }
221
+ }
222
+ }
223
+ exports.TestFileUpdater = TestFileUpdater;
224
+ //# sourceMappingURL=TestFileUpdater.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestFileUpdater.js","sourceRoot":"","sources":["../../../src/lib/utils/TestFileUpdater.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,4DAA4B;AAC5B,+CAA+C;AAE/C;;GAEG;AACH,MAAa,eAAe;IAC1B;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,cA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,IAAI,CAAC,EAAE,EAAE,CAAC;gCACb,WAAW,CAAC,IAAI,CAAC;oCACf,IAAI;oCACJ,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE;iCAC5C,CAAC,CAAC;4BACL,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,kBAAS,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;gBACtD,OAAO,KAAK,CAAC;YACf,CAAC;YAED,uEAAuE;YACvE,MAAM,kBAAkB,GAAG,YAAY,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC/D,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAE5C,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBACxB,kBAAS,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBAClE,OAAO,KAAK,CAAC;YACf,CAAC;YAED,uBAAuB;YACvB,OAAO,MAAM,IAAI,CAAC,cAAc,CAC9B,kBAAkB,EAClB,cAAc,EACd,WAAW,CACZ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,kBAAS,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;YACjE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AA7PD,0CA6PC"}
@@ -1,7 +1,3 @@
1
1
  import { DonobuStack } from '../../managers/DonobuStack';
2
- /**
3
- * Creates a snapshot of process.env as a Record<string, string>
4
- */
5
- export declare function getEnvSnapshot(): Record<string, string>;
6
2
  export declare function getOrCreateDonobuStack(): Promise<DonobuStack>;
7
3
  //# sourceMappingURL=donobuTestStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"donobuTestStack.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,4BAA4B,CAAC;AAO3E;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUvD;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,WAAW,CAAC,CAWnE"}
1
+ {"version":3,"file":"donobuTestStack.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,4BAA4B,CAAC;AAsB3E,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,WAAW,CAAC,CAWnE"}
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEnvSnapshot = getEnvSnapshot;
4
3
  exports.getOrCreateDonobuStack = getOrCreateDonobuStack;
5
4
  const DonobuStack_1 = require("../../managers/DonobuStack");
6
5
  const RequestContextHolder_1 = require("../../managers/RequestContextHolder");
@@ -1 +1 @@
1
- {"version":3,"file":"donobuTestStack.js","sourceRoot":"","sources":["../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":";;AAUA,wCAUC;AAED,wDAWC;AAjCD,4DAA2E;AAC3E,8EAA2E;AAC3E,yFAAsF;AACtF,0FAAuF;AAEvF,IAAI,WAAW,GAA4B,SAAS,CAAC;AAErD;;GAEG;AACH,SAAgB,cAAc;IAC5B,MAAM,SAAS,GAA2B,EAAE,CAAC;IAE7C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC;AAEM,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,MAAM,IAAA,8BAAgB,EAClC,yDAA2B,CAAC,KAAK,EACjC,IAAI,2CAAoB,EAAE,EAC1B,IAAI,+CAAsB,CAAC,cAAc,EAAE,CAAC,CAC7C,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"donobuTestStack.js","sourceRoot":"","sources":["../../../src/lib/utils/donobuTestStack.ts"],"names":[],"mappings":";;AAsBA,wDAWC;AAjCD,4DAA2E;AAC3E,8EAA2E;AAC3E,yFAAsF;AACtF,0FAAuF;AAEvF,IAAI,WAAW,GAA4B,SAAS,CAAC;AAErD;;GAEG;AACH,SAAS,cAAc;IACrB,MAAM,SAAS,GAA2B,EAAE,CAAC;IAE7C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC;AAEM,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,MAAM,IAAA,8BAAgB,EAClC,yDAA2B,CAAC,KAAK,EACjC,IAAI,2CAAoB,EAAE,EAC1B,IAAI,+CAAsB,CAAC,cAAc,EAAE,CAAC,CAC7C,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"selfHealing.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/selfHealing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,YAAY,GAC/B,OAAO,CAAC,IAAI,CAAC,CAqGf"}
1
+ {"version":3,"file":"selfHealing.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/selfHealing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAoDpD;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,YAAY,GAC/B,OAAO,CAAC,IAAI,CAAC,CA0Gf"}
@@ -2,8 +2,54 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.selfHeal = selfHeal;
4
4
  const donobuTestStack_1 = require("./donobuTestStack");
5
- const TestFileUpdater_1 = require("../../managers/TestFileUpdater");
5
+ const TestFileUpdater_1 = require("./TestFileUpdater");
6
6
  const Logger_1 = require("../../utils/Logger");
7
+ const AnalyzePageTextTool_1 = require("../../tools/AnalyzePageTextTool");
8
+ const AssertPageTextTool_1 = require("../../tools/AssertPageTextTool");
9
+ const AssertTool_1 = require("../../tools/AssertTool");
10
+ const ChangeWebBrowserTabTool_1 = require("../../tools/ChangeWebBrowserTabTool");
11
+ const ChooseSelectOptionTool_1 = require("../../tools/ChooseSelectOptionTool");
12
+ const ClickTool_1 = require("../../tools/ClickTool");
13
+ const CreateBrowserCookieReportTool_1 = require("../../tools/CreateBrowserCookieReportTool");
14
+ const DetectBrokenLinksTool_1 = require("../../tools/DetectBrokenLinksTool");
15
+ const GoForwardOrBackTool_1 = require("../../tools/GoForwardOrBackTool");
16
+ const GoToWebpageTool_1 = require("../../tools/GoToWebpageTool");
17
+ const HandleBrowserDialogTool_1 = require("../../tools/HandleBrowserDialogTool");
18
+ const HoverOverElementTool_1 = require("../../tools/HoverOverElementTool");
19
+ const InputRandomizedEmailAddressTool_1 = require("../../tools/InputRandomizedEmailAddressTool");
20
+ const InputTextTool_1 = require("../../tools/InputTextTool");
21
+ const MarkObjectiveCompleteTool_1 = require("../../tools/MarkObjectiveCompleteTool");
22
+ const MarkObjectiveNotCompletableTool_1 = require("../../tools/MarkObjectiveNotCompletableTool");
23
+ const PressKeyTool_1 = require("../../tools/PressKeyTool");
24
+ const RunAccessibilityTestTool_1 = require("../../tools/RunAccessibilityTestTool");
25
+ const ScrollPageTool_1 = require("../../tools/ScrollPageTool");
26
+ const SummarizeLearningsTool_1 = require("../../tools/SummarizeLearningsTool");
27
+ const WaitTool_1 = require("../../tools/WaitTool");
28
+ const SolveMfaChallenge_1 = require("../../tools/SolveMfaChallenge");
29
+ const DEFAULT_TOOLS_FOR_SELF_HEALING = [
30
+ AnalyzePageTextTool_1.AnalyzePageTextTool.NAME,
31
+ AssertTool_1.AssertTool.NAME,
32
+ AssertPageTextTool_1.AssertPageTextTool.NAME,
33
+ CreateBrowserCookieReportTool_1.CreateBrowserCookieReportTool.NAME,
34
+ ChangeWebBrowserTabTool_1.ChangeWebBrowserTabTool.NAME,
35
+ ChooseSelectOptionTool_1.ChooseSelectOptionTool.NAME,
36
+ ClickTool_1.ClickTool.NAME,
37
+ DetectBrokenLinksTool_1.DetectBrokenLinksTool.NAME,
38
+ GoForwardOrBackTool_1.GoForwardOrBackTool.NAME,
39
+ GoToWebpageTool_1.GoToWebpageTool.NAME,
40
+ HandleBrowserDialogTool_1.HandleBrowserDialogTool.NAME,
41
+ HoverOverElementTool_1.HoverOverElementTool.NAME,
42
+ InputRandomizedEmailAddressTool_1.InputRandomizedEmailAddressTool.NAME,
43
+ InputTextTool_1.InputTextTool.NAME,
44
+ MarkObjectiveCompleteTool_1.MarkObjectiveCompleteTool.NAME,
45
+ MarkObjectiveNotCompletableTool_1.MarkObjectiveNotCompletableTool.NAME,
46
+ PressKeyTool_1.PressKeyTool.NAME,
47
+ RunAccessibilityTestTool_1.RunAccessibilityTestTool.NAME,
48
+ SolveMfaChallenge_1.SolveMfaChallengeTool.NAME,
49
+ ScrollPageTool_1.ScrollPageTool.NAME,
50
+ SummarizeLearningsTool_1.SummarizeLearningsTool.NAME,
51
+ WaitTool_1.WaitTool.NAME,
52
+ ];
7
53
  /**
8
54
  * Self-heals a test that has failed by creating and running a new autonomous
9
55
  * flow using the same objective of the failed test. If the new flow is
@@ -26,6 +72,11 @@ async function selfHeal(gptClient, testInfo, donobuFlowMetadata) {
26
72
  testInfo.setTimeout(testInfo.timeout + selfHealTimeoutMs);
27
73
  Logger_1.appLogger.info(`Extending the test timeout ${selfHealTimeoutMs}ms for self-healing...`);
28
74
  Logger_1.appLogger.info('Attempting to self-heal by creating a new autonomous flow...');
75
+ // Always add the default tools to the allowed tools for self-healing.
76
+ const allowedTools = donobuFlowMetadata.allowedTools
77
+ ? [...donobuFlowMetadata.allowedTools, ...DEFAULT_TOOLS_FOR_SELF_HEALING]
78
+ : DEFAULT_TOOLS_FOR_SELF_HEALING;
79
+ // Create a new autonomous flow with the same objective as the failed test.
29
80
  const newFlow = await donobu.flowsManager.createFlow({
30
81
  targetWebsite: donobuFlowMetadata.targetWebsite,
31
82
  overallObjective: donobuFlowMetadata.overallObjective,
@@ -39,7 +90,7 @@ async function selfHeal(gptClient, testInfo, donobuFlowMetadata) {
39
90
  defaultMessageDuration: undefined,
40
91
  initialRunMode: 'AUTONOMOUS',
41
92
  isControlPanelEnabled: false,
42
- allowedTools: undefined,
93
+ allowedTools: allowedTools,
43
94
  toolCallsOnStart: undefined,
44
95
  resultJsonSchema: undefined,
45
96
  }, gptClient);
@@ -1 +1 @@
1
- {"version":3,"file":"selfHealing.js","sourceRoot":"","sources":["../../../src/lib/utils/selfHealing.ts"],"names":[],"mappings":";;AAiBA,4BAyGC;AAvHD,uDAA2D;AAC3D,oEAAiE;AACjE,+CAA+C;AAE/C;;;;;;;;;GASG;AACI,KAAK,UAAU,QAAQ,CAC5B,SAAoB,EACpB,QAAkB,EAClB,kBAAgC;IAEhC,IAAI,CAAC,kBAAkB,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,CAAC;QAChE,6DAA6D;QAC7D,kBAAS,CAAC,IAAI,CACZ,kFAAkF,CACnF,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,wCAAsB,GAAE,CAAC;QAC9C,MAAM,iBAAiB,GAAG,MAAM,CAAC,CAAC,YAAY;QAC9C,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,GAAG,iBAAiB,CAAC,CAAC;QAC1D,kBAAS,CAAC,IAAI,CACZ,8BAA8B,iBAAiB,wBAAwB,CACxE,CAAC;QACF,kBAAS,CAAC,IAAI,CACZ,8DAA8D,CAC/D,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAClD;YACE,aAAa,EAAE,kBAAkB,CAAC,aAAa;YAC/C,gBAAgB,EAAE,kBAAkB,CAAC,gBAAgB;YACrD,IAAI,EAAE,kBAAkB,CAAC,IAAI,IAAI,SAAS;YAC1C,OAAO,EAAE,kBAAkB,CAAC,OAAO;YACnC,OAAO,EAAE,kBAAkB,CAAC,OAAO,IAAI,SAAS;YAChD,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,kBAAkB,CAAC,WAAW,IAAI,SAAS;YACxD,aAAa,EAAE,EAAE;YACjB,qBAAqB,EAAE,SAAS;YAChC,sBAAsB,EA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AAW,CACZ,CAAC;oBAEF,IAAI,aAAa,EAAE,CAAC;wBAClB,kBAAS,CAAC,IAAI,CACZ,sDAAsD,CACvD,CAAC;oBACJ,CAAC;yBAAM,CAAC;wBACN,kBAAS,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;oBACpE,CAAC;gBACH,CAAC;gBAAC,OAAO,eAAe,EAAE,CAAC;oBACzB,kBAAS,CAAC,KAAK,CACb,4BAA4B,YAAY,GAAG,EAC3C,eAAe,CAChB,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,kBAAS,CAAC,IAAI,CACZ,8DAA8D,CAC/D,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,kBAAS,CAAC,KAAK,CACb,0EAA0E,CAC3E,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kBAAS,CAAC,KAAK,CACb,uDAAuD,EACvD,KAAK,CACN,CAAC;QACF,OAAO;IACT,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "donobu",
3
- "version": "2.18.0",
3
+ "version": "2.18.1",
4
4
  "description": "Create browser automations with an LLM agent and replay them as Playwright scripts.",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/esm/main.js",