MCPcopy Index your code
hub / github.com/microsoft/playwright-python / test_should_delete_file

Function test_should_delete_file

tests/async/test_download.py:317–327  ·  view source on GitHub ↗
(browser: Browser, server: Server)

Source from the content-addressed store, hash-verified

315
316
317async 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
330async def test_should_delete_downloads_on_context_destruction(

Callers

nothing calls this directly

Calls 7

new_pageMethod · 0.45
set_contentMethod · 0.45
expect_downloadMethod · 0.45
clickMethod · 0.45
pathMethod · 0.45
deleteMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected