Package io.webdevice.device
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 booleanacquired()java.lang.Stringcanonicalize(java.lang.String url)voidclose()java.lang.ObjectexecuteAsyncScript(java.lang.String script, java.lang.Object... args)java.lang.ObjectexecuteScript(java.lang.String script, java.lang.Object... args)org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by)java.util.List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.By by)voidget(java.lang.String url)java.net.URLgetBaseUrl()org.openqa.selenium.CapabilitiesgetCapabilities()java.lang.StringgetCurrentUrl()java.lang.StringgetDefaultDevice()java.lang.StringgetPageSource()<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> target)java.lang.StringgetTitle()java.lang.StringgetWindowHandle()java.util.Set<java.lang.String>getWindowHandles()WebDevicehome()voidinitialize()<Driver extends org.openqa.selenium.WebDriver, R>
Rinvoke(java.util.function.Function<Driver,R> function)booleanisEager()booleanisStrict()org.openqa.selenium.WebDriver.Optionsmanage()org.openqa.selenium.WebDriver.Navigationnavigate()WebDevicenavigateTo(java.lang.String relativePath)voidperform(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)<Driver extends org.openqa.selenium.WebDriver>
WebDeviceperform(java.util.function.Consumer<Driver> consumer)voidquit()voidrelease()voidresetInputState()voidsetBaseUrl(java.net.URL baseUrl)voidsetDefaultDevice(java.lang.String defaultDevice)voidsetEager(boolean eager)voidsetStrict(boolean strict)org.openqa.selenium.WebDriver.TargetLocatorswitchTo()WebDeviceuse(java.lang.String name)WebDeviceuseDefault()WebDevicewithBaseUrl(java.net.URL baseUrl)WebDevicewithDefaultDevice(java.lang.String defaultDevice)WebDevicewithEager(boolean eager)WebDevicewithStrict(boolean strict)
-
Constructor Details
-
Method Details
-
getBaseUrl
public java.net.URL getBaseUrl() -
setBaseUrl
public void setBaseUrl(java.net.URL baseUrl) -
withBaseUrl
-
getDefaultDevice
public java.lang.String getDefaultDevice() -
setDefaultDevice
public void setDefaultDevice(java.lang.String defaultDevice) -
withDefaultDevice
-
isEager
public boolean isEager() -
setEager
public void setEager(boolean eager) -
withEager
-
isStrict
public boolean isStrict() -
setStrict
public void setStrict(boolean strict) -
withStrict
-
initialize
@PostConstruct public void initialize() -
acquired
public boolean acquired() -
canonicalize
public java.lang.String canonicalize(java.lang.String url) -
use
-
useDefault
-
home
-
navigateTo
-
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:
getCapabilitiesin interfaceorg.openqa.selenium.HasCapabilities
-
executeScript
public java.lang.Object executeScript(java.lang.String script, java.lang.Object... args)- Specified by:
executeScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
public java.lang.Object executeAsyncScript(java.lang.String script, java.lang.Object... args)- Specified by:
executeAsyncScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException- Specified by:
getScreenshotAsin interfaceorg.openqa.selenium.TakesScreenshot- Throws:
org.openqa.selenium.WebDriverException
-
get
public void get(java.lang.String url)- Specified by:
getin interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
public java.lang.String getCurrentUrl()- Specified by:
getCurrentUrlin interfaceorg.openqa.selenium.WebDriver
-
getTitle
public java.lang.String getTitle()- Specified by:
getTitlein interfaceorg.openqa.selenium.WebDriver
-
findElements
public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)- Specified by:
findElementsin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementsin interfaceorg.openqa.selenium.WebDriver
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)- Specified by:
findElementin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementin interfaceorg.openqa.selenium.WebDriver
-
getPageSource
public java.lang.String getPageSource()- Specified by:
getPageSourcein interfaceorg.openqa.selenium.WebDriver
-
close
public void close()- Specified by:
closein interfaceorg.openqa.selenium.WebDriver
-
quit
public void quit()- Specified by:
quitin interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
public java.util.Set<java.lang.String> getWindowHandles()- Specified by:
getWindowHandlesin interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
public java.lang.String getWindowHandle()- Specified by:
getWindowHandlein interfaceorg.openqa.selenium.WebDriver
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo()- Specified by:
switchToin interfaceorg.openqa.selenium.WebDriver
-
navigate
public org.openqa.selenium.WebDriver.Navigation navigate()- Specified by:
navigatein interfaceorg.openqa.selenium.WebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()- Specified by:
managein interfaceorg.openqa.selenium.WebDriver
-
perform
public void perform(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)- Specified by:
performin interfaceorg.openqa.selenium.interactions.Interactive
-
resetInputState
public void resetInputState()- Specified by:
resetInputStatein interfaceorg.openqa.selenium.interactions.Interactive
-
release
@PreDestroy public void release()
-