feat: synthetic config, screenshot streaming is not called when False…#128
Draft
davidamo9 wants to merge 2 commits intomozarkai:mainfrom
Draft
feat: synthetic config, screenshot streaming is not called when False…#128davidamo9 wants to merge 2 commits intomozarkai:mainfrom
davidamo9 wants to merge 2 commits intomozarkai:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a synthetic configuration flag to control whether screenshot streaming or single captures are used, centralizes StrategyManager instantiation in the builder, and updates API clients to use the shared instance.
- Introduce
syntheticflag and helperget_test_mode()to toggle streaming vs single-frame screenshot logic. - Update
LocatorStrategy.assert_elementsmethods to branch onsynthetic, using streaming whenTrueand single-capture whenFalse. - Add
get_strategy_manager()toOpticsBuilderand updateVerifierandActionKeywordto use the builder‐providedStrategyManager.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| common/strategies.py | Added get_test_mode, synthetic branch in assert_elements, and timestamp/annotation variables. |
| common/optics_builder.py | Added _strategy_manager cache, get_strategy_manager() method. |
| common/config_handler.py | Added synthetic: bool to the config model. |
| api/verifier.py | Switched to builder.get_strategy_manager() instead of direct instantiation. |
| api/action_keyword.py | Same change: use builder.get_strategy_manager(). |
Comments suppressed due to low confidence (4)
optics_framework/common/strategies.py:15
- [nitpick] The function name
get_test_modemay be misleading since the config flag is namedsynthetic. Consider renaming this tois_synthetic_modeoruse_synthetic_modefor clarity and consistency.
def get_test_mode() -> bool:
optics_framework/common/optics_builder.py:64
- The docstring mentions raising a
ValueErrorif configurations are missing, but there is no validation in the method. Either implement the checks or update the docstring to match the actual behavior.
def get_strategy_manager(self):
optics_framework/common/config_handler.py:52
- The new
syntheticfield should be documented in the project's configuration reference or README so users know its effect and default value.
synthetic: bool = False
optics_framework/common/strategies.py:15
- There are no existing tests covering the new
get_test_mode()helper or the synthetic vs non-synthetic branches inassert_elements. Add unit tests to ensure both flows behave as expected.
def get_test_mode() -> bool:
3f397b6 to
529f448
Compare
…, single StrategyManager for ActionKeyword and Verifier
529f448 to
6c09ef5
Compare
|
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.



…, single StrategyManager for ActionKeyword and Verifier