From fa6e8fdeaef63a188e852498d29409a5d99ff0bf Mon Sep 17 00:00:00 2001 From: Richard Cocks Date: Mon, 3 Feb 2014 12:31:02 +0000 Subject: [PATCH 1/2] Added custom WebDriverWait timeout message Added fourth parameter $message to PHPWebDriver_WaitDriverWait to make debugging easier --- PHPWebDriver/WebDriverWait.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PHPWebDriver/WebDriverWait.php b/PHPWebDriver/WebDriverWait.php index 7350aab8e..7b92ce7ce 100644 --- a/PHPWebDriver/WebDriverWait.php +++ b/PHPWebDriver/WebDriverWait.php @@ -16,7 +16,7 @@ include_once('WebDriverExceptions.php'); class PHPWebDriver_WebDriverWait { - public function __construct($session, $timeout = 30, $poll_frequency = 0.5, $extra_arguments = array()) { + public function __construct($session, $timeout = 30, $poll_frequency = 0.5, $message='Element wait timed out after %s',$extra_arguments = array()) { $this->session = $session; $this->timeout = $timeout; $this->poll = $poll_frequency; @@ -39,9 +39,9 @@ public function until($func) { } throw new PHPWebDriver_TimeOutWebDriverError( sprintf( - 'Element wait timed out after %s', + $this->message, $this->timeout) . "\n\n"); } } -?> \ No newline at end of file +?> From 9f78da7d5ad415920847d8392869267a913f3f4c Mon Sep 17 00:00:00 2001 From: Richard Cocks Date: Mon, 3 Feb 2014 12:35:11 +0000 Subject: [PATCH 2/2] Added $message in constructor --- PHPWebDriver/WebDriverWait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/PHPWebDriver/WebDriverWait.php b/PHPWebDriver/WebDriverWait.php index 7b92ce7ce..0f6d1e87c 100644 --- a/PHPWebDriver/WebDriverWait.php +++ b/PHPWebDriver/WebDriverWait.php @@ -20,6 +20,7 @@ public function __construct($session, $timeout = 30, $poll_frequency = 0.5, $mes $this->session = $session; $this->timeout = $timeout; $this->poll = $poll_frequency; + $this->message = $message; $this->extra_arguments = $extra_arguments; return $this; }