Skip to content

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

Fix linter

Magnus Müller8daca5358972
diff --git a/tests/ci/test_browser_event_ScrollEvent.py b/tests/ci/test_browser_event_ScrollEvent.py
index dd2c568f8..320b3d378 100644
--- a/tests/ci/test_browser_event_ScrollEvent.py
+++ b/tests/ci/test_browser_event_ScrollEvent.py
@@ -91,7 +91,7 @@ class TestScrollActions:
await tools.act(GoToUrlActionModel(**goto_action), browser_session)
# Test 1: Basic page scroll down
- scroll_action = {'scroll': ScrollAction(down=True, num_pages=1.0)}
+ scroll_action = {'scroll': ScrollAction(down=True, pages=1.0)}
class ScrollActionModel(ActionModel):
scroll: ScrollAction | None = None
@@ -106,7 +106,7 @@ class TestScrollActions:
assert 'the page' in result.extracted_content
# Test 2: Basic page scroll up
- scroll_up_action = {'scroll': ScrollAction(down=False, num_pages=0.5)}
+ scroll_up_action = {'scroll': ScrollAction(down=False, pages=0.5)}
result = await tools.act(ScrollActionModel(**scroll_up_action), browser_session)
assert isinstance(result, ActionResult)
@@ -116,7 +116,7 @@ class TestScrollActions:
assert '0.5 pages' in result.extracted_content
# Test 3: Test with invalid element index (should error)
- invalid_scroll_action = {'scroll': ScrollAction(down=True, num_pages=1.0, frame_element_index=999)}
+ invalid_scroll_action = {'scroll': ScrollAction(down=True, pages=1.0, index=999)}
result = await tools.act(ScrollActionModel(**invalid_scroll_action), browser_session)
# This should fail with error about element not found
@@ -125,15 +125,15 @@ class TestScrollActions:
assert 'Element index 999 not found' in result.error or 'Failed to execute scroll' in result.error
# Test 4: Model parameter validation
- scroll_with_index = ScrollAction(down=True, num_pages=1.0, frame_element_index=5)
+ scroll_with_index = ScrollAction(down=True, pages=1.0, index=5)
assert scroll_with_index.down is True
- assert scroll_with_index.num_pages == 1.0
- assert scroll_with_index.frame_element_index == 5
+ assert scroll_with_index.pages == 1.0
+ assert scroll_with_index.index == 5
- scroll_without_index = ScrollAction(down=False, num_pages=0.25)
+ scroll_without_index = ScrollAction(down=False, pages=0.25)
assert scroll_without_index.down is False
- assert scroll_without_index.num_pages == 0.25
- assert scroll_without_index.frame_element_index is None
+ assert scroll_without_index.pages == 0.25
+ assert scroll_without_index.index is None
async def test_scroll_with_cross_origin_disabled(self, browser_session, base_url):
"""Test that scroll works when cross_origin_iframes is disabled."""