Giter Site home page Giter Site logo

Comments (9)

mxschmitt avatar mxschmitt commented on May 14, 2024 1

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.

mxschmitt avatar mxschmitt commented on May 14, 2024

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.

StarpTech avatar StarpTech commented on May 14, 2024

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.

StarpTech avatar StarpTech commented on May 14, 2024

@mxschmitt during testing it gets even worse. It populates .ms-playwright for every subdir.

from playwright-go.

mxschmitt avatar mxschmitt commented on May 14, 2024

@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.

StarpTech avatar StarpTech commented on May 14, 2024

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.

mxschmitt avatar mxschmitt commented on May 14, 2024

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.

mxschmitt avatar mxschmitt commented on May 14, 2024

@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.

mxschmitt avatar mxschmitt commented on May 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.