Properties

$apply

$apply : 

A closure function to be executed by WebDriverWait. It should return a truthy value, mostly boolean or a WebDriverElement, on success.

Type

Methods

getApply()

getApply() : \(function():T)

Returns

\(function():T) —

a closure function to be executed by WebDriverWait

titleIs()

titleIs(  $title) : \WebDriverExpectedCondition<bool>

An expectation for checking the title of a page.

Parameters

$title

Returns

\WebDriverExpectedCondition —

True when the title matches,

    false otherwise.

titleContains()

titleContains(  $title) : \WebDriverExpectedCondition<bool>

An expectation for checking substring of a page Title.

Parameters

$title

Returns

\WebDriverExpectedCondition —

True when in title,

    false otherwise.

presenceOfElementLocated()

presenceOfElementLocated(\WebDriverBy  $by) : \WebDriverExpectedCondition<WebDriverElement>

An expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible.

Parameters

\WebDriverBy $by

The locator used to find the element.

Returns

\WebDriverExpectedCondition —

The element which

    is located.

visibilityOfElementLocated()

visibilityOfElementLocated(\WebDriverBy  $by) : \WebDriverExpectedCondition<WebDriverElement>

An expectation for checking that an element is present on the DOM of a page and visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0.

Parameters

\WebDriverBy $by

The locator used to find the element.

Returns

\WebDriverExpectedCondition —

The element which is

    located and visible.

visibilityOf()

visibilityOf(\WebDriverElement  $element) : \WebDriverExpectedCondition<WebDriverElement>

An expectation for checking that an element, known to be present on the DOM of a page, is visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0.

Parameters

\WebDriverElement $element

The element to be checked.

Returns

\WebDriverExpectedCondition —

The same

    WebDriverElement once it is visible.

presenceOfAllElementsLocatedBy()

presenceOfAllElementsLocatedBy(\WebDriverBy  $by) : \WebDriverExpectedCondition<array>

An expectation for checking that there is at least one element present on a web page.

Parameters

\WebDriverBy $by

The locator used to find the element.

Returns

\WebDriverExpectedCondition —

An array of WebDriverElements

    once they are located.

textToBePresentInElement()

textToBePresentInElement(\WebDriverBy  $by, string  $text) : \WebDriverExpectedCondition<bool>

An expectation for checking if the given text is present in the specified element.

Parameters

\WebDriverBy $by

The locator used to find the element.

string $text

The text to be presented in the element.

Returns

\WebDriverExpectedCondition —

Whether the text is presented.

textToBePresentInElementValue()

textToBePresentInElementValue(\WebDriverBy  $by, string  $text) : \WebDriverExpectedCondition<bool>

An expectation for checking if the given text is present in the specified elements value attribute.

Parameters

\WebDriverBy $by

The locator used to find the element.

string $text

The text to be presented in the element value.

Returns

\WebDriverExpectedCondition —

Whether the text is presented.

frameToBeAvailableAndSwitchToIt()

frameToBeAvailableAndSwitchToIt(  $frame_locator) : \WebDriverExpectedCondition<WebDriver>

Expectation for checking if iFrame exists.

If iFrame exists switches driver's focus to the iFrame

Parameters

$frame_locator

Returns

\WebDriverExpectedCondition —

object focused on new frame

    when frame is found bool false otherwise

invisibilityOfElementLocated()

invisibilityOfElementLocated(\WebDriverBy  $by) : \WebDriverExpectedCondition<bool>

An expectation for checking that an element is either invisible or not present on the DOM.

Parameters

\WebDriverBy $by

The locator used to find the element.

Returns

\WebDriverExpectedCondition —

Whether there is no element

    located.

invisibilityOfElementWithText()

invisibilityOfElementWithText(\WebdriverBy  $by, string  $text) : \WebDriverExpectedCondition<bool>

An expectation for checking that an element with text is either invisible or not present on the DOM.

Parameters

\WebdriverBy $by

The locator used to find the element.

string $text

The text of the element.

Returns

\WebDriverExpectedCondition —

Whether the text is found in the

    element located.

elementToBeClickable()

elementToBeClickable(\WebDriverBy  $by) : \WebDriverExpectedCondition<WebDriverElement>

An expectation for checking an element is visible and enabled such that you can click it.

Parameters

\WebDriverBy $by

The locator used to find the element

Returns

\WebDriverExpectedCondition —

The WebDriverElement

    once it is located, visible and clickable

stalenessOf()

stalenessOf(\WebDriverElement  $element) : \WebDriverExpectedCondition<bool>

Wait until an element is no longer attached to the DOM.

Parameters

\WebDriverElement $element

The element to wait for.

Returns

\WebDriverExpectedCondition —

false if the element is still

    attached to the DOM, true otherwise.

refreshed()

refreshed(\WebDriverExpectedCondition  $condition) : \WebDriverExpectedCondition<mixed>

Wrapper for a condition, which allows for elements to update by redrawing.

This works around the problem of conditions which have two parts: find an element and then check for some condition on it. For these conditions it is possible that an element is located and then subsequently it is redrawn on the client. When this happens a StaleElementReferenceException is thrown when the second part of the condition is checked.

Parameters

\WebDriverExpectedCondition $condition

The condition wrapped.

Returns

\WebDriverExpectedCondition —

The return value of the

    getApply() of the given condition.

elementToBeSelected()

elementToBeSelected(  $element_or_by) : \WebDriverExpectedCondition<bool>

An expectation for checking if the given element is selected.

Parameters

$element_or_by

Returns

\WebDriverExpectedCondition —

whether the element is selected.

elementSelectionStateToBe()

elementSelectionStateToBe(mixed  $element_or_by, boolean  $selected) : \WebDriverExpectedCondition<bool>

An expectation for checking if the given element is selected.

Parameters

mixed $element_or_by

Either the element or the locator.

boolean $selected

The required state.

Returns

\WebDriverExpectedCondition —

Whether the element is selected.

alertIsPresent()

alertIsPresent() : \WebDriverExpectedCondition<?WebDriverAlert>

An expectation for whether an alert() box is present.

Returns

\WebDriverExpectedCondition —

if alert() is present,

    null otherwise.

not()

not(\WebDriverExpectedCondition  $condition) : mixed

An expectation with the logical opposite condition of the given condition.

Parameters

\WebDriverExpectedCondition $condition

The condition to be negated.

Returns

mixed —

The nagation of the result of the given condition.

__construct()

__construct(  $apply) 

Parameters

$apply