in src/main/script/prerequisiteCheckFramework.groovy [50:97]
def checkGeckoDriver() {
print "Checking Gecko WebDriver configuration: "
String webdriverGeckoDriverPath = geckoProperty
if(webdriverGeckoDriverPath == null || webdriverGeckoDriverPath.isEmpty()) {
println "Failed"
println ""
println "When running the 'with-ui-testsuite' profile it is mandatory to pass along the path to the Gecko Webdriver in the 'webdriver.gecko.driver' variable."
println "Get versions from: https://github.com/mozilla/geckodriver/releases"
if(os == "win") {
println "Pass the location to the 'geckodriver.exe' executable by adding '-Dwebdriver.gecko.driver={path-to-geckodriver.exe}' to your maven build command"
} else {
println "Pass the location to the 'geckodriver' executable by adding '-Dwebdriver.gecko.driver={path-to-geckodriver}' to your maven build command"
}
println ""
allConditionsMet = false
return
}
// If the property is specified with surrounding double-quotes, remove them.
if(webdriverGeckoDriverPath.startsWith("\"") && webdriverGeckoDriverPath.endsWith("\"")) {
flashplayerDebuggerPath = webdriverGeckoDriverPath.substring(1, webdriverGeckoDriverPath.length() - 1)
}
File webdriverGeckoDriverFile = new File(webdriverGeckoDriverPath)
if(webdriverGeckoDriverFile.exists()) {
if(webdriverGeckoDriverFile.exists()) {
if(!webdriverGeckoDriverFile.isFile()) {
println "Failed: 'webdriver.gecko.driver' must point to a file"
allConditionsMet = false
return
}
def output = (webdriverGeckoDriverPath + " --version").execute().text
Matcher matcher = extractVersion(output)
if(matcher.size() > 0) {
def curVersion = matcher[0][1]
println "OK (Gecko Version " + curVersion + ")"
} else {
println "Failed"
println ""
println "not a valid Gecko WebDriver executable at " + webdriverGeckoDriverPath
allConditionsMet = false
}
} else {
println "Failed: File referenced by 'webdriver.gecko.driver' does not exist. " + webdriverGeckoDriverPath
allConditionsMet = false
}
}
}