WebDriverExpectedCondition
class WebDriverExpectedCondition (View source)
Canned ExpectedConditions which are generally useful within webdriver tests.
Methods
No description
No description
An expectation for checking the title of a page.
An expectation for checking substring of a page Title.
An expectation for checking current page title matches the given regular expression.
An expectation for checking the URL of a page.
An expectation for checking substring of the URL of a page.
An expectation for checking current page URL matches the given regular expression.
An expectation for checking that an element is present on the DOM of a page.
An expectation for checking that there is at least one element present on a web page.
An expectation for checking that an element is present on the DOM of a page and visible.
An expectation for checking than at least one element in an array of elements is present on the DOM of a page and visible.
An expectation for checking that an element, known to be present on the DOM of a page, is visible.
An expectation for checking if the given text is present in the specified element.
An expectation for checking if the given text is present in the specified element.
An expectation for checking if the given text exactly equals the text in specified element.
An expectation for checking if the given regular expression matches the text in specified element.
An expectation for checking if the given text is present in the specified elements value attribute.
An expectation for checking if the given text is present in the specified elements value attribute.
Expectation for checking if iFrame exists. If iFrame exists switches driver's focus to the iFrame.
An expectation for checking that an element is either invisible or not present on the DOM.
An expectation for checking that an element with text is either invisible or not present on the DOM.
An expectation for checking an element is visible and enabled such that you can click it.
Wrapper for a condition, which allows for elements to update by redrawing.
An expectation for checking if the given element is selected.
An expectation for checking if the given element is selected.
An expectation for whether an alert() box is present.
An expectation checking the number of opened windows.
An expectation with the logical opposite condition of the given condition.
Details
protected
__construct(callable $apply)
No description
callable
getApply()
No description
static WebDriverExpectedCondition<bool>
titleIs(string $title)
An expectation for checking the title of a page.
static WebDriverExpectedCondition<bool>
titleContains(string $title)
An expectation for checking substring of a page Title.
static WebDriverExpectedCondition<bool>
titleMatches(string $titleRegexp)
An expectation for checking current page title matches the given regular expression.
static WebDriverExpectedCondition<bool>
urlIs(string $url)
An expectation for checking the URL of a page.
static WebDriverExpectedCondition<bool>
urlContains(string $url)
An expectation for checking substring of the URL of a page.
static WebDriverExpectedCondition<bool>
urlMatches(string $urlRegexp)
An expectation for checking current page URL matches the given regular expression.
static WebDriverElement>
presenceOfElementLocated(WebDriverBy $by)
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.
static WebDriverExpectedCondition<array>
presenceOfAllElementsLocatedBy(WebDriverBy $by)
An expectation for checking that there is at least one element present on a web page.
static WebDriverElement>
visibilityOfElementLocated(WebDriverBy $by)
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.
static WebDriverElement>
visibilityOfAnyElementLocated(WebDriverBy $by)
An expectation for checking than at least one element in an array of elements 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.
static WebDriverElement>
visibilityOf(WebDriverElement $element)
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.
static WebDriverExpectedCondition<bool>
textToBePresentInElement(WebDriverBy $by, string $text)
deprecated
deprecated
An expectation for checking if the given text is present in the specified element.
To check exact text match use elementTextIs() condition.
static WebDriverExpectedCondition<bool>
elementTextContains(WebDriverBy $by, string $text)
An expectation for checking if the given text is present in the specified element.
To check exact text match use elementTextIs() condition.
static WebDriverExpectedCondition<bool>
elementTextIs(WebDriverBy $by, string $text)
An expectation for checking if the given text exactly equals the text in specified element.
To check only partial substring of the text use elementTextContains() condition.
static WebDriverExpectedCondition<bool>
elementTextMatches(WebDriverBy $by, string $regexp)
An expectation for checking if the given regular expression matches the text in specified element.
static WebDriverExpectedCondition<bool>
textToBePresentInElementValue(WebDriverBy $by, string $text)
deprecated
deprecated
An expectation for checking if the given text is present in the specified elements value attribute.
static WebDriverExpectedCondition<bool>
elementValueContains(WebDriverBy $by, string $text)
An expectation for checking if the given text is present in the specified elements value attribute.
static WebDriver|bool>
frameToBeAvailableAndSwitchToIt(string $frame_locator)
Expectation for checking if iFrame exists. If iFrame exists switches driver's focus to the iFrame.
static WebDriverExpectedCondition<bool>
invisibilityOfElementLocated(WebDriverBy $by)
An expectation for checking that an element is either invisible or not present on the DOM.
static WebDriverExpectedCondition<bool>
invisibilityOfElementWithText(WebDriverBy $by, string $text)
An expectation for checking that an element with text is either invisible or not present on the DOM.
static WebDriverElement>
elementToBeClickable(WebDriverBy $by)
An expectation for checking an element is visible and enabled such that you can click it.
static WebDriverExpectedCondition<bool>
stalenessOf(WebDriverElement $element)
Wait until an element is no longer attached to the DOM.
static WebDriverExpectedCondition<mixed>
refreshed(WebDriverExpectedCondition $condition)
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.
static WebDriverExpectedCondition<bool>
elementToBeSelected(mixed $element_or_by)
An expectation for checking if the given element is selected.
static WebDriverExpectedCondition<bool>
elementSelectionStateToBe(mixed $element_or_by, bool $selected)
An expectation for checking if the given element is selected.
static WebDriverAlert>
alertIsPresent()
An expectation for whether an alert() box is present.
static WebDriverExpectedCondition
numberOfWindowsToBe(int $expectedNumberOfWindows)
An expectation checking the number of opened windows.
static mixed
not(WebDriverExpectedCondition $condition)
An expectation with the logical opposite condition of the given condition.