Playwright tmp dirs are cleaned up after browser close 🟩

This commit is contained in:
Daniel Roth 2026-06-04 12:51:14 +00:00 committed by Jun-te Kim
parent 730e2e2f91
commit d69e8c257f

View file

@ -92,5 +92,12 @@ def get_token_from_local_storage(
context.close()
browser.close()
for pattern in (
"/tmp/playwright-artifacts-*",
"/tmp/playwright_chromiumdev_profile-*",
):
for path in glob.glob(pattern):
shutil.rmtree(path, ignore_errors=True)
if record_video and video_dir:
logger.info(f"Video(s) saved in: {video_dir}")