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