Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

tests sync client auth

Nick Sweetinga1144052ad81
diff --git a/tests/ci/test_browser_session_element_cache.py b/tests/ci/test_browser_session_element_cache.py
index b25a86372..2e26f7bdb 100644
--- a/tests/ci/test_browser_session_element_cache.py
+++ b/tests/ci/test_browser_session_element_cache.py
@@ -372,10 +372,8 @@ async def test_assumption_9_pydantic_private_attrs(browser_session, controller,
f'8. Extracted has _cached_browser_state_summary attr: {hasattr(extracted_browser_session, "_cached_browser_state_summary") if extracted_browser_session else False}'
)
- if hasattr(extracted_browser_session, '_cached_browser_state_summary'):
- print(
- f'9. Extracted _cached_browser_state_summary value: {extracted_browser_session._cached_browser_state_summary if extracted_browser_session else None}'
- )
+ if extracted_browser_session and hasattr(extracted_browser_session, '_cached_browser_state_summary'):
+ print(f'9. Extracted _cached_browser_state_summary value: {extracted_browser_session._cached_browser_state_summary}')
@pytest.mark.asyncio
@@ -406,7 +404,7 @@ async def test_assumption_7_cache_gets_cleared(browser_session, controller, http
cache_exists = browser_session._cached_browser_state_summary is not None
if cache_exists and browser_session._cached_browser_state_summary:
- cache_size = len(browser_session._cached_browser_state_summary.selector_map)
+ cache_size = len(browser_session._cached_browser_state_summary.selector_map) # type: ignore
else:
cache_size = 0
return ActionResult(
@@ -420,7 +418,7 @@ async def test_assumption_7_cache_gets_cleared(browser_session, controller, http
cache_exists = browser_session._cached_browser_state_summary is not None
if cache_exists and browser_session._cached_browser_state_summary:
- cache_size = len(browser_session._cached_browser_state_summary.selector_map)
+ cache_size = len(browser_session._cached_browser_state_summary.selector_map) # type: ignore
else:
cache_size = 0
return ActionResult(
diff --git a/tests/ci/test_browser_session_tab_management.py b/tests/ci/test_browser_session_tab_management.py
index 10ba87043..87a6c726e 100644
--- a/tests/ci/test_browser_session_tab_management.py
+++ b/tests/ci/test_browser_session_tab_management.py
@@ -114,7 +114,7 @@ class TestTabManagement:
# close all existing tabs
if browser_session.browser_context:
- for page in browser_session.browser_context.pages:
+ for page in browser_session.browser_context.pages: # type: ignore
await page.close()
await asyncio.sleep(0.5)
diff --git a/tests/ci/test_sync_client_auth.py b/tests/ci/test_sync_client_auth.py
index d62a30354..7e51e329a 100644
--- a/tests/ci/test_sync_client_auth.py
+++ b/tests/ci/test_sync_client_auth.py
@@ -434,7 +434,6 @@ class TestCloudSync:
assert event['event_type'] == 'CreateAgentTaskEvent'
assert event['user_id'] == TEMP_USER_ID
assert event['task'] == 'Test task'
- assert event['status'] == 'running'
async def test_authenticate_and_resend(self, httpserver: HTTPServer, temp_config_dir):
"""Test authentication flow with pre-auth event resending."""