public function WebAssert::elementExists in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/behat/mink/src/WebAssert.php \Behat\Mink\WebAssert::elementExists()
Checks that specific element exists on the current page.
Parameters
string $selectorType element selector type (css, xpath):
string|array $selector element selector:
ElementInterface $container document to check against:
Return value
Throws
5 calls to WebAssert::elementExists()
- WebAssert::elementAttributeExists in vendor/
behat/ mink/ src/ WebAssert.php - Checks that an attribute exists in an element.
- WebAssert::elementContains in vendor/
behat/ mink/ src/ WebAssert.php - Checks that specific element contains HTML.
- WebAssert::elementNotContains in vendor/
behat/ mink/ src/ WebAssert.php - Checks that specific element does not contains HTML.
- WebAssert::elementTextContains in vendor/
behat/ mink/ src/ WebAssert.php - Checks that specific element contains text.
- WebAssert::elementTextNotContains in vendor/
behat/ mink/ src/ WebAssert.php - Checks that specific element does not contains text.
File
- vendor/
behat/ mink/ src/ WebAssert.php, line 410
Class
- WebAssert
- Mink web assertions tool.
Namespace
Behat\MinkCode
public function elementExists($selectorType, $selector, ElementInterface $container = null) {
$container = $container ?: $this->session
->getPage();
$node = $container
->find($selectorType, $selector);
if (null === $node) {
if (is_array($selector)) {
$selector = implode(' ', $selector);
}
throw new ElementNotFoundException($this->session
->getDriver(), 'element', $selectorType, $selector);
}
return $node;
}