Package play.test

Class TestBrowser

  • All Implemented Interfaces:
    io.fluentlenium.adapter.IFluentAdapter, io.fluentlenium.configuration.Configuration, io.fluentlenium.configuration.ConfigurationMutator, io.fluentlenium.configuration.ConfigurationProperties, io.fluentlenium.core.action.InputControl, io.fluentlenium.core.alert.AlertControl, io.fluentlenium.core.capabilities.CapabilitiesControl, io.fluentlenium.core.components.ComponentInstantiator, io.fluentlenium.core.css.CssControl, io.fluentlenium.core.events.EventsControl, io.fluentlenium.core.FluentControl, io.fluentlenium.core.inject.FluentInjectControl, io.fluentlenium.core.navigation.NavigationControl, io.fluentlenium.core.performance.PerformanceTimingControl, io.fluentlenium.core.script.JavascriptControl, io.fluentlenium.core.search.SearchControl<io.fluentlenium.core.domain.FluentWebElement>, io.fluentlenium.core.SeleniumDriverControl, io.fluentlenium.core.snapshot.SnapshotControl, io.fluentlenium.core.wait.AwaitControl, io.fluentlenium.utils.chromium.ChromiumControl

    public class TestBrowser
    extends io.fluentlenium.adapter.FluentAdapter
    A test browser (Using Selenium WebDriver) with the FluentLenium API (https://github.com/Fluentlenium/FluentLenium).
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.fluentlenium.configuration.ConfigurationProperties

        io.fluentlenium.configuration.ConfigurationProperties.DriverLifecycle, io.fluentlenium.configuration.ConfigurationProperties.TriggerMode
    • Constructor Summary

      Constructors 
      Constructor Description
      TestBrowser​(Class<? extends org.openqa.selenium.WebDriver> webDriver, String baseUrl)
      A test browser (Using Selenium WebDriver) with the FluentLenium API (https://github.com/Fluentlenium/FluentLenium).
      TestBrowser​(org.openqa.selenium.WebDriver webDriver, String baseUrl)
      A test browser (Using Selenium WebDriver) with the FluentLenium API (https://github.com/Fluentlenium/FluentLenium).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.openqa.selenium.support.ui.FluentWait<org.openqa.selenium.WebDriver> fluentWait()
      Creates a generic FluentWait<WebDriver> instance using the underlying web driver.
      org.openqa.selenium.WebDriver.Options manage()
      Retrieves the underlying option interface that can be used to set cookies, manage timeouts among other things.
      <T> T waitUntil​(Function<org.openqa.selenium.WebDriver,​T> f)
      Repeatedly applies this instance's input value to the given function until one of the following occurs: the function returns neither null nor false, the function throws an unignored exception, the default timeout expires useful in situations where FluentAdapter#await is too specific (for example to check against page source or title)
      <T> T waitUntil​(org.openqa.selenium.support.ui.FluentWait<org.openqa.selenium.WebDriver> wait, Function<org.openqa.selenium.WebDriver,​T> f)
      Repeatedly applies this instance's input value to the given function until one of the following occurs: the function returns neither null nor false, the function throws an unignored exception, the timeout expires
      • Methods inherited from class io.fluentlenium.adapter.FluentAdapter

        getDriver, getFluentControl
      • Methods inherited from class io.fluentlenium.core.FluentControlImpl

        getConfiguration, getControlContainer
      • Methods inherited from interface io.fluentlenium.core.FluentControl

        alert, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, await, canTakeScreenShot, capabilities, css, el, events, executeAsyncScript, executeScript, find, find, find, find, getAppiumDriver, getAwaitAtMost, getAwaitPollingEvery, getBaseUrl, getBrowserTimeout, getBrowserTimeoutRetries, getCapabilities, getChromiumApi, getConfiguration, getConfigurationDefaults, getConfigurationFactory, getControlContainer, getCookie, getCookies, getCustomProperty, getDeleteCookies, getDriverLifecycle, getEventsEnabled, getHtmlDumpMode, getHtmlDumpPath, getImplicitlyWait, getPageLoadTimeout, getRemoteUrl, getScreenshotMode, getScreenshotPath, getScriptTimeout, getWebDriver, goTo, goTo, goToInNewTab, inject, injectComponent, isComponentClass, isComponentListClass, keyboard, mouse, newComponent, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newFluent, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newInstance, pageSource, performanceTiming, setAwaitAtMost, setAwaitPollingEvery, setBaseUrl, setBrowserTimeout, setBrowserTimeoutRetries, setCapabilities, setConfigurationFactory, setCustomProperty, setDeleteCookies, setDriverLifecycle, setEventsEnabled, setHtmlDumpMode, setHtmlDumpPath, setImplicitlyWait, setPageLoadTimeout, setRemoteUrl, setScreenshotMode, setScreenshotPath, setScriptTimeout, setWebDriver, switchTo, switchTo, switchTo, switchToDefault, takeHtmlDump, takeHtmlDump, takeScreenshot, takeScreenshot, url, window
      • Methods inherited from interface io.fluentlenium.adapter.IFluentAdapter

        initFluent, initFluent, isFluentControlAvailable, newWebDriver, releaseFluent, setFluentControl
      • Methods inherited from interface io.fluentlenium.core.search.SearchControl

        $, $, $, $, $, el, el, el, el
    • Constructor Detail

      • TestBrowser

        public TestBrowser​(Class<? extends org.openqa.selenium.WebDriver> webDriver,
                           String baseUrl)
                    throws Exception
        A test browser (Using Selenium WebDriver) with the FluentLenium API (https://github.com/Fluentlenium/FluentLenium).
        Parameters:
        webDriver - The WebDriver instance to use.
        baseUrl - The base url to use for relative requests.
        Throws:
        Exception - if the webdriver cannot be created.
      • TestBrowser

        public TestBrowser​(org.openqa.selenium.WebDriver webDriver,
                           String baseUrl)
        A test browser (Using Selenium WebDriver) with the FluentLenium API (https://github.com/Fluentlenium/FluentLenium).
        Parameters:
        webDriver - The WebDriver instance to use.
        baseUrl - The base url to use for relative requests.
    • Method Detail

      • fluentWait

        public org.openqa.selenium.support.ui.FluentWait<org.openqa.selenium.WebDriver> fluentWait()
        Creates a generic FluentWait<WebDriver> instance using the underlying web driver.
        Returns:
        the webdriver contained in a fluent wait.
      • waitUntil

        public <T> T waitUntil​(org.openqa.selenium.support.ui.FluentWait<org.openqa.selenium.WebDriver> wait,
                               Function<org.openqa.selenium.WebDriver,​T> f)
        Repeatedly applies this instance's input value to the given function until one of the following occurs: the function returns neither null nor false, the function throws an unignored exception, the timeout expires

        Useful in situations where FluentAdapter#await is too specific (for example to check against page source)

        Type Parameters:
        T - the return type
        Parameters:
        wait - generic FluentWait<WebDriver> instance
        f - function to execute
        Returns:
        the return value
      • waitUntil

        public <T> T waitUntil​(Function<org.openqa.selenium.WebDriver,​T> f)
        Repeatedly applies this instance's input value to the given function until one of the following occurs:
        • the function returns neither null nor false,
        • the function throws an unignored exception,
        • the default timeout expires
        useful in situations where FluentAdapter#await is too specific (for example to check against page source or title)
        Type Parameters:
        T - the return type
        Parameters:
        f - function to execute
        Returns:
        the return value.
      • manage

        public org.openqa.selenium.WebDriver.Options manage()
        Retrieves the underlying option interface that can be used to set cookies, manage timeouts among other things.
        Returns:
        the web driver options.