(browser: Browser, server: Server)
| 315 | |
| 316 | |
| 317 | async def test_should_delete_file(browser: Browser, server: Server) -> None: |
| 318 | page = await browser.new_page(accept_downloads=True) |
| 319 | await page.set_content(f'<a href="{server.PREFIX}/download">download</a>') |
| 320 | async with page.expect_download() as download_info: |
| 321 | await page.click("a") |
| 322 | download = await download_info.value |
| 323 | path = await download.path() |
| 324 | assert os.path.exists(path) |
| 325 | await download.delete() |
| 326 | assert os.path.exists(path) is False |
| 327 | await page.close() |
| 328 | |
| 329 | |
| 330 | async def test_should_delete_downloads_on_context_destruction( |
nothing calls this directly
no test coverage detected