Comments (9)
Does this mean we even have to download the browsers twice? This is esentially what I see when running my container (based on playwright base image)
If the browser version will match with the browser installed in the Docker image, then they won't be downloaded again. This is blocked by the versioning, so its more clearer in the future.
I renamed the issue and we keep that open until I have the clear versioning in place, if you have more suggestions, feel free to open new issues, thanks!
from playwright-go.
Hi @StarpTech,
thanks for reaching out.
Regarding the first issue, the language support on Playwright is based on a driver. This driver is then used like in the C#, Java or Python version to start the actual browsers. The communication is based on stdin/stdout. This driver is then installing the browsers here. And yes, the browsers are preinstalled in the official Docker image, but the driver isn't and unfortunately can't.
For the second one, yes it was until a few days where the driver was not yet hosted officially. There I migrated over to the official mirror, see here and #54.
The Go version and the driver version needs to be in sync. I will start later or in the next few days assigning logical version numbers to the repo as GitHub releases and tags, so it makes sense, as it's done in Python repository: https://github.com/microsoft/playwright-python/releases
Let me know if you have more questions and glad to hear that you like it. (There is a lot of potential in improving the option type handling and adding more tests, thats why I call it currently not yet production ready).
from playwright-go.
Regarding the first issue, the language support on Playwright is based on a driver. This driver is then used like in the C#, Java or Python version to start the actual browsers. The communication is based on stdin/stdout. This driver is then installing the browsers here. And yes, the browsers are preinstalled in the official Docker image, but the driver isn't and unfortunately can't.
Does this mean we even have to download the browsers twice? This is esentially what I see when running my container (based on playwright base image)
2020/12/22 16:46:12 Downloading driver...
2020/12/22 16:46:27 Downloaded driver successfully
2020/12/22 16:46:27 Downloading browsers...
Failed to process descriptor at /tmp/pw/node_modules/playwright
2020/12/22 16:46:28 Downloaded browsers successfully
For the second one, yes it was until a few days where the driver was not yet hosted officially. There I migrated over to the official mirror, see here and #54.
The Go version and the driver version needs to be in sync. I will start later or in the next few days assigning logical version numbers to the repo as GitHub releases and tags, so it makes sense, as it's done in Python repository: microsoft/playwright-python/releases
Great 👍
from playwright-go.
@mxschmitt during testing it gets even worse. It populates .ms-playwright
for every subdir.
from playwright-go.
@mxschmitt during testing it gets even worse. It populates
.ms-playwright
for every subdir.
Thats currently the dilemma with my current approach. The driver needs to be downloaded a single time when it runs for the first time, currently during runtime which hangs in the beginning for a few seconds and its stored in the $PWD/.mw-playwright
. If you want, you can create a small go binary which calls playwright.Install()
.
So doing something like that would install the browsers in e.g. in Docker:
package main
import (
"log"
"github.com/mxschmitt/playwright-go"
)
func main() {
if err := playwright.Install(); err != nil {
log.Printf("could not install: %v", err)
}
}
Does this work for you approach or answer your question?
from playwright-go.
If you want, you can create a small go binary which calls playwright.Install().
I do not fully understand how it will solve the issue because my $PWD is different for each test suite. I need a way to pass the location of the driver.
from playwright-go.
If you want, you can create a small go binary which calls playwright.Install().
I do not fully understand how it will solve the issue because my $PWD is different for each test suite. I need a way to pass the location of the driver.
Not yet, we can add something like that. Let me come up with a proposal for it, will provide a PR for it soon.
from playwright-go.
@StarpTech I rolled to Playwright v1.7.1 #66 but won't publish a release yet because I want to add missing functionality like video recording etc.
from playwright-go.
Closed, I released version 0.171.0 which follows the same version schema as Playwright for Python etc. are using. It corresponds to version 1.7.1 of Playwright.
from playwright-go.
Related Issues (20)
- Plugin support HOT 6
- Laravel. Error when working on Ubuntu "WebSocket connection to 'wss://.....' failed: WebSocket is closed before the connection is established." HOT 4
- Assertions in Go HOT 2
- Does it support Selenium Grid? HOT 2
- Viewport definition issue
- Run playwright record scripts HOT 2
- Strange timeout behaviour HOT 2
- could not launch playwright when updating to v0.4101.0 HOT 5
- Visual comparisons HOT 2
- Ways to pass context from one browser instance to another HOT 2
- Hangs on Content() HOT 3
- Page.Evaluate returns undefined for a specific site HOT 4
- APIRequestContextFetch does not seem to populate cookie and update cookie from response HOT 2
- Assign values to js's variables or Call a js function fail. HOT 1
- Incorrect url pattern for non-release driver versions
- Runtime error during pw.Chromium.Connect
- Randomly Crash Issue on Firefox HOT 1
- Secured Cookies HOT 1
- Jose library has security Vulnurability, can this be upgraded to latest version. HOT 2
- Can't change user-agent on headless mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright-go.