Test that scrape method calls ascrape_with_js_support when requires_js_support is True.
(monkeypatch)
| 866 | |
| 867 | @pytest.mark.asyncio |
| 868 | async 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 |
nothing calls this directly
no test coverage detected