Skip to content

Commit 266bd96

Browse files
committed
remove debug code
1 parent f43e001 commit 266bd96

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/Selenium2Driver.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,8 @@ protected function createMinkElementFromWebDriverElement(Element $element)
300300
if (count($minkElements) > 1) {
301301
throw new DriverException(sprintf('XPath "%s" built from WebDriver element find more than one element', $xpath));
302302
}
303-
$minkElement = reset($minkElements);
304303

305-
// DEBUG only
306-
if ($this->findElement($minkElement->getXpath())->getID() !== $element->getId()) {
307-
throw new \Error(sprintf('XPath "%s" built from WebDriver element cannot find the same element', $xpath));
308-
}
309-
310-
return $minkElement;
304+
return reset($minkElements);
311305
}
312306

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

630-
// DEBUG only
631-
$recursiveCount = 0;
632-
foreach (debug_backtrace() as $trace) {
633-
if (($trace['function'] ?? null) === __FUNCTION__) {
634-
$recursive = $recursiveCount++;
635-
}
636-
}
637-
if ($recursiveCount <= 4) {
638-
foreach ($nodes as $element) {
639-
$minkElement = $this->createMinkElementFromWebDriverElement($element);
640-
if ($this->findElement($minkElement->getXpath())->getID() !== $element->getId()) {
641-
throw new \Error(sprintf('XPath "%s" built from WebDriver element cannot find the same element (in find)', $xpath));
642-
}
643-
}
644-
}
645-
646624
return $elements;
647625
}
648626

0 commit comments

Comments
 (0)