From f72137da7af70ec25dd59b7bf2bf9cee4b5cc897 Mon Sep 17 00:00:00 2001 From: Daan Sieben Date: Tue, 6 Jan 2015 15:53:49 +0100 Subject: [PATCH] Attempt to support chromedriver --- README.md | 3 +-- tasks/selenium_webdriver.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b97fc77..57eb8df 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ We wrote this after extensive problems getting selenium webdriver tests to run in all local and 3rd party environments. If you are using circleci and want to run headless tests then the selenium_phantom_hub task will do the trick. -Note that we have found probems with selenium and bundled chromedriver but at the current time we do not have an option to start chromedriver in the same way as phantomjs. Our advice is use firefox and phantom for CI testing and saucelabs / local for the rest. - ## Getting Started This plugin requires Grunt `~0.4.2` @@ -53,6 +51,7 @@ You can see we do this in our tests, have a look at our GruntFile setup for the - timeout - maxSession - phantomPort +- chromeDriver ### Usage Examples diff --git a/tasks/selenium_webdriver.js b/tasks/selenium_webdriver.js index 8cee287..3668780 100644 --- a/tasks/selenium_webdriver.js +++ b/tasks/selenium_webdriver.js @@ -145,6 +145,9 @@ function start( next, isHeadless, options ) { selOptions.push( '-maxSession' ); selOptions.push( options.maxSession ); } + if ( options.chromeDriver) { + selOptions.push( '-Dwebdriver.chrome.driver=' + options.chromeDriver); + } var spawnOptions = options['cwd'] ? {cwd: options['cwd']} : null; seleniumServerProcess = spawn( 'java', selOptions, spawnOptions ); @@ -259,6 +262,7 @@ module.exports= function ( grunt) { host: '127.0.0.1', port: 4444, maxSession: false, + chromeDriver : false, cwd: null }); var done = this.async();