From 99bda1aa732288f74126c9a77c48dd7cff63531a Mon Sep 17 00:00:00 2001 From: Julie Date: Thu, 20 Mar 2014 09:36:12 -0700 Subject: [PATCH] fix(waitForAngular): when timeout overflows, at least pass the negative to error messages Closes #622 --- lib/protractor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/protractor.js b/lib/protractor.js index c3d080eea..120d71d5e 100644 --- a/lib/protractor.js +++ b/lib/protractor.js @@ -572,13 +572,13 @@ Protractor.prototype.waitForAngular = function() { var timeout; if (/asynchronous script timeout/.test(err.message)) { // Timeout on Chrome - timeout = /[\d\.]*\ seconds/.exec(err.message); + timeout = /-?[\d\.]*\ seconds/.exec(err.message); } else if (/Timed out waiting for async script/.test(err.message)) { // Timeout on Firefox - timeout = /[\d\.]*ms/.exec(err.message); + timeout = /-?[\d\.]*ms/.exec(err.message); } else if (/Timed out waiting for an asynchronous script/.test(err.message)) { // Timeout on Safari - timeout = /[\d\.]*\ ms/.exec(err.message); + timeout = /-?[\d\.]*\ ms/.exec(err.message); } if (timeout) { throw 'Timed out waiting for Protractor to synchronize with ' +