From c674ab8791ceba53cd51157ea02fa179002f1498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 7 Sep 2017 08:35:06 +0200 Subject: [PATCH] Try getting element directly in waitForElement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This can avoid 3 round trips to Selenium server in most situations, so it can help performance. Signed-off-by: Michal Čihař --- test/selenium/TestBase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index 9fc32d261e..b88deeb7d9 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -390,6 +390,13 @@ abstract class PMA_SeleniumBase extends PHPUnit_Extensions_Selenium2TestCase */ public function waitForElement($func, $arg) { + try { + return call_user_func_array( + array($this, $func), array($arg) + ); + } catch(Exception $e) { + // Element not present, fall back to waiting + } $this->timeouts()->implicitWait(10000); $element = call_user_func_array( array($this, $func), array($arg)