function BrowserKitDriver::click
Overrides CoreDriver::click
File
-
vendor/
behat/ mink-browserkit-driver/ src/ BrowserKitDriver.php, line 484
Class
- BrowserKitDriver
- Symfony BrowserKit driver.
Namespace
Behat\Mink\DriverCode
public function click(string $xpath) {
$crawler = $this->getFilteredCrawler($xpath);
$node = $this->getCrawlerNode($crawler);
$tagName = $node->nodeName;
if ('a' === $tagName) {
$this->client
->click($crawler->link());
$this->forms = array();
}
elseif ($this->canSubmitForm($node)) {
$this->submit($crawler->form());
}
elseif ($this->canResetForm($node)) {
$this->resetForm($node);
}
else {
$message = sprintf('%%s supports clicking on links and submit or reset buttons only. But "%s" provided', $tagName);
throw new UnsupportedDriverActionException($message, $this);
}
}