Skip to content

Commit

Permalink
remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Apr 20, 2022
1 parent f43e001 commit 266bd96
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,8 @@ protected function createMinkElementFromWebDriverElement(Element $element)
if (count($minkElements) > 1) {
throw new DriverException(sprintf('XPath "%s" built from WebDriver element find more than one element', $xpath));
}
$minkElement = reset($minkElements);

// DEBUG only
if ($this->findElement($minkElement->getXpath())->getID() !== $element->getId()) {
throw new \Error(sprintf('XPath "%s" built from WebDriver element cannot find the same element', $xpath));
}

return $minkElement;
return reset($minkElements);
}

/**
Expand Down Expand Up @@ -627,22 +621,6 @@ public function findElementXpaths($xpath)
$elements[] = sprintf('(%s)[%d]', $xpath, $i+1);
}

// DEBUG only
$recursiveCount = 0;
foreach (debug_backtrace() as $trace) {
if (($trace['function'] ?? null) === __FUNCTION__) {
$recursive = $recursiveCount++;
}
}
if ($recursiveCount <= 4) {
foreach ($nodes as $element) {
$minkElement = $this->createMinkElementFromWebDriverElement($element);
if ($this->findElement($minkElement->getXpath())->getID() !== $element->getId()) {
throw new \Error(sprintf('XPath "%s" built from WebDriver element cannot find the same element (in find)', $xpath));
}
}
}

return $elements;
}

Expand Down

0 comments on commit 266bd96

Please sign in to comment.