Search code examples
npmgitlabgitlab-ciartifactoryplaywright

Managing Playwright browser binaries in Artifactory


I want to be able to upload browser binaries to an Artifactory repository, so that Playwright tests can be run against our builds in our gitlab CI pipeline, as described here. I installed Playwright locally using npm via a windows terminal npm ci -D playwright. I now have browser binaries for chromium, firefox and webkit located at ./AppData/local/ms-playwright. The problem is that the browser 'binaries' are in fact folders, and I'm not able to deploy them to Artifactory as is. In what format should these binaries be deployed to artifactory, so that I can point to the repo in my gitlab-ci.yml file as part of the CI pipeline build process?


Solution

  • For playwright to download the browser binaries from Artifactory you will need to:

    • Create a new generic local repository in Artifactory named playwright (or any other name)
    • Upload the required browser binaries to the newly created playwright repository. You can use the JFrog CLI, REST API or UI for uploading the binaries. Make sure you upload the binary to path where playwright expects it to be, for example:

    enter image description here

    • Set the playwright PLAYWRIGHT_DOWNLOAD_HOST to the the Artifactory playwright repository URL, for example:

      PLAYWRIGHT_DOWNLOAD_HOST=http://localhost:8081/artifactory/playwright npm i -D playwright