(
browser: Browser, server: Server, tmp_path: Path
)
| 394 | |
| 395 | |
| 396 | def test_should_start_and_stop_har( |
| 397 | browser: Browser, server: Server, tmp_path: Path |
| 398 | ) -> None: |
| 399 | context = browser.new_context() |
| 400 | page = context.new_page() |
| 401 | har_path = tmp_path / "test.har" |
| 402 | context.tracing.start_har(path=har_path, content="embed", mode="full") |
| 403 | page.goto(server.PREFIX + "/empty.html") |
| 404 | context.tracing.stop_har() |
| 405 | context.close() |
| 406 | assert har_path.exists() |
| 407 | assert har_path.stat().st_size > 0 |
| 408 | |
| 409 | |
| 410 | def test_should_record_a_har_with_options( |