// {{{ICINGA_LICENSE_HEADER}}} /** * This file is part of Icinga 2 Web. * * Icinga 2 Web - Head for multiple monitoring backends. * Copyright (C) 2013 Icinga Development Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @copyright 2013 Icinga Development Team * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} /** * 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 host = 'localhost'; var port = 80; var path = 'icingaweb'; var verbose = false; var user = 'jdoe'; var pass = 'password'; 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; if (typeof(env.CASPERJS_USER) === 'string') user = env.CASPERJS_USER; if (typeof(env.CASPERJS_PASS) === 'string') pass = env.CASPERJS_PASS; for (var i=0;i