mirror of
https://github.com/browser-use/browser-use
synced 2026-04-22 17:45:09 +02:00
fixed styling issues
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
default_language_version:
|
||||
python: python3.11
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/asottile/yesqa
|
||||
rev: v1.5.0
|
||||
|
||||
@@ -925,8 +925,7 @@ class BrowserSession(BaseModel):
|
||||
)
|
||||
except TimeoutError:
|
||||
duration_ms = (asyncio.get_event_loop().time() - nav_start_time) * 1000
|
||||
self.logger.warning(f'⚠️ Page.navigate() timed out after {nav_timeout}s ({duration_ms:.0f}ms) for {url}')
|
||||
return
|
||||
raise RuntimeError(f'Page.navigate() timed out after {nav_timeout}s ({duration_ms:.0f}ms) for {url}')
|
||||
|
||||
if nav_result.get('errorText'):
|
||||
raise RuntimeError(f'Navigation failed: {nav_result["errorText"]}')
|
||||
|
||||
@@ -21,7 +21,6 @@ from browser_use.browser.events import NavigateToUrlEvent
|
||||
from browser_use.browser.profile import BrowserProfile
|
||||
from tests.ci.conftest import create_mock_llm
|
||||
|
||||
|
||||
HEAVY_PDP_HTML = """
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -76,9 +75,7 @@ def heavy_base_url(heavy_page_server):
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
async def browser_session():
|
||||
session = BrowserSession(
|
||||
browser_profile=BrowserProfile(headless=True, user_data_dir=None, keep_alive=True)
|
||||
)
|
||||
session = BrowserSession(browser_profile=BrowserProfile(headless=True, user_data_dir=None, keep_alive=True))
|
||||
await session.start()
|
||||
yield session
|
||||
await session.kill()
|
||||
@@ -109,7 +106,6 @@ def _nav_actions(url: str, msg: str = 'Done') -> list[str]:
|
||||
|
||||
|
||||
class TestHeavyPageNavigation:
|
||||
|
||||
async def test_slow_server_response_completes(self, browser_session, heavy_base_url):
|
||||
"""Navigation succeeds even when server takes 6s to respond."""
|
||||
url = f'{heavy_base_url}/slow-server-pdp'
|
||||
@@ -189,6 +185,4 @@ class TestHeavyPageNavigation:
|
||||
"""event_timeout should be >= 30s to handle slow servers + redirect chains."""
|
||||
event = NavigateToUrlEvent(url='http://example.com')
|
||||
assert event.event_timeout is not None
|
||||
assert event.event_timeout >= 30.0, (
|
||||
f'event_timeout={event.event_timeout}s is too low for heavy pages (need >= 30s)'
|
||||
)
|
||||
assert event.event_timeout >= 30.0, f'event_timeout={event.event_timeout}s is too low for heavy pages (need >= 30s)'
|
||||
|
||||
Reference in New Issue
Block a user