Improvements in AI Scriptless testing#23
Open
3dgiordano wants to merge 10 commits into
Open
Conversation
Set version 1.0.1
Enable Docker to always pull the latest images
Baraujo25
reviewed
Jun 18, 2026
Collaborator
There was a problem hiding this comment.
What do you think about adding tests to verify correct behaviour? I see that we have a lot of logic with nodes manipulation, navigations in between elements, persistance. Feel like a lot of responsibilities.
I attempted to create a modularization resulting in a responsibility delegation and this is the result 👇 what do you think?
Collaborator
There was a problem hiding this comment.
I was able to create the mermaid for this, it could be useful for quick refactor in case you agree on changes:
classDiagram
class AiScriptlessManager {
+list_commands()
+view_test_structure()
+add_command()
+move_command()
+save_test()
}
class ScriptMutationService {
+load_and_mutate()
+script_write_lock()
}
class ScriptRepository {
+fetch_script_payload()
+persist_script()
+fetch_current_username()
}
class ScriptTree {
+find_element_by_path()
+find_step_path_for_element()
+insert_flow_element()
+move_element_by_path()
+delete_element_by_path()
+set_element_enabled()
}
class ScriptBuilders {
+build_flow_element()
+build_if_statement()
+build_loop()
+build_logical_step()
+build_arguments()
}
class ScriptVariables {
+add_script_variable()
+modify_script_variable()
+delete_script_variable()
+validate_variable_name()
+build_variable_data()
}
class ScriptPaths {
+build_item_key()
+split_item_key()
+format_test_ui_location()
+validate_step_path()
}
AiScriptlessManager --> ScriptMutationService : orchestrates edits
AiScriptlessManager --> ScriptRepository : reads / saves
AiScriptlessManager --> ScriptBuilders : creates elements
AiScriptlessManager --> ScriptVariables : variable operations
AiScriptlessManager --> ScriptPaths : itemKey / path helpers
ScriptMutationService --> ScriptRepository : fetch + persist
ScriptMutationService --> ScriptTree : apply mutations
ScriptTree --> ScriptPaths : validates step_path
```
Baraujo25
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces substantial enhancements and new functionality for handling AI Scriptless test data, command catalogs, and related API endpoints. The main changes include the addition of new utility functions for API endpoints, a comprehensive set of data models for AI Scriptless entities, and new formatters for transforming and presenting test, variable, snapshot, and command definition data. Additionally, improvements were made to utility functions to handle JSON decoding more robustly.
API Endpoint Utilities:
config/perfecto.pyto generate URLs for AI Scriptless draft management, command repository, and repository management APIs, supporting new backend integrations.AI Scriptless Data Models:
models/ai_scriptless.pycontaining Pydantic models for representing script flow elements, test structures, command catalog entries, variables, snapshots, and command definitions. These models provide a structured and type-safe way to handle AI Scriptless test data.AI Scriptless Formatters:
formatters/ai_scriptless.pythat includes:Utility Improvements:
api_requestfunction intools/utils.pyto more gracefully handle empty or non-JSON responses by returning the raw text if JSON decoding fails, improving robustness when dealing with diverse API responses. [1] [2]