MCPcopy
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / test_scrape_method_js_support

Function test_scrape_method_js_support

tests/test_chromium.py:868–878  ·  view source on GitHub ↗

Test that scrape method calls ascrape_with_js_support when requires_js_support is True.

(monkeypatch)

Source from the content-addressed store, hash-verified

866
867@pytest.mark.asyncio
868async def test_scrape_method_js_support(monkeypatch):
869 """Test that scrape method calls ascrape_with_js_support when requires_js_support is True."""
870
871 async def dummy_js(url):
872 return f"<html>JS supported content for {url}</html>"
873
874 urls = ["http://example.com"]
875 loader = ChromiumLoader(urls, backend="playwright", requires_js_support=True)
876 monkeypatch.setattr(loader, "ascrape_with_js_support", dummy_js)
877 result = await loader.scrape("http://example.com")
878 assert "JS supported content" in result
879
880
881@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

scrapeMethod · 0.95
ChromiumLoaderClass · 0.90

Tested by

no test coverage detected