public function PermissionsByTermDrupalSubContext::seeMenuItemMatchingText in Permissions by Term 8.2
@Then /^I should see menu item text matching "([^"]*)"$/
File
- tests/
src/ Behat/ Context/ permissions_by_term.behat.inc, line 359
Class
- PermissionsByTermDrupalSubContext
- Class PermissionsByTermContext
Namespace
Drupal\Tests\permissions_by_term\Behat\PermissionsByTermDrupalSubContextCode
public function seeMenuItemMatchingText(string $text) : void {
$xpath = '//*/ul/li/a[text() = "' . $text . '"]';
$session = $this
->getSession();
// get the mink session
$element = $session
->getPage()
->find('xpath', $session
->getSelectorsHandler()
->selectorToXpath('xpath', $xpath));
if ($element === NULL) {
throw new \InvalidArgumentException(sprintf('Could not evaluate XPath: "%s"', $xpath));
}
}