public function FeatureContext::clickAdminLink in Open Social 8.4
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 8.3 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 8.5 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 8.6 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 8.7 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 8.8 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 10.3.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
- 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickAdminLink()
@When I click admin link :text
File
- tests/
behat/ features/ bootstrap/ FeatureContext.php, line 189
Class
- FeatureContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function clickAdminLink($text) {
$page = $this
->getSession()
->getPage();
$adminspan = $page
->find('xpath', '//a//span[text()="' . $text . '"]');
if ($adminspan === null) {
throw new \InvalidArgumentException(sprintf('Cannot find the admin link with text: "%s"', $text));
}
$adminlink = $adminspan
->getParent();
$adminlink
->click();
}