Code Monkey home page Code Monkey logo

nixos-playwright's Introduction

nixos-playwright

fix-playwright-browsers patches the playwright-downloaded browser binaries so that they can run on NixOS.

Usage

  1. Install the packages google-chrome-dev and firefox-bin via your NixOS configuration or nix-env -iA.

  2. Install playwright via npm or yarn and make sure ~/.cache/ms-playwright has some browsers.

  3. Run fix-playwright-browsers or a browser-specific script from this repo.

Remember to run fix-playwright-browsers after every NixOS upgrade.

Bugs

fix-playwright-webkit does not yet result in a working webkit MiniBrowser; PRs welcome.

nixos-playwright's People

Contributors

dsyer avatar ivan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nixos-playwright's Issues

Add license

Hello,

thanks for your patch scripts!

Would you consider to add a (hopefully free ;-) ) license here in order to make it possible to use them (or variants of them) in other projects?

Thanks in advance!

Firefox missing `libharfbuzz.so.0`

Thanks for making these scripts! It was super helpful to be able to get up and running with Playwright quickly without having to deal with too much NixOS stuff :)

I'm having a problem running Firefox — attached is the patch log and playwright error:

/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/liblgpllibs.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/plugin-container
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libmozavcodec.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/gmp-clearkey/0.1/libclearkey.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libmozgtk.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libplc4.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libsoftokn3.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/updater
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libmozwayland.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libnss3.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libplds4.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libmozsqlite3.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libnspr4.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/firefox-bin
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libsmime3.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libssl3.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libnssutil3.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/pingsender
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libfreeblpriv3.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/firefox
patchelf: not an ELF executable
patchelf: not an ELF executable
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libnssckbi.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libmozavutil.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libxul.so
/home/wesleyac/.cache/ms-playwright/firefox-1297/firefox/libmozsandbox.so
  3) [firefox] › tests/e2e.spec.ts:19:1 › misc =====================================================

    browserType.launch: Host system is missing dependencies!

      Missing libraries are:
          libharfbuzz.so.0


        at Object._baseTest.extend.browser.scope [as fn] (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/index.js:221:40)
        at Fixture.setup (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/fixtures.js:74:73)
        at FixtureRunner.setupFixtureForRegistration (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/fixtures.js:315:5)
        at Fixture.setup (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/fixtures.js:58:19)
        at FixtureRunner.setupFixtureForRegistration (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/fixtures.js:315:5)
        at Fixture.setup (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/fixtures.js:58:19)
        at FixtureRunner.setupFixtureForRegistration (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/fixtures.js:315:5)
        at FixtureRunner.resolveParametersAndRunHookOrTest (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/fixtures.js:300:23)
        at WorkerRunner._runTestWithBeforeHooks (/home/wesleyac/code/deeplinks/.yarn/cache/@playwright-test-npm-1.16.3-3b65662da1-363f2f214d.zip/node_modules/@playwright/test/lib/workerRunner.js:478:7)

which firefox reports /nix/store/dzd85wsi9wh00ndm5xazxgx6f7sdxxy1-firefox-bin-94.0.2/bin/firefox. I'm using playwright version 1.16.3 (running it in node, using @playwright/test). I'm running on NixOS 21.05.

Strangely, running ~/.cache/ms-playwright/firefox-1297/firefox/firefox-bin launches a instance of firefox that appears to work fine.

Let me know if you need any more info!

Firefox script not working

I tried the Firefox script with current playwright on NixOS 21.05, and I get an error about not being able to find libstdc++.

A couple of attempted tweaks didn't help: can I ask you if it's still working for you?

Chrome script does not work

The Chromium script does not work anymore, because it expects the google-chrome-unstable package to be installed. NixOS does not offer this package anymore neither for 20.09 nor for 21.05 (see NixOS search - google-chrome).

Only those packages are available:

  • google-chrome
  • google-chrome-dev
  • google-chrome-beta

I changed the expected package in the script to google-chrome-beta and the script worked as expected.

Shall I create a pull request to fix this problem?

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.