Marker 1
Marker 2
Marker 3
import asyncio import pytest from pytest_httpserver import HTTPServer from browser_use.agent.views import ActionModel, ActionResult from browser_use.browser import BrowserSession from browser_use.browser.profile import BrowserProfile from browser_use.tools.service import Tools from browser_use.tools.views import ( GoToUrlAction, ScrollAction, ) @pytest.fixture(scope='session') def http_server(): """Create and provide a test HTTP server that serves static content.""" server = HTTPServer() server.start() # Add routes for common test pages server.expect_request('/').respond_with_data( '
Welcome to the test site
', content_type='text/html', ) server.expect_request('/scrollable').respond_with_data( """This is the main page with an embedded iframe below.
Content after iframe