Merge pull request #15099 from phunehehe/casperjs

Casperjs: refactor and update
This commit is contained in:
Arseniy Seroka 2016-05-01 19:35:14 +03:00
commit 41efe6535d
2 changed files with 43 additions and 32 deletions

View file

@ -1,40 +1,49 @@
{ stdenv, fetchgit, python, phantomjs }: { stdenv, fetchFromGitHub, fontsConf, phantomjs2, python, nodePackages }:
stdenv.mkDerivation rec { let version = "1.1.1";
name = "casperjs-1.0.0-RC5";
src = fetchgit { in stdenv.mkDerivation rec {
url = "git://github.com/n1k0/casperjs.git";
rev = "refs/tags/1.0.0-RC5"; name = "casperjs-${version}";
sha256 = "e7fd6b94b4b304416159196208dea7f6e8841a667df102eb378a698a92f0f2c7";
src = fetchFromGitHub {
owner = "casperjs";
repo = "casperjs";
rev = version;
sha256 = "187prrm728xpn0nx9kxfxa4fwd7w25z78nsxfk6a6kl7c5656jpz";
}; };
buildInputs = [ phantomjs2 python nodePackages.eslint ];
patchPhase = '' patchPhase = ''
substituteInPlace bin/casperjs --replace "/usr/bin/env python" "${python}/bin/python" \ substituteInPlace bin/casperjs --replace "/usr/bin/env python" "${python}/bin/python" \
--replace "'phantomjs'" "'${phantomjs}/bin/phantomjs'" --replace "'phantomjs'" "'${phantomjs2}/bin/phantomjs'"
''; '';
dontBuild = true;
doCheck = true;
checkPhase = ''
export FONTCONFIG_FILE=${fontsConf}
make test
'';
installPhase = '' installPhase = ''
mkdir -p $out/share/casperjs $out/bin mv $PWD $out
cp -a . $out/share/casperjs/.
ln -s $out/share/casperjs/bin/casperjs $out/bin
''; '';
meta = { meta = {
description = "Navigation scripting & testing utility for PhantomJS";
description = ''
Navigation scripting & testing utility for PhantomJS and SlimerJS
'';
longDescription = '' longDescription = ''
CasperJS is a navigation scripting & testing utility for PhantomJS. CasperJS is a navigation scripting & testing utility for PhantomJS and
It eases the process of defining a full navigation scenario and provides useful high-level SlimerJS (still experimental). It eases the process of defining a full
functions, methods & syntaxic sugar for doing common tasks such as: navigation scenario and provides useful high-level functions, methods &
- defining & ordering navigation steps syntactic sugar for doing common tasks.
- filling forms
- clicking links
- capturing screenshots of a page (or an area)
- making assertions on remote DOM
- logging & events
- downloading base64 encoded resources, even binary ones
- catching errors and react accordingly
- writing functional test suites, exporting results as JUnit XML (xUnit)
''; '';
homepage = http://casperjs.org; homepage = http://casperjs.org;

View file

@ -5816,7 +5816,9 @@ in
inherit rustc; inherit rustc;
}; };
casperjs = callPackage ../development/tools/casperjs { }; casperjs = callPackage ../development/tools/casperjs {
inherit (texFunctions) fontsConf;
};
cbrowser = callPackage ../development/tools/misc/cbrowser { }; cbrowser = callPackage ../development/tools/misc/cbrowser { };
@ -6470,13 +6472,13 @@ in
beecrypt = callPackage ../development/libraries/beecrypt { }; beecrypt = callPackage ../development/libraries/beecrypt { };
beignet = callPackage ../development/libraries/beignet { beignet = callPackage ../development/libraries/beignet {
inherit (llvmPackages) clang-unwrapped; inherit (llvmPackages) clang-unwrapped;
inherit (xlibs) libX11; inherit (xlibs) libX11;
inherit (xorg) libXfixes libpthreadstubs libXdmcp libXdamage libXxf86vm; inherit (xorg) libXfixes libpthreadstubs libXdmcp libXdamage libXxf86vm;
inherit (python3Packages) python; inherit (python3Packages) python;
inherit (purePackages) gl; inherit (purePackages) gl;
}; };
belle-sip = callPackage ../development/libraries/belle-sip { }; belle-sip = callPackage ../development/libraries/belle-sip { };
bobcat = callPackage ../development/libraries/bobcat { }; bobcat = callPackage ../development/libraries/bobcat { };