mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-19 20:23:02 +00:00
6a8cb45772
Adds "playwright test" command.
30 lines
771 B
Nix
30 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
|