Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 99bda1a

Browse files
committed
fix(waitForAngular): when timeout overflows, at least pass the negative to error messages
Closes #622
1 parent e8d9d90 commit 99bda1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/protractor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -572,13 +572,13 @@ Protractor.prototype.waitForAngular = function() {
572572
var timeout;
573573
if (/asynchronous script timeout/.test(err.message)) {
574574
// Timeout on Chrome
575-
timeout = /[\d\.]*\ seconds/.exec(err.message);
575+
timeout = /-?[\d\.]*\ seconds/.exec(err.message);
576576
} else if (/Timed out waiting for async script/.test(err.message)) {
577577
// Timeout on Firefox
578-
timeout = /[\d\.]*ms/.exec(err.message);
578+
timeout = /-?[\d\.]*ms/.exec(err.message);
579579
} else if (/Timed out waiting for an asynchronous script/.test(err.message)) {
580580
// Timeout on Safari
581-
timeout = /[\d\.]*\ ms/.exec(err.message);
581+
timeout = /-?[\d\.]*\ ms/.exec(err.message);
582582
}
583583
if (timeout) {
584584
throw 'Timed out waiting for Protractor to synchronize with ' +

0 commit comments

Comments
 (0)