Skip to content

Instantly share code, notes, and snippets.

@willis7
Created October 2, 2013 17:13
Show Gist options
  • Save willis7/6797058 to your computer and use it in GitHub Desktop.
Save willis7/6797058 to your computer and use it in GitHub Desktop.
This is a better implementation of the selenium test task which can now take any browser we wish.
tasks.addRule('Rule Usage: intTest<Browser>') { String taskName ->
if(taskName.startsWith('intTest')) {
task(taskName, type: Test) {
ext.browser = taskName - 'intTest'
systemProperties['LOCAL_DRIVER'] = false
systemProperties['REMOTE_DRIVER'] = true
systemProperties['SAUCE_DRIVER'] = false
systemProperties['BROWSER'] = ext.browser
systemProperties['GRID_HOST'] = 'localhost'
systemProperties['GRID_PORT'] = '4444'
systemProperties['PLATFORM'] = 'WINDOWS'
systemProperties['BASE_TEST_RESULTS_PATH'] = "$buildDir/Screenshots/$version"
systemProperties['APPLICATION_URL'] = 'http://someurl'
maxParallelForks = 2
testClassesDir = sourceSets.inttest.output.classesDir
classpath = sourceSets.inttest.runtimeClasspath
useTestNG()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment