Lines Matching refs:element

128      * An expectation for checking that an element is present on the DOM of a page.
129 * This does not necessarily mean that the element is visible.
131 * @param WebDriverBy $by The locator used to find the element.
148 * An expectation for checking that there is at least one element present on a web page.
150 * @param WebDriverBy $by The locator used to find the element.
165 * An expectation for checking that an element is present on the DOM of a page and visible.
166 * Visibility means that the element is not only displayed but also has a height and width that is greater than 0.
168 * @param WebDriverBy $by The locator used to find the element.
176 $element = $driver->findElement($by);
178 return $element->isDisplayed() ? $element : null;
187 * An expectation for checking than at least one element in an array of elements is present on the
189 * Visibility means that the element is not only displayed but also has a height and width that is greater than 0.
191 * @param WebDriverBy $by The located used to find the element.
201 foreach ($elements as $element) {
203 if ($element->isDisplayed()) {
204 $visibleElements[] = $element;
216 * An expectation for checking that an element, known to be present on the DOM of a page, is visible.
217 * Visibility means that the element is not only displayed but also has a height and width that is greater than 0.
219 * @param WebDriverElement $element The element to be checked.
222 public static function visibilityOf(WebDriverElement $element)
225 function () use ($element) {
226 return $element->isDisplayed() ? $element : null;
232 * An expectation for checking if the given text is present in the specified element.
237 * @param WebDriverBy $by The locator used to find the element.
238 * @param string $text The text to be presented in the element.
239 * @return static Condition returns whether the text is present in the element.
247 * An expectation for checking if the given text is present in the specified element.
250 * @param WebDriverBy $by The locator used to find the element.
251 * @param string $text The text to be presented in the element.
252 * @return static Condition returns whether the partial text is present in the element.
270 * An expectation for checking if the given text exactly equals the text in specified element.
273 * @param WebDriverBy $by The locator used to find the element.
274 * @param string $text The expected text of the element.
275 * @return static Condition returns whether the element has text value equal to given one.
291 * An expectation for checking if the given regular expression matches the text in specified element.
293 * @param WebDriverBy $by The locator used to find the element.
295 * @return static Condition returns whether the element has text value equal to given one.
315 * @param WebDriverBy $by The locator used to find the element.
316 * @param string $text The text to be presented in the element value.
327 * @param WebDriverBy $by The locator used to find the element.
328 * @param string $text The text to be presented in the element value.
367 * An expectation for checking that an element is either invisible or not present on the DOM.
369 * @param WebDriverBy $by The locator used to find the element.
370 * @return static Condition returns whether no visible element located.
388 * An expectation for checking that an element with text is either invisible or not present on the DOM.
390 * @param WebDriverBy $by The locator used to find the element.
391 * @param string $text The text of the element.
392 * @return static Condition returns whether the text is found in the element located.
410 * An expectation for checking an element is visible and enabled such that you can click it.
412 * @param WebDriverBy $by The locator used to find the element
421 $element = call_user_func(
427 if ($element !== null && $element->isEnabled()) {
428 return $element;
440 * Wait until an element is no longer attached to the DOM.
442 * @param WebDriverElement $element The element to wait for.
443 * @return static Condition returns whether the element is still attached to the DOM.
445 public static function stalenessOf(WebDriverElement $element)
448 function () use ($element) {
450 $element->isEnabled();
463 * This works around the problem of conditions which have two parts: find an element and then check for some
464 * condition on it. For these conditions it is possible that an element is located and then subsequently it is
485 * An expectation for checking if the given element is selected.
487 * @param mixed $element_or_by Either the element or the locator.
488 * @return static Condition returns whether the element is selected.
499 * An expectation for checking if the given element is selected.
501 * @param mixed $element_or_by Either the element or the locator.
503 * @return static Condition returns whether the element is selected.
519 $element = $driver->findElement($element_or_by);
521 return $element->isSelected() === $selected;