Test the scrape method with playwright backend.
(mock_playwright)
| 169 | |
| 170 | @pytest.mark.asyncio |
| 171 | async 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 |
nothing calls this directly
no test coverage detected