function WebAssert::elementNotExists
Checks that specific element does not exist on the current page.
Parameters
string $selectorType element selector type (css, xpath):
string|array $selector element selector:
ElementInterface|null $container document to check against:
Return value
void
Throws
File
-
vendor/
behat/ mink/ src/ WebAssert.php, line 482
Class
- WebAssert
- Mink web assertions tool.
Namespace
Behat\MinkCode
public function elementNotExists(string $selectorType, $selector, ?ElementInterface $container = null) {
$container = $container ?: $this->session
->getPage();
$node = $container->find($selectorType, $selector);
$message = sprintf('An %s appears on this page, but it should not.', $this->getMatchingElementRepresentation($selectorType, $selector));
$this->assert(null === $node, $message);
}