Skip to content

Instantly share code, notes, and snippets.

@koizuss
Created June 1, 2013 08:29
Show Gist options
  • Save koizuss/5689688 to your computer and use it in GitHub Desktop.
Save koizuss/5689688 to your computer and use it in GitHub Desktop.
setup webdriver on gradle
ext {
webdriver {
chrome {
driver = file('tools/chromedriver/chromedriver')
}
}
}
task setupChromeDriver << {
ext {
src = 'https://chromedriver.googlecode.com/files/chromedriver2_mac32_0.9.zip'
dest = file(webdriver.chrome.driver.parent + '/archives')
zipfile = new File(dest.path, src.split('/')[-1])
}
if(!dest.exists()) assert dest.mkdirs(), "mkdir failed [$dest]"
if(!zipfile.exists()) ant.get(src: src, dest: dest, verbose: true)
assert zipfile.exists(), "download failed [$src]"
copy {
from zipTree(zipfile)
into webdriver.chrome.driver.parent
}.execute()
}
task setup(dependsOn: setupChromeDriver)
test.doFirst {
systemProperty 'webdriver.chrome.driver', chromeDriver
}
@joviano-dias
Copy link

This will work only on a mac. Getting it to work on linux, mac and windows is going to be tedious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment