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

Function test_scrape_method_playwright

tests/test_chromium.py:171–185  ·  view source on GitHub ↗

Test the scrape method with playwright backend.

(mock_playwright)

Source from the content-addressed store, hash-verified

169
170@pytest.mark.asyncio
171async def test_scrape_method_playwright(mock_playwright):
172 """Test the scrape method with playwright backend."""
173 mock_pw, mock_browser, mock_context, mock_page = mock_playwright
174
175 url = "http://example.com"
176 loader = ChromiumLoader([url], backend="playwright")
177
178 mock_page.content.return_value = "<html>Playwright content</html>"
179 result = await loader.scrape(url)
180
181 assert "Playwright content" in result
182 assert mock_pw.chromium.launch.call_count == 1
183 assert mock_page.goto.call_count == 1
184 assert mock_page.wait_for_load_state.call_count == 1
185 assert mock_page.content.call_count == 1
186
187
188@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

scrapeMethod · 0.95
ChromiumLoaderClass · 0.90

Tested by

no test coverage detected