我不太可能每個設定都介紹,所以我們回頭來看看 Configuration API
有哪些東西可以設定?找set開頭的method
又該怎麼設?
setReportOnTestFailureOnly(boolean value)
reportOnTestFailureOnly = true
setBaseUrl(def baseUrl)
baseUrl = "http://localhost:8080"
setReportsDir(File reportsDir)
reportsDir = new File("target/geb-reports")
setDriver(WebDriver driver)
driver = {
def driver = new FirefoxDriver()
driver.javascriptEnabled = true
driver
}
setUnexpectedPages(Collection pages)
unexpectedPages = [PageNotFoundPage, InternalServerErrorPage]
setDefaultWaitTimeout(Double defaultWaitTimeout)
setDefaultWaitRetryInterval(Double defaultWaitRetryInterval)
waiting {
timeout = 5
retryInterval = 0.1
}
setWaitPreset(String name, Double presetTimeout, Double presetRetryInterval)
waiting {
presets {
slow {
timeout = 20
retryInterval = 1
}
quick {
timeout = 1
}
}
}