Package org.fluentlenium.core.wait
Class FluentWaitElementList
- java.lang.Object
-
- org.fluentlenium.core.wait.FluentWaitElementList
-
- All Implemented Interfaces:
FluentWaitConditions<FluentWaitElementList>,FluentWaitConfiguration<FluentWaitElementList>,FluentWaitFunctional<FluentControl>,org.openqa.selenium.support.ui.Wait<FluentControl>
public class FluentWaitElementList extends java.lang.Object implements FluentWaitFunctional<FluentControl>, FluentWaitConditions<FluentWaitElementList>, FluentWaitConfiguration<FluentWaitElementList>
A wait object wrapping default seleniumFluentWaitobject into a more complete API, allowing to wait for any condition to be verified on underlying elements.
-
-
Constructor Summary
Constructors Constructor Description FluentWaitElementList(FluentWait controlWait, java.util.List<? extends FluentWebElement> elements)Creates a new fluent wait for a given elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FluentWaitElementListatMost(java.time.Duration duration)Configure timeout for this wait object.FluentWaitElementListexplicitlyFor(long amount, java.util.concurrent.TimeUnit timeUnit)Waits unconditionally for an explicit amount of time.org.openqa.selenium.support.ui.FluentWaitgetWait()Get the underlying selenium wait objectbooleanhasMessageDefined()Check if a message is defined.FluentWaitElementListignoreAll(java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> types)Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.FluentWaitElementListignoring(java.lang.Class<? extends java.lang.RuntimeException> exceptionType)Add given exception to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.FluentWaitElementListignoring(java.lang.Class<? extends java.lang.RuntimeException> firstType, java.lang.Class<? extends java.lang.RuntimeException> secondType)Add given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.FluentWaitElementListpollingEvery(java.time.Duration duration)Configure polling time for this wait object.FluentConditionsuntil()Get a conditions object used to wait for condition on current elements.<T> Tuntil(java.util.function.Function<? super FluentControl,T> function)Deprecated.voiduntil(java.util.function.Supplier<java.lang.Boolean> supplier)Wait until the supplier returns true.FluentListConditionsuntil(java.util.List<? extends FluentWebElement> elements)Get a conditions object used to wait for a condition on given elements.FluentConditionsuntil(FluentWebElement element)Get a conditions object used to wait for condition on given element.FluentConditionsuntilEach()Get a conditions object used to wait for condition on current elements.FluentListConditionsuntilEach(java.util.List<? extends FluentWebElement> elements)Get a conditions object used to wait for a condition on given elements.FluentListConditionsuntilEachElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> selector)Get a conditions object used to wait for a condition on given elements.FluentConditionsuntilElement(java.util.function.Supplier<? extends FluentWebElement> selector)Get a conditions object used to wait for a condition on given element.FluentListConditionsuntilElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> selector)Get a conditions object used to wait for a condition on given elements.FluentWaitPageConditionsuntilPage()Get a condition object used to wait for a page condition.FluentWaitPageConditionsuntilPage(FluentPage page)Get a condition object used to wait for a page condition.voiduntilPredicate(java.util.function.Predicate<FluentControl> predicate)Wait until the predicate returns true.FluentWaitWindowConditionsuntilWindow(java.lang.String windowName)Get a condition object used to wait for a window condition.FluentWaitElementListwithMessage(java.util.function.Supplier<java.lang.String> message)Configures a custom message supplier to be used if the condition fails during the timeout duration.FluentWaitElementListwithNoDefaultsException()Removes default exceptions from exceptions ignore list.-
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.wait.FluentWaitConditions
explicitlyFor
-
Methods inherited from interface org.fluentlenium.core.wait.FluentWaitConfiguration
atMost, atMost, pollingEvery, pollingEvery, withMessage
-
-
-
-
Constructor Detail
-
FluentWaitElementList
public FluentWaitElementList(FluentWait controlWait, java.util.List<? extends FluentWebElement> elements)
Creates a new fluent wait for a given elements.- Parameters:
controlWait- underlying wait from control interfaceelements- underlying elements
-
-
Method Detail
-
until
public FluentConditions until()
Get a conditions object used to wait for condition on current elements.At least one element must verify the condition to be verified.
- Returns:
- conditions object
-
untilEach
public FluentConditions untilEach()
Get a conditions object used to wait for condition on current elements.Each element must verify the condition to be verified.
- Returns:
- conditions object
-
getWait
public org.openqa.selenium.support.ui.FluentWait getWait()
Description copied from interface:FluentWaitConfigurationGet the underlying selenium wait object- Specified by:
getWaitin interfaceFluentWaitConfiguration<FluentWaitElementList>- Returns:
- selenium wait
-
atMost
public FluentWaitElementList atMost(java.time.Duration duration)
Description copied from interface:FluentWaitConfigurationConfigure timeout for this wait object.- Specified by:
atMostin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
duration- duration- Returns:
thisobject to chain method calls
-
pollingEvery
public FluentWaitElementList pollingEvery(java.time.Duration duration)
Description copied from interface:FluentWaitConfigurationConfigure polling time for this wait object.- Specified by:
pollingEveryin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
duration- duration between each condition invocation- Returns:
thisobject to chain method calls
-
ignoreAll
public FluentWaitElementList ignoreAll(java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> types)
Description copied from interface:FluentWaitConfigurationAdd given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoreAllin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
types- collection of exception type to ignore- Returns:
thisobject to chain method calls
-
ignoring
public FluentWaitElementList ignoring(java.lang.Class<? extends java.lang.RuntimeException> exceptionType)
Description copied from interface:FluentWaitConfigurationAdd given exception to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoringin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
exceptionType- exception type to ignore- Returns:
thisobject to chain method calls
-
ignoring
public FluentWaitElementList ignoring(java.lang.Class<? extends java.lang.RuntimeException> firstType, java.lang.Class<? extends java.lang.RuntimeException> secondType)
Description copied from interface:FluentWaitConfigurationAdd given exceptions to ignore list to avoid breaking the wait when they occurs in the underlying condition evaluation.- Specified by:
ignoringin interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
firstType- exception type to ignoresecondType- exception type to ignore- Returns:
thisobject to chain method calls
-
untilPredicate
public void untilPredicate(java.util.function.Predicate<FluentControl> predicate)
Description copied from interface:FluentWaitFunctionalWait until the predicate returns true.- Specified by:
untilPredicatein interfaceFluentWaitFunctional<FluentControl>- Parameters:
predicate- predicate condition to wait for
-
until
public void until(java.util.function.Supplier<java.lang.Boolean> supplier)
Description copied from interface:FluentWaitFunctionalWait until the supplier returns true.- Specified by:
untilin interfaceFluentWaitFunctional<FluentControl>- Parameters:
supplier- supplier condition to wait for.
-
withMessage
public FluentWaitElementList withMessage(java.util.function.Supplier<java.lang.String> message)
Description copied from interface:FluentWaitConfigurationConfigures a custom message supplier to be used if the condition fails during the timeout duration.- Specified by:
withMessagein interfaceFluentWaitConfiguration<FluentWaitElementList>- Parameters:
message- failing message- Returns:
thisobject to chain method calls
-
hasMessageDefined
public boolean hasMessageDefined()
Description copied from interface:FluentWaitConfigurationCheck if a message is defined.- Specified by:
hasMessageDefinedin interfaceFluentWaitConfiguration<FluentWaitElementList>- Returns:
- true if this fluent wait use a custom message, false otherwise
-
withNoDefaultsException
public FluentWaitElementList withNoDefaultsException()
Description copied from interface:FluentWaitConfigurationRemoves default exceptions from exceptions ignore list.- Specified by:
withNoDefaultsExceptionin interfaceFluentWaitConfiguration<FluentWaitElementList>- Returns:
thisobject to chain method calls
-
until
public FluentConditions until(FluentWebElement element)
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for condition on given element.- Specified by:
untilin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
element- element to wait for- Returns:
- conditions object
-
until
public FluentListConditions until(java.util.List<? extends FluentWebElement> elements)
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.At least one element must verify the condition to be verified.
- Specified by:
untilin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
elements- elements to wait for- Returns:
- conditions object
-
untilEach
public FluentListConditions untilEach(java.util.List<? extends FluentWebElement> elements)
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.Each element must verify the condition to be verified.
- Specified by:
untilEachin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
elements- elements to wait for- Returns:
- conditions object
-
untilElement
public FluentConditions untilElement(java.util.function.Supplier<? extends FluentWebElement> selector)
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given element.- Specified by:
untilElementin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
selector- element to wait for- Returns:
- conditions object
-
untilElements
public FluentListConditions untilElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> selector)
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.At least one element must verify the condition to be verified.
- Specified by:
untilElementsin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
selector- elements to wait for- Returns:
- conditions object
-
untilEachElements
public FluentListConditions untilEachElements(java.util.function.Supplier<? extends java.util.List<? extends FluentWebElement>> selector)
Description copied from interface:FluentWaitConditionsGet a conditions object used to wait for a condition on given elements.Each element must verify the condition to be verified.
- Specified by:
untilEachElementsin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
selector- elements to wait for- Returns:
- conditions object
-
untilWindow
public FluentWaitWindowConditions untilWindow(java.lang.String windowName)
Description copied from interface:FluentWaitConditionsGet a condition object used to wait for a window condition.- Specified by:
untilWindowin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
windowName- name of the window to wait for- Returns:
- window conditions object
-
untilPage
public FluentWaitPageConditions untilPage()
Description copied from interface:FluentWaitConditionsGet a condition object used to wait for a page condition.- Specified by:
untilPagein interfaceFluentWaitConditions<FluentWaitElementList>- Returns:
- page conditions object
-
untilPage
public FluentWaitPageConditions untilPage(FluentPage page)
Description copied from interface:FluentWaitConditionsGet a condition object used to wait for a page condition.- Specified by:
untilPagein interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
page- page to wait for- Returns:
- page conditions object
-
explicitlyFor
public FluentWaitElementList explicitlyFor(long amount, java.util.concurrent.TimeUnit timeUnit)
Description copied from interface:FluentWaitConditionsWaits unconditionally for an explicit amount of time.The method should be used only as a last resort.
In most cases you should wait for some condition, e.g. visibility of particular element on the page.
- Specified by:
explicitlyForin interfaceFluentWaitConditions<FluentWaitElementList>- Parameters:
amount- amount of timetimeUnit- unit of time- Returns:
thisobject to chain method calls
-
until
@Deprecated public <T> T until(java.util.function.Function<? super FluentControl,T> function)
Deprecated.Wait until function returns true- Specified by:
untilin interfaceFluentWaitFunctional<FluentControl>- Specified by:
untilin interfaceorg.openqa.selenium.support.ui.Wait<FluentControl>- Type Parameters:
T- FluentWaitElementList- Parameters:
function- function to be performed- Returns:
- FluentWaitElementList
-
-