-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package request: playwright test #217693
Comments
We apparently have several (too many) solutions when it comes to packaging npm software:
I've tried a bunch of them and they all fail with different errors. As I've used node2nix in the past, I've decided to stick with it. From my understanding: playwright (PW) uses the recent "workspace" feature of package.json which isn't supported with node2nix yet (see PR svanderburg/node2nix#200) so you have to go into the "packages" folder and run node2nix on those packages separately or create your own hybrid folder. I've managed to make |
At the moment, I've been looking for a solution myself as well and thanks to the experiments done by @voidus and @ludiosarchive , I've managed to get something that one might would call as a working setup although it's far from ideal. Here's how:
Now, to the caveats:
I might be able to put up some examples, but I'm still new to Nix myself, it might would take some days (promise). |
some notes to myself as:
|
I am at this stage
and not sure how to debug this. the playwright tracker is useless apart from microsoft/playwright#13102 but not sure what to do. playwright-test is at version 1.30.1 |
ok found a solution, I'll test the package for a while and upstream if satisfactory. |
how'd you go with packaging them? I would love to help test or review them 😄 |
I call node2nix on the following node-packages.json
then in my flake I have
playwright-browsers is a fork of #223382 with versions that match my version of the node module. Note that "playwright-browsers" doesn't expose the browsers expected by playwirght (ie.,with the playwright patches) but the nixpkgs browsers in a custom folder that respects the folder hierarchy expected by playwright. From my experience and other nixpkgs issues: firefox is currently broken but chrome works for basic usage. I haven't had the chance yet to test the more exoctic scenarii. Took me a while to understand all this. This looks like a popular tool so I expect it will keep improving if we can get a good enough base to start with. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/running-playwright-tests/25655/4 |
Project description
The request is not necessarily to package this for nixpkgs but if anyone has already done it so that I can steal the derivation. I think the probability is high considering the recent hype around playwright (there was also a post on this yesterday https://discourse.nixos.org/t/running-playwright-tests/25655/2).
I am trying to help a coworker run "playwright test" but I dont know much about playwright or node. The executable brought by
nix shell nixpkgs#playwright
doesn't provide it and it's a python one.Seems like the "true" playwright is in typescript https://github.com/microsoft/playwright and the test command is provided by a submodule @playwright/test . At some point I managed to make it work with node2nix on that last repo but it might have been a fluke since once I started calling the derivation from a flake, it tried to reach out to the network.
Metadata
The text was updated successfully, but these errors were encountered: