Skip to content

Commit

Permalink
Merge pull request #235 from pfrenssen/output-missing-link-in-exception
Browse files Browse the repository at this point in the history
Missing link text in the exception thrown in DrupalContext::assertClickInTableRow()

Signed-off-by: Jonathan Hedstrom <jhedstrom@gmail.com>
  • Loading branch information
jhedstrom committed Dec 21, 2015
1 parent a553151 commit f375824
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Drupal/DrupalExtension/Context/DrupalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ public function assertTextInTableRow($text, $rowText) {
*/
public function assertClickInTableRow($link, $rowText) {
$page = $this->getSession()->getPage();
if ($link = $this->getTableRow($page, $rowText)->findLink($link)) {
if ($link_element = $this->getTableRow($page, $rowText)->findLink($link)) {
// Click the link and return.
$link->click();
$link_element->click();
return;
}
throw new \Exception(sprintf('Found a row containing "%s", but no "%s" link on the page %s', $rowText, $link, $this->getSession()->getCurrentUrl()));
Expand Down

0 comments on commit f375824

Please sign in to comment.