Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Style: Fix linting in test file
Gaurav Rawat64342623cbc4
diff --git a/tests/ci/test_element_click_error.py b/tests/ci/test_element_click_error.pyindex 2921c712c..20a6e70f2 100644--- a/tests/ci/test_element_click_error.py+++ b/tests/ci/test_element_click_error.py@@ -38,12 +38,16 @@ class TestElementClickErrorMessage:)# First CDP call (scroll into view) fails with outer error- outer_error_msg = 'OUTER_SCROLL_ERROR'- mock_client.send.DOM.scrollIntoViewIfNeeded = AsyncMock(side_effect=Exception(outer_error_msg))+ outer_error_msg = "OUTER_SCROLL_ERROR"+ mock_client.send.DOM.scrollIntoViewIfNeeded = AsyncMock(+ side_effect=Exception(outer_error_msg)+ )# Second CDP call (resolve node for JS fallback) fails with different error- js_error_msg = 'INNER_JS_RESOLVE_ERROR'- mock_client.send.DOM.resolveNode = AsyncMock(side_effect=Exception(js_error_msg))+ js_error_msg = "INNER_JS_RESOLVE_ERROR"+ mock_client.send.DOM.resolveNode = AsyncMock(+ side_effect=Exception(js_error_msg)+ )# Try to click - should failwith pytest.raises(Exception) as exc_info:@@ -53,14 +57,14 @@ class TestElementClickErrorMessage:# THE BUG: Currently line 347 raises with {e} (outer exception)# After fix: should raise with {js_e} (actual JS click failure)- print(f'Error message: {error_message}')+ print(f"Error message: {error_message}")print(f"Contains outer error '{outer_error_msg}': {outer_error_msg in error_message}")print(f"Contains inner error '{js_error_msg}': {js_error_msg in error_message}")# This assertion FAILS with the bug, PASSES after fixassert js_error_msg in error_message, (- f'BUG DETECTED: Error message shows wrong exception!\n'+ f"BUG DETECTED: Error message shows wrong exception!\n"f"Expected to see JS error: '{js_error_msg}'\n"- f'But got: {error_message}\n'- f'This confirms line 347 bug: uses {{e}} instead of {{js_e}}'+ f"But got: {error_message}\n"+ f"This confirms line 347 bug: uses {{e}} instead of {{js_e}}")