Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
feat(install selenium): better communication in the install script
Browse files Browse the repository at this point in the history
Adds better messages in the selenium server install script, and also
makes the script output a 'start' executable which can be used to quickly
start up the selenium standalone. *not yet windows friendly*. Closes #108.
  • Loading branch information
juliemr committed Sep 24, 2013
1 parent b32f5a5 commit 37e0f1a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ A script is included to do the download for you - run (add the --nocd option if

Start the selenium standalone with

java -jar selenium/selenium-server-standalone-2.35.0.jar -Dwebdriver.chrome.driver=./selenium/chromedriver
./selenium/start

For alternate ways to download and start the selenium standalone, see
[the webdriver docs](http://docs.seleniumhq.org/docs/03_webdriver.jsp#running-standalone-selenium-server-for-use-with-remotedrivers).
14 changes: 14 additions & 0 deletions bin/install_selenium_standalone
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@ var CHROMEDRIVER_URL_WINDOWS =
'https://chromedriver.googlecode.com/files/chromedriver_win32_2.2.zip';

var DOWNLOAD_DIR = './selenium/';
var START_SCRIPT_FILENAME = DOWNLOAD_DIR + 'start';
var chromedriver_url = '';
var start_script = 'java -jar selenium/selenium-server-standalone-2.35.0.jar';


if (!fs.existsSync(DOWNLOAD_DIR) || !fs.statSync(DOWNLOAD_DIR).isDirectory()) {
fs.mkdirSync(DOWNLOAD_DIR);
}

console.log(
'When finished, start the Selenium Standalone Server with ./selenium/start \n');

// Function to download file using HTTP.get
var download_file_httpget = function(file_url, callback) {
console.log('downloading ' + file_url + '...');
var options = {
host: url.parse(file_url).host,
port: 80,
Expand Down Expand Up @@ -70,6 +77,7 @@ if (!(process.argv[2] == '--nocd')) {
}

var chromedriver_zip = chromedriver_url.split('/').pop();
start_script += ' -Dwebdriver.chrome.driver=./selenium/chromedriver';

download_file_httpget(chromedriver_url, function(file_name) {
var zip = new AdmZip(file_name);
Expand All @@ -79,3 +87,9 @@ if (!(process.argv[2] == '--nocd')) {
}
});
}

var start_script_file = fs.createWriteStream(START_SCRIPT_FILENAME);
start_script_file.write(start_script);
start_script_file.end(function() {
fs.chmod(START_SCRIPT_FILENAME, 0755);
});
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ the standalone server. Run
This installs selenium standalone server and chromedriver to `./selenium`. Start
the server with

java -jar selenium/selenium-server-standalone-2.35.0.jar -Dwebdriver.chrome.driver=./selenium/chromedriver
./selenium/start

Protractor is now available as a command line program which takes one argument,
a configuration file.
Expand Down

0 comments on commit 37e0f1a

Please sign in to comment.