You are here

interface ElementInterface in Zircon Profile 8

Same name in this branch
  1. 8 vendor/behat/mink/src/Element/ElementInterface.php \Behat\Mink\Element\ElementInterface
  2. 8 core/modules/config_translation/src/FormElement/ElementInterface.php \Drupal\config_translation\FormElement\ElementInterface
  3. 8 core/lib/Drupal/Core/Render/Element/ElementInterface.php \Drupal\Core\Render\Element\ElementInterface
Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/Element/ElementInterface.php \Behat\Mink\Element\ElementInterface

Element interface.

@author Konstantin Kudryashov <ever.zet@gmail.com>

Hierarchy

Expanded class hierarchy of ElementInterface

All classes that implement ElementInterface

1 file declares its use of ElementInterface
WebAssert.php in vendor/behat/mink/src/WebAssert.php

File

vendor/behat/mink/src/Element/ElementInterface.php, line 20

Namespace

Behat\Mink\Element
View source
interface ElementInterface {

  /**
   * Returns XPath for handled element.
   *
   * @return string
   */
  public function getXpath();

  /**
   * Returns element's session.
   *
   * @return Session
   *
   * @deprecated Accessing the session from the element is deprecated as of 1.6 and will be impossible in 2.0.
   */
  public function getSession();

  /**
   * Checks whether element with specified selector exists inside the current element.
   *
   * @param string       $selector selector engine name
   * @param string|array $locator  selector locator
   *
   * @return Boolean
   *
   * @see ElementInterface::findAll for the supported selectors
   */
  public function has($selector, $locator);

  /**
   * Checks if an element still exists in the DOM.
   *
   * @return bool
   */
  public function isValid();

  /**
   * Waits for an element(-s) to appear and returns it.
   *
   * @param int|float $timeout  Maximal allowed waiting time in seconds.
   * @param callable  $callback Callback, which result is both used as waiting condition and returned.
   *                            Will receive reference to `this element` as first argument.
   *
   * @return mixed
   *
   * @throws \InvalidArgumentException When invalid callback given.
   */
  public function waitFor($timeout, $callback);

  /**
   * Finds first element with specified selector inside the current element.
   *
   * @param string       $selector selector engine name
   * @param string|array $locator  selector locator
   *
   * @return NodeElement|null
   *
   * @see ElementInterface::findAll for the supported selectors
   */
  public function find($selector, $locator);

  /**
   * Finds all elements with specified selector inside the current element.
   *
   * Valid selector engines are named, xpath, css, named_partial and named_exact.
   *
   * 'named' is a pseudo selector engine which prefers an exact match but
   * will return a partial match if no exact match is found.
   * 'xpath' is a pseudo selector engine supported by SelectorsHandler.
   *
   * More selector engines can be registered in the SelectorsHandler.
   *
   * @param string       $selector selector engine name
   * @param string|array $locator  selector locator
   *
   * @return NodeElement[]
   *
   * @see NamedSelector for the locators supported by the named selectors
   */
  public function findAll($selector, $locator);

  /**
   * Returns element text (inside tag).
   *
   * @return string
   */
  public function getText();

  /**
   * Returns element inner html.
   *
   * @return string
   */
  public function getHtml();

}

Members

Namesort descending Modifiers Type Description Overrides
ElementInterface::find public function Finds first element with specified selector inside the current element. 1
ElementInterface::findAll public function Finds all elements with specified selector inside the current element. 1
ElementInterface::getHtml public function Returns element inner html. 1
ElementInterface::getSession Deprecated public function Returns element's session. 1
ElementInterface::getText public function Returns element text (inside tag). 1
ElementInterface::getXpath public function Returns XPath for handled element. 2
ElementInterface::has public function Checks whether element with specified selector exists inside the current element. 1
ElementInterface::isValid public function Checks if an element still exists in the DOM. 1
ElementInterface::waitFor public function Waits for an element(-s) to appear and returns it. 1