test(tools): comprehensive test suite for browser_utils module (+107 tests) - #153
Open
manus-use wants to merge 1 commit into
Open
test(tools): comprehensive test suite for browser_utils module (+107 tests)#153manus-use wants to merge 1 commit into
manus-use wants to merge 1 commit into
Conversation
This was referenced Aug 10, 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.
Summary
Adds a comprehensive test suite for the
manus_agent.tools.browser_utilsmodule — 107 fully-mocked tests covering the entire public API surface.What's tested
BrowserTimeoutErrormake_dom_read_script_null_safenormalize_evaluate_scriptprepare_evaluate_scriptnormalize_browser_selectoris_selector_syntax_erroris_probably_raw_text_pageextract_raw_page_textget_text_with_fallbackget_html_with_fallbackfind_best_content_selectorextract_page_textformat_browser_errorWhy this module
browser_utils.py(287 lines) is the foundational utility layer for all browser-related tools — it handles timeout management, selector normalization, evaluate script preparation, fallback logic, and raw-text page detection. Despite being imported by bothuse_browser_patch.pyandbrowser_tools.py, it had virtually zero dedicated test coverage (only a single import reference intest_tools.py).Testing approach
pytest.mark.asyncioTimeoutErrorproperly simulatedAsyncMockfor realistic async behaviorOpen PRs checked (no overlap)
This PR tests
browser_utils.py— none of the following open PRs cover this module:Test results
(Baseline: 1158 + 107 new = 1265 total, 0 failures)