As i hope you can see its a little clunky:
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
task intTestFirefox(type: Test) { | |
maxParallelForks = 2 | |
systemProperties['LOCAL_DRIVER'] = false | |
systemProperties['REMOTE_DRIVER'] = true | |
systemProperties['SAUCE_DRIVER'] = false | |
systemProperties['GRID_HOST'] = 'localhost' | |
systemProperties['GRID_PORT'] = '4444' | |
systemProperties['BROWSER'] = 'firefox' | |
systemProperties['PLATFORM'] = 'WINDOWS' | |
systemProperties['BASE_TEST_RESULTS_PATH'] = "$buildDir/Screenshots/$version" | |
systemProperties['APPLICATION_URL'] = 'http://someurl' | |
testClassesDir = sourceSets.inttest.output.classesDir | |
classpath = sourceSets.inttest.runtimeClasspath | |
useTestNG() | |
} | |
task intTestChrome(type: Test) { | |
maxParallelForks = 2 | |
systemProperties['LOCAL_DRIVER'] = false | |
systemProperties['REMOTE_DRIVER'] = true | |
systemProperties['SAUCE_DRIVER'] = false | |
systemProperties['GRID_HOST'] = 'localhost' | |
systemProperties['GRID_PORT'] = '4444' | |
systemProperties['BROWSER'] = 'chrome' | |
systemProperties['webdriver.chrome.driver'] = 'C:/Automation/lib/chromedriver.exe' | |
systemProperties['PLATFORM'] = 'WINDOWS' | |
systemProperties['BASE_TEST_RESULTS_PATH'] = "$buildDir/Screenshots/$version" | |
systemProperties['APPLICATION_URL'] = 'http://someurl' | |
testClassesDir = sourceSets.inttest.output.classesDir | |
classpath = sourceSets.inttest.runtimeClasspath | |
useTestNG() | |
} |
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
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() | |
} | |
} | |
} |
0 comments:
Post a Comment