設定檔

  • 在開始動手之前,來看看 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
        }
    }
}

results matching ""

    No results matching ""