Skip to content
This repository was archived by the owner on Jan 17, 2020. It is now read-only.

wait fix #5

Merged
merged 1 commit into from
Aug 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Selenium.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ exports.wait = function(check) {
return function(driver) {
return function(cb, eb) {
var p = new webdriver.promise.Promise(check);
driver.wait(p, timeout).then(cb).thenCatch(eb);
driver.wait(p, timeout)
.then(function() {
p.then(function(res) {
if (res) {
cb();
} else {
eb(new Error("wait promise has returned false"));
}
}).thenCatch(eb);
})
.thenCatch(eb);
};
};
};
Expand Down