Created
December 27, 2014 04:13
-
-
Save JLarky/332595b1aeaf0c428968 to your computer and use it in GitHub Desktop.
protractor config file you can use without `webdriver-manager start` or `gulp webdriver_standalone`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var findSeleniumJar = function(dir) { | |
var fs = require('fs'); | |
var _ = require('underscore'); | |
var files = fs.readdirSync(dir); | |
var found; | |
var count = 0; | |
_.each(files, function (file) { | |
if (file.match('^selenium-server-standalone-(.+)\.jar$')) { | |
count++; | |
found = file; | |
} | |
}) | |
if (count == 0) { | |
console.error('No version of selenium driver was found. Run `webdriver-manager update`') | |
return; | |
} | |
else if (count > 1) { | |
console.log("Multiple versions of selenium driver found. Using " + found) | |
} | |
return fs.realpathSync(dir) + '/' + found | |
} | |
exports.config = { | |
// seleniumAddress: 'http://localhost:4444/wd/hub' | |
seleniumServerJar: findSeleniumJar('./node_modules/protractor/selenium') | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment