about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2017-01-16 09:37:29 +0000
committerGitHub <noreply@github.com>2017-01-16 09:37:29 +0000
commitcd07d21a44af96db8b24a2076dafda5eb38a5e2f (patch)
treed99a4d7e4a647153fbc01c26b2d56a8c8d27be26
parent56fbfe3cf971d2af30d7c028e18c8c850c631383 (diff)
parentf0c230c2c7cc5c88b0d80b95ca61d86d1dfb700f (diff)
Merge pull request #21868 from hsenag/htmlunit-driver
selenium-server-standalone: restore htmlunit-driver support
-rw-r--r--pkgs/development/tools/selenium/htmlunit-driver/default.nix25
-rw-r--r--pkgs/development/tools/selenium/server/default.nix7
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 31 insertions, 3 deletions
diff --git a/pkgs/development/tools/selenium/htmlunit-driver/default.nix b/pkgs/development/tools/selenium/htmlunit-driver/default.nix
new file mode 100644
index 0000000000000..2fc38db1bb0ca
--- /dev/null
+++ b/pkgs/development/tools/selenium/htmlunit-driver/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "htmlunit-driver-standalone-${version}";
+  version = "2.21";
+
+  src = fetchurl {
+    url = "https://github.com/SeleniumHQ/htmlunit-driver/releases/download/${version}/htmlunit-driver-standalone-${version}.jar";
+    sha256 = "1wrbam0hb036717z3y73lsw4pwp5sdiw2i1818kg9pvc7i3fb3yn";
+  };
+
+  unpackPhase = "true";
+
+  installPhase = "install -D $src $out/share/lib/${name}/${name}.jar";
+
+  meta = {
+    homepage = https://github.com/SeleniumHQ/htmlunit-driver;
+    description = "A WebDriver server for running Selenium tests on the HtmlUnit headless browser";
+    maintainers = with maintainers; [ coconnor offline ];
+    platforms = platforms.all;
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/tools/selenium/server/default.nix b/pkgs/development/tools/selenium/server/default.nix
index fe8bf2b13b59d..ca225adab6d2c 100644
--- a/pkgs/development/tools/selenium/server/default.nix
+++ b/pkgs/development/tools/selenium/server/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, makeWrapper, jre, jdk, gcc, xorg
-, chromedriver, chromeSupport ? true }:
+, htmlunit-driver, chromedriver, chromeSupport ? true }:
 
 with stdenv.lib;
 
@@ -25,8 +25,9 @@ in stdenv.mkDerivation rec {
     mkdir -p $out/share/lib/${name}
     cp $src $out/share/lib/${name}/${name}.jar
     makeWrapper ${jre}/bin/java $out/bin/selenium-server \
-      --add-flags "-jar $out/share/lib/${name}/${name}.jar" \
-      --add-flags ${optionalString chromeSupport "-Dwebdriver.chrome.driver=${chromedriver}/bin/chromedriver"}
+      --add-flags "-cp ${htmlunit-driver}/share/lib/${htmlunit-driver.name}/${htmlunit-driver.name}.jar:$out/share/lib/${name}/${name}.jar" \
+      --add-flags ${optionalString chromeSupport "-Dwebdriver.chrome.driver=${chromedriver}/bin/chromedriver"} \
+      --add-flags "org.openqa.grid.selenium.GridLauncher"
   '';
 
   meta = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 589e8d8085f1d..c94bd5234f6cd 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6367,6 +6367,8 @@ in
 
   heroku = callPackage ../development/tools/heroku { };
 
+  htmlunit-driver = callPackage ../development/tools/selenium/htmlunit-driver { };
+
   hyenae = callPackage ../tools/networking/hyenae { };
 
   icestorm = callPackage ../development/tools/icestorm { };