Skip to content

Commit

Permalink
Refactor TestRunner: Move AI processing logic to a more appropriate l… (
Browse files Browse the repository at this point in the history
#248)

…ocation

Fixes #247
  • Loading branch information
PedroAVJ authored Jan 2, 2025
1 parent 02f111f commit 007ecf8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/shortest/src/core/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ export class TestRunner {
}
}

// Execute test with enhanced prompt
const result = await aiClient.processAction(prompt, browserTool);

if (!result) {
throw new Error("AI processing failed: no result returned");
}

// Execute before function if present
if (test.beforeFn) {
try {
Expand All @@ -274,6 +267,13 @@ export class TestRunner {
}
}

// Execute test with enhanced prompt
const result = await aiClient.processAction(prompt, browserTool);

if (!result) {
throw new Error("AI processing failed: no result returned");
}

// Parse AI result first
const finalMessage = result.finalResponse.content.find(
(block) =>
Expand Down

0 comments on commit 007ecf8

Please sign in to comment.