Commit 6a8cb457 authored by Matthieu Coudron's avatar Matthieu Coudron Committed by Matthieu Coudron
Browse files

playwright-test: init at 1.31.1

Adds "playwright test" command.
parent f73acb57
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
# This file has been generated by node2nix 1.11.1. Do not edit!

{pkgs ? import <nixpkgs> {
    inherit system;
  }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-14_x"}:

let
  nodeEnv = import ./node-env.nix {
    inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
    inherit pkgs nodejs;
    libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
  };
in
import ./node-packages.nix {
  inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
  inherit nodeEnv;
}
+686 −0

File added.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
[
  {"@playwright/test": "1.31.1"}
]
+60 −0
Original line number Diff line number Diff line
# This file has been generated by node2nix 1.11.1. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
  sources = {
    "@types/node-18.15.11" = {
      name = "_at_types_slash_node";
      packageName = "@types/node";
      version = "18.15.11";
      src = fetchurl {
        url = "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz";
        sha512 = "E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==";
      };
    };
    "fsevents-2.3.2" = {
      name = "fsevents";
      packageName = "fsevents";
      version = "2.3.2";
      src = fetchurl {
        url = "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz";
        sha512 = "xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==";
      };
    };
    "playwright-core-1.31.1" = {
      name = "playwright-core";
      packageName = "playwright-core";
      version = "1.31.1";
      src = fetchurl {
        url = "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.1.tgz";
        sha512 = "JTyX4kV3/LXsvpHkLzL2I36aCdml4zeE35x+G5aPc4bkLsiRiQshU5lWeVpHFAuC8xAcbI6FDcw/8z3q2xtJSQ==";
      };
    };
  };
in
{
  "@playwright/test-1.31.1" = nodeEnv.buildNodePackage {
    name = "_at_playwright_slash_test";
    packageName = "@playwright/test";
    version = "1.31.1";
    src = fetchurl {
      url = "https://registry.npmjs.org/@playwright/test/-/test-1.31.1.tgz";
      sha512 = "IsytVZ+0QLDh1Hj83XatGp/GsI1CDJWbyDaBGbainsh0p2zC7F4toUocqowmjS6sQff2NGT3D9WbDj/3K2CJiA==";
    };
    dependencies = [
      sources."@types/node-18.15.11"
      sources."fsevents-2.3.2"
      sources."playwright-core-1.31.1"
    ];
    buildInputs = globalBuildInputs;
    meta = {
      description = "A high-level API to automate web browsers";
      homepage = "https://playwright.dev";
      license = "Apache-2.0";
    };
    production = true;
    bypassCache = true;
    reconstructLock = true;
  };
}
+29 −0
Original line number Diff line number Diff line
{ 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
Loading