From 266bd968ec07f47db244f9a3f357ec6f72c00aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 20 Apr 2022 14:01:57 +0200 Subject: [PATCH] remove debug code --- src/Selenium2Driver.php | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php index af8a5094..87c63c7c 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -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); } /** @@ -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; }