MCPcopy
hub / github.com/Aider-AI/aider / test_scraper_enable_playwright

Function test_scraper_enable_playwright

tests/scrape/test_playwright_disable.py:38–52  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

36
37
38def test_scraper_enable_playwright(monkeypatch):
39 io = DummyIO()
40 # Simulate that playwright is available and should be used
41 scraper = Scraper(print_error=io.tool_error, playwright_available=True)
42 # Patch scrape_with_playwright to check it is called
43 called = {}
44
45 def fake_playwright(url):
46 called["called"] = True
47 return "<html>hi</html>", "text/html"
48
49 scraper.scrape_with_playwright = fake_playwright
50 content = scraper.scrape("http://example.com")
51 assert content.startswith("hi") or "<html>" in content
52 assert called["called"]
53
54
55def test_commands_web_disable_playwright(monkeypatch):

Callers

nothing calls this directly

Calls 3

scrapeMethod · 0.95
ScraperClass · 0.90
DummyIOClass · 0.70

Tested by

no test coverage detected