-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devops: remake downloading logic #1419
Conversation
This patch: - removes `browserType.downloadBrowserIfNeeded()` method. The method turned out to be ill-behaving and could not be used as we'd like to. - adds a `browserType.setExecutablePath` method to set a browser exectuable. Now, all clients of `playwright-core` should take care of downloading a browser one way or another and setting the downloaded path with the `browserType.setExecutablePath` method. The playwright object can then be returned to client.
938f57d
to
9c6ec4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Co-Authored-By: Joel Einbinder <joel.einbinder@gmail.com>
Co-Authored-By: Joel Einbinder <joel.einbinder@gmail.com>
Co-Authored-By: Joel Einbinder <joel.einbinder@gmail.com>
Co-Authored-By: Joel Einbinder <joel.einbinder@gmail.com>
Am i seeing this wrong or you still downloading into node_modules? |
This patch:
browserType.downloadBrowserIfNeeded()
method. The methodturned out to be ill-behaving and cannot not be used as we'd like to (see [BUG] Playwright requires manual install of browsers #1085)
browserType.setExecutablePath
method to set a browserexectuable.
With this patch, we take the following approach towards managing browser downloads:
playwright-core
doesn't download any browsers. Inplaywright-core
,playwright.chromium.executablePath()
returnsnull
(same for firefox and webkit).playwright-core
(e.g.playwright
and others) download browsers one way or another.They can then configure
playwright
with executable paths and re-export theplaywright
object to their clients.playwright
,playwright-firefox
,playwright-chromium
andplaywright-webkit
downloadbrowsers. Once browsers are downloaded, their executable paths are saved to a
.downloaded-browsers.json
file. This file is read inplaywright/index.js
to configure browser executable paths and re-export the API.install-from-github.js
that also cleans up old browsers.