Add interactive step testing to Tool Builder
- New TestStepDialog for testing individual steps from the GUI - Test button in Tool Builder to test selected step - Auto-detects variables from step templates - Multiple assertion types: not_empty, contains, valid_json, matches_regex, min/max_length, equals, valid_python - Background execution with timing metrics - Provider override option for testing with mock provider - Output variable display and assertion pass/fail results Completes M5: Testing & Polish milestone (100%) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
@@ -233,6 +233,12 @@ class ToolBuilderPage(QWidget):
|
||||
self.btn_edit_step.clicked.connect(self._edit_step)
|
||||
steps_btns.addWidget(self.btn_edit_step)
|
||||
|
||||
self.btn_test_step = QPushButton("Test")
|
||||
self.btn_test_step.setObjectName("secondary")
|
||||
self.btn_test_step.setToolTip("Test the selected step with custom input")
|
||||
self.btn_test_step.clicked.connect(self._test_step)
|
||||
steps_btns.addWidget(self.btn_test_step)
|
||||
|
||||
self.btn_del_step = QPushButton("Delete")
|
||||
self.btn_del_step.setObjectName("danger")
|
||||
self.btn_del_step.setToolTip("Delete the selected step")
|
||||
@@ -691,6 +697,21 @@ class ToolBuilderPage(QWidget):
|
||||
self._add_tool_dependency(new_step.tool)
|
||||
self._refresh_steps()
|
||||
|
||||
def _test_step(self):
|
||||
"""Test the selected step with custom input."""
|
||||
items = self.steps_list.selectedItems()
|
||||
if not items:
|
||||
QMessageBox.information(self, "Test Step", "Please select a step to test")
|
||||
return
|
||||
|
||||
step = items[0].data(Qt.UserRole)
|
||||
idx = self.steps_list.row(items[0])
|
||||
available_vars = self._get_available_vars(up_to_step=idx)
|
||||
|
||||
from ..dialogs.test_step_dialog import TestStepDialog
|
||||
dialog = TestStepDialog(self, step, available_vars=available_vars)
|
||||
dialog.exec()
|
||||
|
||||
def _delete_step(self):
|
||||
"""Delete selected step."""
|
||||
items = self.steps_list.selectedItems()
|
||||
|
||||
Reference in New Issue
Block a user