depot/third_party/nixpkgs/pkgs/development/web/playwright-test/wrapped.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

29 lines
771 B
Nix

{ lib
, callPackage
, buildNpmPackage
, fetchurl
, python3
, playwright-driver
, makeWrapper
}:
let
driver = playwright-driver;
browsers = playwright-driver.browsers;
# nodeDependencies / package / shell
playwright-test-raw = (callPackage ./default.nix { })."@playwright/test-${driver.version}";
playwright-test = playwright-test-raw.overrideAttrs (oa: {
nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [
makeWrapper
];
postInstall = ''
# you need to set both the path and version else playwright looks into the wrong one
wrapProgram $out/bin/playwright \
--set-default PLAYWRIGHT_BROWSERS_PATH "${browsers}" \
--prefix NODE_PATH : ${placeholder "out"}/lib/node_modules
'';
});
in
playwright-test