Class WebDevice

java.lang.Object
io.webdevice.device.WebDevice
All Implemented Interfaces:
org.openqa.selenium.HasCapabilities, org.openqa.selenium.interactions.Interactive, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebDriver

public class WebDevice
extends java.lang.Object
implements org.openqa.selenium.WebDriver, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.HasCapabilities, org.openqa.selenium.interactions.Interactive, org.openqa.selenium.TakesScreenshot
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver

    org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
  • Constructor Summary

    Constructors 
    Constructor Description
    WebDevice​(DeviceRegistry registry)  
  • Method Summary

    Modifier and Type Method Description
    boolean acquired()  
    java.lang.String canonicalize​(java.lang.String url)  
    void close()  
    java.lang.Object executeAsyncScript​(java.lang.String script, java.lang.Object... args)  
    java.lang.Object executeScript​(java.lang.String script, java.lang.Object... args)  
    org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by)  
    java.util.List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.By by)  
    void get​(java.lang.String url)  
    java.net.URL getBaseUrl()  
    org.openqa.selenium.Capabilities getCapabilities()  
    java.lang.String getCurrentUrl()  
    java.lang.String getDefaultDevice()  
    java.lang.String getPageSource()  
    <X> X getScreenshotAs​(org.openqa.selenium.OutputType<X> target)  
    java.lang.String getTitle()  
    java.lang.String getWindowHandle()  
    java.util.Set<java.lang.String> getWindowHandles()  
    WebDevice home()  
    void initialize()  
    <Driver extends org.openqa.selenium.WebDriver,​ R>
    R
    invoke​(java.util.function.Function<Driver,​R> function)  
    boolean isEager()  
    boolean isStrict()  
    org.openqa.selenium.WebDriver.Options manage()  
    org.openqa.selenium.WebDriver.Navigation navigate()  
    WebDevice navigateTo​(java.lang.String relativePath)  
    void perform​(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)  
    <Driver extends org.openqa.selenium.WebDriver>
    WebDevice
    perform​(java.util.function.Consumer<Driver> consumer)  
    void quit()  
    void release()  
    void resetInputState()  
    void setBaseUrl​(java.net.URL baseUrl)  
    void setDefaultDevice​(java.lang.String defaultDevice)  
    void setEager​(boolean eager)  
    void setStrict​(boolean strict)  
    org.openqa.selenium.WebDriver.TargetLocator switchTo()  
    WebDevice use​(java.lang.String name)  
    WebDevice useDefault()  
    WebDevice withBaseUrl​(java.net.URL baseUrl)  
    WebDevice withDefaultDevice​(java.lang.String defaultDevice)  
    WebDevice withEager​(boolean eager)  
    WebDevice withStrict​(boolean strict)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getBaseUrl

      public java.net.URL getBaseUrl()
    • setBaseUrl

      public void setBaseUrl​(java.net.URL baseUrl)
    • withBaseUrl

      public WebDevice withBaseUrl​(java.net.URL baseUrl)
    • getDefaultDevice

      public java.lang.String getDefaultDevice()
    • setDefaultDevice

      public void setDefaultDevice​(java.lang.String defaultDevice)
    • withDefaultDevice

      public WebDevice withDefaultDevice​(java.lang.String defaultDevice)
    • isEager

      public boolean isEager()
    • setEager

      public void setEager​(boolean eager)
    • withEager

      public WebDevice withEager​(boolean eager)
    • isStrict

      public boolean isStrict()
    • setStrict

      public void setStrict​(boolean strict)
    • withStrict

      public WebDevice withStrict​(boolean strict)
    • initialize

      @PostConstruct public void initialize()
    • acquired

      public boolean acquired()
    • canonicalize

      public java.lang.String canonicalize​(java.lang.String url)
    • use

      public WebDevice use​(java.lang.String name)
    • useDefault

      public WebDevice useDefault()
    • home

      public WebDevice home()
    • navigateTo

      public WebDevice navigateTo​(java.lang.String relativePath)
    • perform

      public <Driver extends org.openqa.selenium.WebDriver> WebDevice perform​(java.util.function.Consumer<Driver> consumer)
    • invoke

      public <Driver extends org.openqa.selenium.WebDriver,​ R> R invoke​(java.util.function.Function<Driver,​R> function)
    • getCapabilities

      public org.openqa.selenium.Capabilities getCapabilities()
      Specified by:
      getCapabilities in interface org.openqa.selenium.HasCapabilities
    • executeScript

      public java.lang.Object executeScript​(java.lang.String script, java.lang.Object... args)
      Specified by:
      executeScript in interface org.openqa.selenium.JavascriptExecutor
    • executeAsyncScript

      public java.lang.Object executeAsyncScript​(java.lang.String script, java.lang.Object... args)
      Specified by:
      executeAsyncScript in interface org.openqa.selenium.JavascriptExecutor
    • getScreenshotAs

      public <X> X getScreenshotAs​(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException
      Specified by:
      getScreenshotAs in interface org.openqa.selenium.TakesScreenshot
      Throws:
      org.openqa.selenium.WebDriverException
    • get

      public void get​(java.lang.String url)
      Specified by:
      get in interface org.openqa.selenium.WebDriver
    • getCurrentUrl

      public java.lang.String getCurrentUrl()
      Specified by:
      getCurrentUrl in interface org.openqa.selenium.WebDriver
    • getTitle

      public java.lang.String getTitle()
      Specified by:
      getTitle in interface org.openqa.selenium.WebDriver
    • findElements

      public java.util.List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.By by)
      Specified by:
      findElements in interface org.openqa.selenium.SearchContext
      Specified by:
      findElements in interface org.openqa.selenium.WebDriver
    • findElement

      public org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by)
      Specified by:
      findElement in interface org.openqa.selenium.SearchContext
      Specified by:
      findElement in interface org.openqa.selenium.WebDriver
    • getPageSource

      public java.lang.String getPageSource()
      Specified by:
      getPageSource in interface org.openqa.selenium.WebDriver
    • close

      public void close()
      Specified by:
      close in interface org.openqa.selenium.WebDriver
    • quit

      public void quit()
      Specified by:
      quit in interface org.openqa.selenium.WebDriver
    • getWindowHandles

      public java.util.Set<java.lang.String> getWindowHandles()
      Specified by:
      getWindowHandles in interface org.openqa.selenium.WebDriver
    • getWindowHandle

      public java.lang.String getWindowHandle()
      Specified by:
      getWindowHandle in interface org.openqa.selenium.WebDriver
    • switchTo

      public org.openqa.selenium.WebDriver.TargetLocator switchTo()
      Specified by:
      switchTo in interface org.openqa.selenium.WebDriver
    • navigate

      public org.openqa.selenium.WebDriver.Navigation navigate()
      Specified by:
      navigate in interface org.openqa.selenium.WebDriver
    • manage

      public org.openqa.selenium.WebDriver.Options manage()
      Specified by:
      manage in interface org.openqa.selenium.WebDriver
    • perform

      public void perform​(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)
      Specified by:
      perform in interface org.openqa.selenium.interactions.Interactive
    • resetInputState

      public void resetInputState()
      Specified by:
      resetInputState in interface org.openqa.selenium.interactions.Interactive
    • release

      @PreDestroy public void release()