Added start.js Creates 'log' folder

This commit is contained in:
Jesse 2015-08-10 16:04:31 -07:00 committed by Victor Woeltjen
parent 85f9d5a2da
commit fde0dc2a35
4 changed files with 36 additions and 15 deletions

View File

@ -2,18 +2,29 @@ E2e Protractor Tests.
1. Instructions:
1. ctrl.sh: contains start up, stop, and run scripts.
* May need to modify DIRECTORY variable to reflect location of MMAP. *
-start: This will start 3 processes: MMAP, webdriver, and elastic search, all 3 are needed.
-run: run will run the protractor tests. (protractor conf.js)
-stop: stop will kill the 3 process started by the start command.
1. 3 Control Scripts located in bin/.
run.js : node script used to start tests
start.js : node script used to setup test(starts node,localstorage and webdriver)
stop.js : node script, kills the 3 process started in start.js.
2. Use npm(Node Package Mangager) to Run Scripts.
*"npm link" will put the scripts on your system path.
a. cd protractor;
b. npm install;
c. npm link; (optional)
d. script_name
-start
-run
-stop
(optional: Scripts NOT on path)
a. To Run
-./bin/start.js
-./bin/run.js
-./bin/stop.js
3. To remove the scripts from path run
-npm unlink
2. example:
cd protractor
./ctrl.sh start
./ctrl.sh run
*Note: multiple test can be run at this point.
./ctrl.sh stop
2. Directory Hierachy:

View File

@ -11,7 +11,7 @@ try {
///Users/jsanderf/git/elastic/wtd/protractor/bin
var startdir = process.cwd();
var command;
mkdir(__dirname + '/../logs');
command = __dirname + "/../node_modules/protractor/bin/webdriver-manager update";
console.log("Installing Webdriver");

View File

@ -29,6 +29,16 @@ ps.list(function(err, results) {
console.log(stdout);
});
}
if((process.command.indexOf("protractor")) != -1) {
console.log();
console.log( 'Killing Protractor Driver: %s', process.command);
ps.kill(process.pid, function(err, stdout) {
if (err){
throw new Error(err);
}
console.log(stdout);
});
}
});
});

View File

@ -24,6 +24,6 @@
module.exports = function launch() {
'use strict';
browser.ignoreSynchronization = true;
browser.get('http://localhost:1984/warp');
browser.get('http://localhost:1984');
browser.sleep(2000); // 2 seconds
};