1- var async_exec = require ( 'child_process' ) . exec
1+ var async_exec = require ( 'child_process' ) . exec
22
3- async_exec ( 'npm install shelljs' , function ( err , stdout , stderr ) {
4- require ( 'shelljs/global' ) ;
3+ async_exec ( 'npm install shelljs' , function ( err , stdout , stderr ) {
4+ require ( 'shelljs/global' ) ;
55
66 //detect OS
7- var os = require ( 'os' )
8- , isWin = / ^ w i n 3 2 / . test ( os . platform ( ) )
9- , isLinux = / ^ l i n u x / . test ( os . platform ( ) )
10- , isMac = / ^ d a r w i n / . test ( os . platform ( ) ) || / ^ f r e e b s d / . test ( os . platform ( ) ) ;
7+ var os = require ( 'os' )
8+ , isWin = / ^ w i n 3 2 / . test ( os . platform ( ) )
9+ , isLinux = / ^ l i n u x / . test ( os . platform ( ) )
10+ , isMac = / ^ d a r w i n / . test ( os . platform ( ) ) || / ^ f r e e b s d / . test ( os . platform ( ) ) ;
1111
12- echo ( 'About to setup protractor and dependencies.' ) ;
13- echo ( 'It works if it finishes with OK' ) ;
12+ echo ( 'About to setup protractor and dependencies.' ) ;
13+ echo ( 'It works if it finishes with OK' ) ;
1414
1515 //Selenium Standalone Server - required for protractor e2e testing
1616 //Note: Protractor comes with a script to help download and install the standalone server. Run 'webdriver-manager-update': https://github.com/angular/protractor/blob/master/docs/getting-started.md
1717 //https://code.google.com/p/selenium/downloads/list
1818 //Size: ~33mb
19- echo ( 'Downloading specific Selenium Server jar...' ) ;
20- exec ( 'wget http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar' ) ;
21- exec ( 'mv selenium-server-standalone-2.39.0.jar scripts/selenium-server-standalone-2.39.0.jar' ) ;
19+ echo ( 'Downloading specific Selenium Server jar...' ) ;
20+ exec ( 'wget http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar' ) ;
21+ exec ( 'mv selenium-server-standalone-2.39.0.jar scripts/selenium-server-standalone-2.39.0.jar' ) ;
2222
2323 //Chrome driver required to run Chrome on Selenium Server
2424 //Note: download file is based on OS (CLI to handle which one to download)
@@ -32,37 +32,42 @@ async_exec('npm install shelljs', function (err, stdout, stderr) {
3232 } else if ( isMac ) {
3333 chromedriverLink = 'chromedriver_mac32.zip' ;
3434 }
35- echo ( 'Downloading OS specific Chromedriver...' ) ;
36- exec ( 'wget http://chromedriver.storage.googleapis.com/2.8/' + chromedriverLink ) ;
37- exec ( 'unzip ' + chromedriverLink ) ;
38- exec ( 'mv Chromedriver.exe scripts/Chromedriver.exe' ) ;
39- exec ( 'rm ' + chromedriverLink ) ;
35+ echo ( 'Downloading OS specific Chromedriver...' ) ;
36+ exec ( 'wget http://chromedriver.storage.googleapis.com/2.8/' + chromedriverLink ) ;
37+ exec ( 'unzip ' + chromedriverLink ) ;
38+
39+ if ( isWin ) {
40+ exec ( 'mv Chromedriver.exe scripts/Chromedriver.exe' ) ;
41+ } else {
42+ exec ( 'mv Chromedriver scripts/Chromedriver' ) ;
43+ }
44+ exec ( 'rm ' + chromedriverLink ) ;
4045
4146 //PhantomJS driver required to run on Selenium Server
4247 //Note: download file is based on OS (CLI to handle which one to download)
4348 //http://phantomjs.org/download.html
4449 //Size: ~7mb
4550 var phantomjsLink , linkExt ;
46- if ( isWin ) {
51+ if ( isWin ) {
4752 phantomjsLink = 'phantomjs-1.9.2-windows' ;
4853 linkExt = '.zip' ;
49- } else if ( isLinux ) {
54+ } else if ( isLinux ) {
5055 phantomjsLink = 'phantomjs-1.9.2-linux-i686' ;
5156 linkExt = '.tar.bz2' ;
52- } else if ( isMac ) {
57+ } else if ( isMac ) {
5358 phantomjsLink = 'phantomjs-1.9.2-macosx' ;
5459 linkExt = '.zip' ;
5560 }
56- echo ( 'Downloading OS specific Phantomjs...' ) ;
57- exec ( 'wget http://phantomjs.googlecode.com/files/' + phantomjsLink + linkExt ) ;
61+ echo ( 'Downloading OS specific Phantomjs...' ) ;
62+ exec ( 'wget http://phantomjs.googlecode.com/files/' + phantomjsLink + linkExt ) ;
5863 if ( isLinux ) {
59- exec ( 'tar -xjvf ' + phantomjsLink + linkExt ) ;
64+ exec ( 'tar -xjvf ' + phantomjsLink + linkExt ) ;
6065 } else {
61- exec ( 'unzip ' + phantomjsLink + linkExt ) ;
66+ exec ( 'unzip ' + phantomjsLink + linkExt ) ;
6267 }
63- exec ( 'mv ' + phantomjsLink + '/phantomjs.exe scripts/phantomjs.exe' ) ;
64- exec ( 'rm ' + phantomjsLink + linkExt ) ;
65- exec ( 'rm -rf ' + phantomjsLink ) ;
68+ exec ( 'mv ' + phantomjsLink + '/phantomjs.exe scripts/phantomjs.exe' ) ;
69+ exec ( 'rm ' + phantomjsLink + linkExt ) ;
70+ exec ( 'rm -rf ' + phantomjsLink ) ;
6671
67- echo ( 'OK!' ) ;
72+ echo ( 'OK!' ) ;
6873} ) ;
0 commit comments