$apply
$apply :
A closure function to be executed by WebDriverWait. It should return a truthy value, mostly boolean or a WebDriverElement, on success.
Canned ExpectedConditions which are generally useful within webdriver tests.
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.
| \WebDriverBy | $by | The locator used to find the element. |
The element which
is located.
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.
| \WebDriverBy | $by | The locator used to find the element. |
The element which is
located and visible.
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.
| \WebDriverElement | $element | The element to be checked. |
The same
WebDriverElement once it is visible.
presenceOfAllElementsLocatedBy(\WebDriverBy $by) : \WebDriverExpectedCondition<array>
An expectation for checking that there is at least one element present on a web page.
| \WebDriverBy | $by | The locator used to find the element. |
An array of WebDriverElements
once they are located.
textToBePresentInElement(\WebDriverBy $by, string $text) : \WebDriverExpectedCondition<bool>
An expectation for checking if the given text is present in the specified element.
| \WebDriverBy | $by | The locator used to find the element. |
| string | $text | The text to be presented in the element. |
Whether the text is presented.
textToBePresentInElementValue(\WebDriverBy $by, string $text) : \WebDriverExpectedCondition<bool>
An expectation for checking if the given text is present in the specified elements value attribute.
| \WebDriverBy | $by | The locator used to find the element. |
| string | $text | The text to be presented in the element value. |
Whether the text is presented.
frameToBeAvailableAndSwitchToIt( $frame_locator) : \WebDriverExpectedCondition<WebDriver>
Expectation for checking if iFrame exists.
If iFrame exists switches driver's focus to the iFrame
| $frame_locator |
object focused on new frame
when frame is found bool false otherwise
invisibilityOfElementLocated(\WebDriverBy $by) : \WebDriverExpectedCondition<bool>
An expectation for checking that an element is either invisible or not present on the DOM.
| \WebDriverBy | $by | The locator used to find the element. |
Whether there is no element
located.
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.
| \WebdriverBy | $by | The locator used to find the element. |
| string | $text | The text of the element. |
Whether the text is found in the
element located.
elementToBeClickable(\WebDriverBy $by) : \WebDriverExpectedCondition<WebDriverElement>
An expectation for checking an element is visible and enabled such that you can click it.
| \WebDriverBy | $by | The locator used to find the element |
The WebDriverElement
once it is located, visible and clickable
stalenessOf(\WebDriverElement $element) : \WebDriverExpectedCondition<bool>
Wait until an element is no longer attached to the DOM.
| \WebDriverElement | $element | The element to wait for. |
false if the element is still
attached to the DOM, true otherwise.
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.
| \WebDriverExpectedCondition | $condition | The condition wrapped. |
The return value of the
getApply() of the given condition.
elementSelectionStateToBe(mixed $element_or_by, boolean $selected) : \WebDriverExpectedCondition<bool>
An expectation for checking if the given element is selected.
| mixed | $element_or_by | Either the element or the locator. |
| boolean | $selected | The required state. |
Whether the element is selected.
not(\WebDriverExpectedCondition $condition) : mixed
An expectation with the logical opposite condition of the given condition.
| \WebDriverExpectedCondition | $condition | The condition to be negated. |
The nagation of the result of the given condition.