sincecutoff.com
← all changes

Playwright browserType.launch() accepts artifactsDir

Introduced 2026-04-01 · score 0.97

HOW TO USE IT

When launching a browser and you want artifacts saved to a specific directory, pass `artifactsDir` in `browserType.launch()` options.

const browser = await chromium.launch({ artifactsDir: '<artifacts-directory>' });

WHY THIS HELPS

When launching a browser for a repository test run, set the directory used for artifacts.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.59.0
  • options.artifactsDir: Directory for artifacts such as traces, videos, downloads, and HAR files. It is not cleaned up when the browser closes; without it, Playwright uses a temporary directory that is cleaned up on close.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card