Package org.fluentlenium.core
Class FluentPage
- java.lang.Object
-
- org.fluentlenium.core.FluentControlImpl
-
- org.fluentlenium.core.DefaultFluentContainer
-
- org.fluentlenium.core.FluentPage
-
- All Implemented Interfaces:
Configuration,ConfigurationMutator,ConfigurationProperties,InputControl,AlertControl,CapabilitiesControl,ComponentInstantiator,CssControl,EventsControl,FluentContainer,FluentControl,FluentPageControl,FluentInjectControl,NavigationControl,JavascriptControl,SearchControl<FluentWebElement>,SeleniumDriverControl,SnapshotControl,AwaitControl
public class FluentPage extends DefaultFluentContainer implements FluentPageControl
Use the Page Object Pattern to have more resilient tests.Extend this class and use @
PageUrland @FindByannotations to provide injectable Page Objects to FluentLenium.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode
-
-
Field Summary
-
Fields inherited from class org.fluentlenium.core.DefaultFluentContainer
control
-
-
Constructor Summary
Constructors Constructor Description FluentPage()Creates a new fluent page.FluentPage(FluentControl control)Creates a new fluent page, using given fluent control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassAnnotationsgetClassAnnotations()java.lang.StringgetUrl()URL of the page It can contains mandatory parameters{param}and optional parameters{param1}java.lang.StringgetUrl(java.lang.Object... parameters)URL of the page, after replacing parameters with given values.<P extends FluentPage>
Pgo()Go to the url defined in the page<P extends FluentPage>
Pgo(java.lang.Object... params)Got to the url defined in the page, using given parameters.voidisAt()Check if the browser is on this page.voidisAt(java.lang.Object... parameters)Check if the browser is on this page, after replacing parameters with given values.voidisAtUsingSelector(org.openqa.selenium.By by)Selector matching implementation for isAt().voidisAtUsingUrl(java.lang.String urlTemplate)URL matching implementation for isAt().ParsedUrlTemplateparseUrl()Get the parameter values of page URL extracted from current URL.ParsedUrlTemplateparseUrl(java.lang.String url)Get the parameter values of page URL extracted from given URL.-
Methods inherited from class org.fluentlenium.core.DefaultFluentContainer
getDriver, getFluentControl, initFluent
-
Methods inherited from class org.fluentlenium.core.FluentControlImpl
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, getAwaitAtMost, getAwaitPollingEvery, getBaseUrl, getBrowserTimeout, getBrowserTimeoutRetries, getCapabilities, 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, 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.fluentlenium.core.alert.AlertControl
alert
-
Methods inherited from interface org.fluentlenium.core.wait.AwaitControl
await
-
Methods inherited from interface org.fluentlenium.core.capabilities.CapabilitiesControl
capabilities
-
Methods inherited from interface org.fluentlenium.core.components.ComponentInstantiator
asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, isComponentClass, isComponentListClass, newComponent, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newFluent, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList
-
Methods inherited from interface org.fluentlenium.configuration.ConfigurationMutator
setAwaitAtMost, setAwaitPollingEvery, setBaseUrl, setBrowserTimeout, setBrowserTimeoutRetries, setCapabilities, setConfigurationFactory, setCustomProperty, setDeleteCookies, setDriverLifecycle, setEventsEnabled, setHtmlDumpMode, setHtmlDumpPath, setImplicitlyWait, setPageLoadTimeout, setRemoteUrl, setScreenshotMode, setScreenshotPath, setScriptTimeout, setWebDriver
-
Methods inherited from interface org.fluentlenium.configuration.ConfigurationProperties
getAwaitAtMost, getAwaitPollingEvery, getBaseUrl, getBrowserTimeout, getBrowserTimeoutRetries, getCapabilities, getConfigurationDefaults, getConfigurationFactory, getCustomProperty, getDeleteCookies, getDriverLifecycle, getEventsEnabled, getHtmlDumpMode, getHtmlDumpPath, getImplicitlyWait, getPageLoadTimeout, getRemoteUrl, getScreenshotMode, getScreenshotPath, getScriptTimeout, getWebDriver
-
Methods inherited from interface org.fluentlenium.core.css.CssControl
css
-
Methods inherited from interface org.fluentlenium.core.events.EventsControl
events
-
Methods inherited from interface org.fluentlenium.core.inject.FluentInjectControl
inject, injectComponent, newInstance
-
Methods inherited from interface org.fluentlenium.core.action.InputControl
keyboard, mouse
-
Methods inherited from interface org.fluentlenium.core.script.JavascriptControl
executeAsyncScript, executeScript
-
Methods inherited from interface org.fluentlenium.core.navigation.NavigationControl
getCookie, getCookies, goTo, goTo, goToInNewTab, pageSource, switchTo, switchTo, switchTo, switchToDefault, url, window
-
Methods inherited from interface org.fluentlenium.core.search.SearchControl
$, $, $, $, el, el, el, el, find, find, find, find
-
Methods inherited from interface org.fluentlenium.core.SeleniumDriverControl
getDriver
-
Methods inherited from interface org.fluentlenium.core.snapshot.SnapshotControl
canTakeScreenShot, takeHtmlDump, takeHtmlDump, takeScreenshot, takeScreenshot
-
-
-
-
Constructor Detail
-
FluentPage
public FluentPage()
Creates a new fluent page.
-
FluentPage
public FluentPage(FluentControl control)
Creates a new fluent page, using given fluent control.- Parameters:
control- fluent control
-
-
Method Detail
-
getClassAnnotations
public ClassAnnotations getClassAnnotations()
-
getUrl
public java.lang.String getUrl()
Description copied from interface:FluentPageControlURL of the page It can contains mandatory parameters{param}and optional parameters{param1}- Specified by:
getUrlin interfaceFluentPageControl- Returns:
- page URL
-
getUrl
public java.lang.String getUrl(java.lang.Object... parameters)
Description copied from interface:FluentPageControlURL of the page, after replacing parameters with given values.- Specified by:
getUrlin interfaceFluentPageControl- Parameters:
parameters- parameter values- Returns:
- Effective url generated for given parameter values
-
isAt
public void isAt()
Description copied from interface:FluentPageControlCheck if the browser is on this page.- Specified by:
isAtin interfaceFluentPageControl
-
isAt
public void isAt(java.lang.Object... parameters)
Description copied from interface:FluentPageControlCheck if the browser is on this page, after replacing parameters with given values.- Specified by:
isAtin interfaceFluentPageControl- Parameters:
parameters- list of parameters
-
isAtUsingUrl
public void isAtUsingUrl(java.lang.String urlTemplate)
URL matching implementation for isAt().If there is a
PageUrlannotation applied on the class and it has thefileattribute defined this method will skip the url parsing to skip URL check because it is not able to get local file path relatively.- Parameters:
urlTemplate- URL Template- Throws:
java.lang.AssertionError- when the current URL doesn't match the expected page URL
-
isAtUsingSelector
public void isAtUsingSelector(org.openqa.selenium.By by)
Selector matching implementation for isAt().- Parameters:
by- by selector- Throws:
java.lang.AssertionError- if the element using the argument By is not found for the current page
-
go
public <P extends FluentPage> P go()
Description copied from interface:FluentPageControlGo to the url defined in the page- Specified by:
goin interfaceFluentPageControl- Returns:
FluentPage object
-
go
public <P extends FluentPage> P go(java.lang.Object... params)
Description copied from interface:FluentPageControlGot to the url defined in the page, using given parameters.- Specified by:
goin interfaceFluentPageControl- Parameters:
params- page url parameter values- Returns:
FluentPage object
-
parseUrl
public ParsedUrlTemplate parseUrl()
Description copied from interface:FluentPageControlGet the parameter values of page URL extracted from current URL.- Specified by:
parseUrlin interfaceFluentPageControl- Returns:
- parameter values
-
parseUrl
public ParsedUrlTemplate parseUrl(java.lang.String url)
Description copied from interface:FluentPageControlGet the parameter values of page URL extracted from given URL.- Specified by:
parseUrlin interfaceFluentPageControl- Parameters:
url- url to parse- Returns:
- parameter values
-
-