-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Use PLAYWRIGHT_DRIVER_PATH
environment variable as driver cache directory
#485
Use PLAYWRIGHT_DRIVER_PATH
environment variable as driver cache directory
#485
Conversation
@GuyGoldenberg The Playwright driver directory is used for clients only. And |
run.go
Outdated
@@ -37,6 +37,9 @@ type PlaywrightDriver struct { | |||
|
|||
func NewDriver(options *RunOptions) (*PlaywrightDriver, error) { | |||
baseDriverDirectory := options.DriverDirectory | |||
if baseDriverDirectory == "" { | |||
baseDriverDirectory = os.Getenv("PLAYWRIGHT_DRIVER_PATH") |
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.
nit: I'd probably put it into into the first line of getDefaultCacheDirectory, then the caller side is simpler. Either the user given value or our internal logic.
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.
I put it in transformRunOptions
and added some comments. getDefaultCacheDirectory
still maintains its single purpose.
Users can now understand the usage through the type comments of RunOptions
.
PLAYWRIGHT_BROWSERS_PATH
environment variable as driver cache directoryPLAYWRIGHT_DRIVER_PATH
environment variable as driver cache directory
6ad91ad
to
e543dab
Compare
Playwright uses
PLAYWRIGHT_BROWSERS_PATH
to define the cache directory used to install the browsers.See playwright implementation - link