Skip to content

Instantly share code, notes, and snippets.

@dgozman
Last active July 28, 2020 21:35
Show Gist options
  • Save dgozman/fdcc8f939ce0e7afe4ef194ffb5598db to your computer and use it in GitHub Desktop.
Save dgozman/fdcc8f939ce0e7afe4ef194ffb5598db to your computer and use it in GitHub Desktop.
playwright packages

playwright-{chromium,firefox,webkit}

scenarios

  • Limit downloads on CI/CD.
  • Concerned over download size on the dev box. Partially mitigated by shared install.
  • Separate versioning of browsers for easier rolls.

pros

  • Clear message - I only need one browser.
  • Do not have to ever worry about extra downloads.
  • Separate versioning if needed.
  • Using env is cumbersome, especially on Windows.

cons

  • Unclear message - do I have to use specific browser version, or just playwright?
  • Changing require names in runtime. Harder with ESM.
  • More maintenance.
  • Does this work for other languages?
  • What about Electron? Edge?

alternatives

  • PW_BROWSER=webkit,chromium npm install playwright.
  • Separate playwright-1.0 package for using multiple versions in the same project.

playwright-core

scenarios

  • Only importing types for wrapper libriries relying on your own playwright of choice.
  • Carlo-like applications distributed without browser binaries.

pros

  • Clear message - I do not need browsers.
  • Using env is cumbersome, especially on Windows.

cons

  • What do we export? What about Electron? Edge?
  • More maintenance.

alternatives

  • Existing PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install playwright.
@aslushnikov
Copy link

Env variables are very inconvenient to use:

  • aren't versioned, require additional process to propagate to developers / cloud boxes
  • very hard to set up on windows

this all is very well summarized in this comment: microsoft/playwright#2905 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment