diff --git a/test/frontend/cases/static-page-test.js b/test/frontend/cases/static-page-test.js new file mode 100644 index 000000000..b77496f86 --- /dev/null +++ b/test/frontend/cases/static-page-test.js @@ -0,0 +1,19 @@ +/** +* +* This test simply checks the icinga build server and tests +* if the title is correct +**/ +i2w = require('./i2w-config'); + +var casper = i2w.getTestEnv(); + +casper.start("http://build.icinga.org/jenkins"); + +casper.then(function() { + this.test.assertTitle("icinga-web test [Jenkins]", "The jenkins page"); +}); + +casper.run(function() { + this.test.done(); +}); + diff --git a/test/frontend/casperjs.config b/test/frontend/casperjs.config new file mode 100644 index 000000000..69c9d4a3b --- /dev/null +++ b/test/frontend/casperjs.config @@ -0,0 +1,5 @@ +{ + "host": "localhost", + "port": 80, + "path": "icinga2-web" +} diff --git a/test/frontend/i2w-config.js b/test/frontend/i2w-config.js new file mode 100644 index 000000000..7d54a1a00 --- /dev/null +++ b/test/frontend/i2w-config.js @@ -0,0 +1,107 @@ +/** +* Tools for setting up the casperjs tests +* mainly setting host, port and path path +**/ + +// load config files +var fs = require('fs'); +var env = require('system').env; +var args = require('system').args; +var utils = require('utils'); + + +var configFile = fs.absolute('./casperjs.config'); +var host = null; +var port = null; +var path = null; +var verbose = false; + + +if (typeof(env.CASPERJS_HOST) === "string") + host = env.CASPERJS_HOST; +if (typeof(env.CASPERJS_PORT) === "string") + port = parseInt(env.CASPERJS_PORT, 10); +if (typeof(env.CASPERJS_PATH) === "string") + path = env.CASPERJS_PATH; + + +for (var i=0;i