Always downloading Playwright driver
See original GitHub issueI noticed that in the current master branch it was always downloading the driver. I found the issue, in PlaywrightDriver.isUpToDateDriver It’s checking the output of PW, for example:
/Users/sam/Library/Caches/ms-playwright-go/1.16.0-next-1634703014000/playwright.sh --version
Version 1.16.0-next
With the constant:
const playwrightCliVersion = "1.16.0-next-1634703014000"
Using:
if bytes.Contains(output, []byte(d.Version)) {
return true, nil
}
The extra -1634703014000
on the constant is the issue.
I’ve fixed it locally by adding this to the end of isUpToDateDriver
:
if strings.HasPrefix(string(output), "Version ") {
// Get rid of trailing new line
outputStr := strings.TrimSpace(string(output))
if len(outputStr) > 8 && strings.Contains(d.Version, outputStr[8:]) {
return true, nil
}
}
I’ll submit a PR with the change.
If you have any suggestions for changes I’m happy to change.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Browsers - Playwright
By default, Playwright downloads browsers from Microsoft CDN. Sometimes companies maintain an internal proxy that blocks direct access to the public resources.
Read more >[BUG] Playwright cannot download the browsers automatically
I'm trying to use Playwright in a Java EE environment with Zulu 11 and I always get this error messaged when launching chromium....
Read more >Installation | Playwright
Playwright downloads Chromium, Firefox and WebKit browsers by default. To install a specific browser, pass it as an argument during installation. $ pip...
Read more >4 - Playwright Setup & First Script - Launch Chromium, Firefox ...
Learn: --initial setup -- download browser binaries --first playwright script --launch chromium, firefox and webkit using playwright Schedule ...
Read more >#25 - Download File using Playwright with Java - YouTube
In this video, I have explained how to Download File using Playwright with Java.Schedule a meeting in case of any ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the same issue with the latest master branch. Every time I run the program, the driver will be downloaded again.
go.mod
This should be fixed in v1.20.0