MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / test_alazy_load_selenium_backend

Function test_alazy_load_selenium_backend

tests/test_chromium.py:1212–1224  ·  view source on GitHub ↗

Test that alazy_load correctly yields Document objects when using selenium backend.

(monkeypatch)

Source from the content-addressed store, hash-verified

1210
1211@pytest.mark.asyncio
1212async def test_alazy_load_selenium_backend(monkeypatch):
1213 """Test that alazy_load correctly yields Document objects when using selenium backend."""
1214 urls = ["http://example.com", "http://selenium.com"]
1215 loader = ChromiumLoader(urls, backend="selenium")
1216
1217 async def dummy_selenium(url):
1218 return f"<html>dummy selenium backend content for {url}</html>"
1219
1220 monkeypatch.setattr(loader, "ascrape_undetected_chromedriver", dummy_selenium)
1221 docs = [doc async for doc in loader.alazy_load()]
1222 for doc, url in zip(docs, urls):
1223 assert f"dummy selenium backend content for {url}" in doc.page_content
1224 assert doc.metadata["source"] == url
1225
1226
1227@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

alazy_loadMethod · 0.95
ChromiumLoaderClass · 0.90

Tested by

no test coverage detected