Class WaitUntilConditions
Defines a set of conditions that can be used with the WaitUntil methods of elements and pages.
Inheritance
Namespace: Legerity.Helpers
Assembly: Legerity.Core.dll
Syntax
public static class WaitUntilConditions : object
Methods
| Improve this Doc View SourceElementExists(By)
A condition for validating whether a specified element found by a locator exists within the context of the page.
Note, the element may exist but may not be visible.
Declaration
public static Func<IWebDriver, bool> ElementExists(By locator)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<IWebDriver, System.Boolean> | True if the element exists; otherwise, false. |
ElementExistsInElement<TElement>(By)
A condition for validating whether a specified element found by a locator exists within the context of an element.
Note, the element may exist but may not be visible.
Declaration
public static Func<TElement, bool> ElementExistsInElement<TElement>(By locator)
where TElement : IWebElement
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<TElement, System.Boolean> | True if the element exists; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TElement | The type of |
ElementExistsInElementWrapper<TElement>(By)
A condition for validating whether a specified element found by a locator exists within the context of an element wrapper.
Note, the element may exist but may not be visible.
Declaration
public static Func<IElementWrapper<TElement>, bool> ElementExistsInElementWrapper<TElement>(By locator)
where TElement : IWebElement
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<IElementWrapper<TElement>, System.Boolean> | True if the element exists; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TElement | The type of |
ElementExistsInPage<TPage>(By)
A condition for validating whether a specified element found by a locator exists within the context of a page object.
Note, the element may exist but may not be visible.
Declaration
public static Func<TPage, bool> ElementExistsInPage<TPage>(By locator)
where TPage : BasePage
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<TPage, System.Boolean> | True if the element exists; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TPage | The type of BasePage. |
ElementIsNotVisible(By)
A condition for validating whether a specified element found by a locator is hidden (not visible) within the context of the page.
Declaration
public static Func<IWebDriver, bool> ElementIsNotVisible(By locator)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<IWebDriver, System.Boolean> | True if the element is hidden (not visible); otherwise, false. |
ElementIsNotVisibleInElement<TElement>(By)
A condition for validating whether a specified element found by a locator is hidden (not visible) within the context of an element.
Declaration
public static Func<TElement, bool> ElementIsNotVisibleInElement<TElement>(By locator)
where TElement : IWebElement
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<TElement, System.Boolean> | True if the element is hidden (not visible); otherwise, false. |
Type Parameters
Name | Description |
---|---|
TElement | The type of |
ElementIsNotVisibleInElementWrapper<TElement>(By)
A condition for validating whether a specified element found by a locator is hidden (not visible) within the context of an element wrapper.
Declaration
public static Func<IElementWrapper<TElement>, bool> ElementIsNotVisibleInElementWrapper<TElement>(By locator)
where TElement : IWebElement
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<IElementWrapper<TElement>, System.Boolean> | True if the element is hidden (not visible); otherwise, false. |
Type Parameters
Name | Description |
---|---|
TElement | The type of |
ElementIsNotVisibleInPage<TPage>(By)
A condition for validating whether a specified element found by a locator is hidden (not visible) within the context of a page object.
Declaration
public static Func<TPage, bool> ElementIsNotVisibleInPage<TPage>(By locator)
where TPage : BasePage
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<TPage, System.Boolean> | True if the element is hidden (not visible); otherwise, false. |
Type Parameters
Name | Description |
---|---|
TPage | The type of BasePage. |
ElementIsVisible(By)
A condition for validating whether a specified element found by a locator is visible within the context of the page.
Declaration
public static Func<IWebDriver, bool> ElementIsVisible(By locator)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<IWebDriver, System.Boolean> | True if the element is visible; otherwise, false. |
ElementIsVisibleInElement<TElement>(By)
A condition for validating whether a specified element found by a locator is visible within the context of an element.
Declaration
public static Func<TElement, bool> ElementIsVisibleInElement<TElement>(By locator)
where TElement : IWebElement
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<TElement, System.Boolean> | True if the element is visible; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TElement | The type of |
ElementIsVisibleInElementWrapper<TElement>(By)
A condition for validating whether a specified element found by a locator is visible within the context of an element wrapper.
Declaration
public static Func<IElementWrapper<TElement>, bool> ElementIsVisibleInElementWrapper<TElement>(By locator)
where TElement : IWebElement
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<IElementWrapper<TElement>, System.Boolean> | True if the element is visible; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TElement | The type of |
ElementIsVisibleInPage<TPage>(By)
A condition for validating whether a specified element found by a locator is visible within the context of a page object.
Declaration
public static Func<TPage, bool> ElementIsVisibleInPage<TPage>(By locator)
where TPage : BasePage
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find the element. |
Returns
Type | Description |
---|---|
Func<TPage, System.Boolean> | True if the element is visible; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TPage | The type of BasePage. |
FrameAvailableToSwitchTo(By)
A condition for switching to a frame by its name when it is available.
Declaration
public static Func<IWebDriver, IWebDriver> FrameAvailableToSwitchTo(By frameLocator)
Parameters
Type | Name | Description |
---|---|---|
By | frameLocator | The locator of the frame to switch to. |
Returns
Type | Description |
---|---|
Func<IWebDriver, IWebDriver> | The |
FrameAvailableToSwitchTo(String)
A condition for switching to a frame by its name when it is available.
Declaration
public static Func<IWebDriver, IWebDriver> FrameAvailableToSwitchTo(string frameName)
Parameters
Type | Name | Description |
---|---|---|
System.String | frameName | The name of the frame to switch to. |
Returns
Type | Description |
---|---|
Func<IWebDriver, IWebDriver> | The |
TitleContains(String)
A condition for validating whether the title of the current Window contains a case-sensitive substring.
Declaration
public static Func<IWebDriver, bool> TitleContains(string title)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | The fragment of title expected. |
Returns
Type | Description |
---|---|
Func<IWebDriver, System.Boolean> | True if the title contains the text; otherwise, false. |
TitleIs(String, StringComparison)
A condition for validating whether the title of the current Window matches the specified title.
Declaration
public static Func<IWebDriver, bool> TitleIs(string title, StringComparison comparison = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | The expected title, which must be an exact match. |
StringComparison | comparison | The comparison for validating equality. |
Returns
Type | Description |
---|---|
Func<IWebDriver, System.Boolean> | True if the title matches; otherwise, false. |
UrlContains(String)
A condition for validating whether the URL of the current Window contains a case-sensitive substring.
Declaration
public static Func<IWebDriver, bool> UrlContains(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The fragment of URL expected. |
Returns
Type | Description |
---|---|
Func<IWebDriver, System.Boolean> | True if the URL contains the text; otherwise, false. |
UrlIs(String, StringComparison)
A condition for validating whether the URL of the current Window matches the specified URL.
Declaration
public static Func<IWebDriver, bool> UrlIs(string url, StringComparison comparison = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL that the page should be on. |
StringComparison | comparison | The comparison for validating equality. |
Returns
Type | Description |
---|---|
Func<IWebDriver, System.Boolean> | True if the URL matches; otherwise, false. |