fix(tests): Correct core tests and consolidate test structure#18
Merged
fix(tests): Correct core tests and consolidate test structure#18
Conversation
- Fixes execution failures in `tests/test_omnimcp_core.py` by:
- Correcting logic in `VisualState.find_element` to handle zero-score matches appropriately.
- Casting NumPy boolean result to standard Python bool in `OmniMCP._verify_action`.
- Consolidates test file structure and helper functions:
- Moves helper functions (`generate_test_ui`, `generate_action_test_pair`) into `omnimcp/testing_utils.py`.
- Updates imports in `tests/test_omnimcp.py` and `tests/test_omnimcp_core.py` to use `omnimcp.testing_utils`.
- Removes the `omnimcp/tests/` directory and the redundant `tests/synthetic_ui_helpers.py` file.
- Moves CI testing strategy document to `docs/testing_strategy.md`.
Non-e2e tests (`test_core.py`, `test_mapper.py`, `test_omnimcp_core.py`) now pass.
E2E tests remain skipped/commented out (tracked in separate TODOs).
- Fixes `ImportError: this platform is not supported` failure in `tests/test_omnimcp_core.py::test_action_verification` when run in headless environments (like CI). - Mocks `MouseController` and `KeyboardController` using `@patch` during `OmniMCP` instantiation within this specific test. - This prevents `pynput` initialization errors, as the test only verifies image diff logic and doesn't require real input control. - All non-skipped tests collected by `pytest tests/` now pass.
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.
Fixes execution failures in
tests/test_omnimcp_core.pyby:VisualState.find_elementto handle zero-score matches appropriately.OmniMCP._verify_action.Consolidates test file structure and helper functions:
generate_test_ui,generate_action_test_pair) intoomnimcp/testing_utils.py.tests/test_omnimcp.pyandtests/test_omnimcp_core.pyto useomnimcp.testing_utils.omnimcp/tests/directory and the redundanttests/synthetic_ui_helpers.pyfile.Moves CI testing strategy document to
docs/testing_strategy.md.Non-e2e tests (
test_core.py,test_mapper.py,test_omnimcp_core.py) now pass. E2E tests remain skipped/commented out (tracked in separate TODOs).