From e075db3800ea6af16bdb2875e8ad4a25aa0d096b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Fri, 14 Jun 2013 15:49:21 +0200 Subject: [PATCH] Add temporary http server for casperjs tests Added a static folder and spawn a small HTTP server on runtests. This is not really the best solution, as it uses pythons simpleHTTPServer, but it works for now refs #4315 --- test/frontend/cases/static-page-test.js | 7 +++++-- test/frontend/runtests | 7 +++++-- test/frontend/static/empty.html | 7 +++++++ 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 test/frontend/static/empty.html diff --git a/test/frontend/cases/static-page-test.js b/test/frontend/cases/static-page-test.js index b77496f86..f37a2a214 100644 --- a/test/frontend/cases/static-page-test.js +++ b/test/frontend/cases/static-page-test.js @@ -7,11 +7,14 @@ i2w = require('./i2w-config'); var casper = i2w.getTestEnv(); -casper.start("http://build.icinga.org/jenkins"); +casper.start("http://localhost:12999/empty.html"); + casper.then(function() { - this.test.assertTitle("icinga-web test [Jenkins]", "The jenkins page"); + casper.log(this.test); + this.test.assertTitle("Just an empty page"); }); + casper.run(function() { this.test.done(); diff --git a/test/frontend/runtests b/test/frontend/runtests index 4e913ea72..cb24dd57b 100755 --- a/test/frontend/runtests +++ b/test/frontend/runtests @@ -108,8 +108,11 @@ if [ "$EXCLUDE" != "" ];then fi FILELIST=`echo $FILELIST | grep -v "$NAME"` fi; - +cd $DIR/static +python -m SimpleHTTPServer 12999& +PID=$! +cd $DIR echo $EXEC $FILELIST $EXEC $FILELIST - +kill $PID exit 0 diff --git a/test/frontend/static/empty.html b/test/frontend/static/empty.html new file mode 100644 index 000000000..965daf8c7 --- /dev/null +++ b/test/frontend/static/empty.html @@ -0,0 +1,7 @@ + + + Just an empty page + + + +