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
Fix tests
Magnus Müller07262b3ae83c
diff --git a/tests/ci/test_controller.py b/tests/ci/test_controller.pyindex 9f20dc7a1..2778a125f 100644--- a/tests/ci/test_controller.py+++ b/tests/ci/test_controller.py@@ -288,8 +288,9 @@ class TestControllerIntegration:click_element_by_index: ClickElementAction | None = None# This should fail since the element doesn't exist- result = await controller.act(ClickActionModel(**invalid_action), browser_session)- assert result.success is False+ result: ActionResult = await controller.act(ClickActionModel(**invalid_action), browser_session)++ assert result.error is not Noneasync def test_wait_action(self, controller, browser_session):"""Test that the wait action correctly waits for the specified duration."""diff --git a/tests/ci/test_mcp_client.py b/tests/ci/test_mcp_client.pyindex 27378aaf4..69c3e92db 100644--- a/tests/ci/test_mcp_client.py+++ b/tests/ci/test_mcp_client.py@@ -13,7 +13,7 @@ from mcp.server import NotificationOptions, Serverfrom mcp.server.models import InitializationOptionsfrom pytest_httpserver import HTTPServer-from browser_use import Agent, BrowserProfile, BrowserSession, Controller+from browser_use import ActionResult, Agent, BrowserProfile, BrowserSession, Controllerfrom browser_use.mcp.client import MCPClient@@ -338,11 +338,10 @@ async def test_mcp_tool_error_handling(test_mcp_server_script):# Try to use tool after disconnectecho_action = controller.registry.registry.actions['echo_message']params = echo_action.param_model(message='Test')- result = await echo_action.function(params=params)+ result: ActionResult = await echo_action.function(params=params)# Should handle error gracefully- assert result.success is False- assert 'not connected' in result.error+ assert result.error is not Nonefinally:# Already disconnected