testchimp-runner-core 0.0.30 → 0.0.32
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/dist/execution-service.d.ts.map +1 -1
- package/dist/execution-service.js +101 -56
- package/dist/execution-service.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +2 -6
- package/dist/prompts.js.map +1 -1
- package/dist/scenario-worker-class.d.ts.map +1 -1
- package/dist/scenario-worker-class.js +9 -3
- package/dist/scenario-worker-class.js.map +1 -1
- package/dist/types.d.ts +11 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/execution-service.ts +103 -58
- package/src/index.ts +2 -0
- package/src/scenario-worker-class.ts +10 -3
- package/src/types.ts +16 -8
- package/testchimp-runner-core-0.0.27.tgz +0 -0
|
@@ -1047,8 +1047,15 @@ export class ScenarioWorker extends EventEmitter {
|
|
|
1047
1047
|
context: any,
|
|
1048
1048
|
command: string
|
|
1049
1049
|
): Promise<void> {
|
|
1050
|
-
//
|
|
1051
|
-
|
|
1050
|
+
// Detect if command contains navigation or load state operations that need longer timeout
|
|
1051
|
+
const needsLongerTimeout = command.includes('waitForLoadState') ||
|
|
1052
|
+
command.includes('goto(') ||
|
|
1053
|
+
command.includes('waitForURL') ||
|
|
1054
|
+
command.includes('waitForNavigation');
|
|
1055
|
+
|
|
1056
|
+
// Use appropriate timeout based on operation type
|
|
1057
|
+
const timeout = needsLongerTimeout ? 30000 : 5000;
|
|
1058
|
+
page.setDefaultTimeout(timeout);
|
|
1052
1059
|
|
|
1053
1060
|
try {
|
|
1054
1061
|
// Execute command directly without validation
|
|
@@ -1063,7 +1070,7 @@ export class ScenarioWorker extends EventEmitter {
|
|
|
1063
1070
|
await commandFunction(page, browser, context, expect);
|
|
1064
1071
|
|
|
1065
1072
|
} finally {
|
|
1066
|
-
//
|
|
1073
|
+
// Reset to default timeout for element operations
|
|
1067
1074
|
page.setDefaultTimeout(5000);
|
|
1068
1075
|
}
|
|
1069
1076
|
}
|
package/src/types.ts
CHANGED
|
@@ -170,14 +170,21 @@ export interface ScriptExecutionRequest {
|
|
|
170
170
|
script?: string; // Optional if scriptFilePath is provided
|
|
171
171
|
scriptFilePath?: string; // Path to script file (alternative to script content)
|
|
172
172
|
mode: ExecutionMode;
|
|
173
|
-
|
|
173
|
+
repairFlexibility?: number; // 0-5, defaults to 3
|
|
174
174
|
playwrightConfig?: PlaywrightConfig;
|
|
175
175
|
playwrightConfigFilePath?: string; // Path to playwright config file (alternative to playwrightConfig content)
|
|
176
176
|
model?: string;
|
|
177
177
|
headless?: boolean; // defaults to false (headed)
|
|
178
|
-
|
|
178
|
+
deflakeRunCount?: number; // Number of deflake attempts (defaults to 0, no deflaking)
|
|
179
179
|
jobId?: string; // Optional job ID for progress tracking
|
|
180
180
|
|
|
181
|
+
// For RUN_WITH_AI_REPAIR mode: whether to attempt runExactly first
|
|
182
|
+
attemptRunExactlyFirst?: boolean; // defaults to false
|
|
183
|
+
|
|
184
|
+
// For RUN_WITH_AI_REPAIR mode: pre-parsed steps (if provided, skip parsing)
|
|
185
|
+
// This preserves step IDs from sources like canonical trees
|
|
186
|
+
steps?: ScriptStep[]; // Optional pre-parsed steps with IDs
|
|
187
|
+
|
|
181
188
|
// Optional: Provide existing browser/page/context (for server-side usage)
|
|
182
189
|
// If not provided, runner-core will create its own
|
|
183
190
|
existingBrowser?: any; // Browser instance
|
|
@@ -189,13 +196,13 @@ export interface ScriptExecutionRequest {
|
|
|
189
196
|
* Script execution response with repair information
|
|
190
197
|
*/
|
|
191
198
|
export interface ScriptExecutionResponse {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
199
|
+
runStatus: 'success' | 'failed';
|
|
200
|
+
repairStatus?: 'success' | 'failed' | 'partial';
|
|
201
|
+
repairConfidence?: number; // 0-5
|
|
202
|
+
repairAdvice?: string;
|
|
203
|
+
updatedScript?: string;
|
|
197
204
|
executionTime: number;
|
|
198
|
-
|
|
205
|
+
numDeflakeRuns?: number; // Number of deflaking runs made (excluding original run)
|
|
199
206
|
error?: string;
|
|
200
207
|
}
|
|
201
208
|
|
|
@@ -203,6 +210,7 @@ export interface ScriptExecutionResponse {
|
|
|
203
210
|
* Individual script step for AI repair
|
|
204
211
|
*/
|
|
205
212
|
export interface ScriptStep {
|
|
213
|
+
id?: string; // Optional step ID (preserved from source, e.g., canonical tree)
|
|
206
214
|
description: string;
|
|
207
215
|
code: string;
|
|
208
216
|
success?: boolean;
|
|
Binary file
|