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

Commit 50600b5

Browse files
committed
Merge pull request #42 from beckyconning/webdriver-2.53.1
Updated to webdriver 2.53.1
2 parents 85fd76c + 5da55d1 commit 50600b5

File tree

3 files changed

+39
-50
lines changed

3 files changed

+39
-50
lines changed

src/Selenium.js

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var webdriver = require("selenium-webdriver"),
88
exports.get = function(driver) {
99
return function(url) {
1010
return function(cb, eb) {
11-
driver.get(url).then(cb).thenCatch(eb);
11+
driver.get(url).then(cb, eb);
1212
};
1313
};
1414
};
@@ -39,17 +39,16 @@ exports.wait = function(check) {
3939
} else {
4040
eb(new Error("wait promise has returned false"));
4141
}
42-
}).thenCatch(eb);
43-
})
44-
.thenCatch(eb);
42+
}, eb);
43+
}, eb);
4544
};
4645
};
4746
};
4847
};
4948

5049
exports.quit = function(driver) {
5150
return function(cb, eb) {
52-
driver.quit().then(cb).thenCatch(eb);
51+
driver.quit().then(cb,eb);
5352
};
5453
};
5554

@@ -115,7 +114,7 @@ function _find(nothing) {
115114
return function(cb) {
116115
driver.findElement(by).then(function(el) {
117116
return cb(just(el));
118-
}).thenCatch(function() {
117+
}, function() {
119118
return cb(nothing);
120119
});
121120
};
@@ -127,7 +126,7 @@ function _find(nothing) {
127126
function _exact(driver) {
128127
return function(by) {
129128
return function(cb, eb) {
130-
driver.findElement(by).then(cb).thenCatch(eb);
129+
driver.findElement(by).then(cb, eb);
131130
};
132131
};
133132
}
@@ -148,9 +147,7 @@ function _finds(parent) {
148147
return function(cb, eb) {
149148
return parent.findElements(by).then(function(children) {
150149
return cb(children);
151-
}).thenCatch(function(err) {
152-
return eb(err);
153-
});
150+
}, eb)
154151
};
155152
};
156153
}
@@ -161,15 +158,15 @@ exports._findChildren = _finds;
161158
exports.sendKeysEl = function(keys) {
162159
return function(el) {
163160
return function(cb, eb) {
164-
el.sendKeys(keys).then(cb).thenCatch(eb);
161+
el.sendKeys(keys).then(cb, eb);
165162
};
166163
};
167164
};
168165

169166
exports.getCssValue = function(el) {
170167
return function(str) {
171168
return function(cb, eb) {
172-
return el.getCssValue(str).then(cb).thenCatch(eb);
169+
return el.getCssValue(str).then(cb, eb);
173170
};
174171
};
175172
};
@@ -185,7 +182,7 @@ exports._getAttribute = function(nothing) {
185182
} else {
186183
cb(just(attr));
187184
}
188-
}).thenCatch(eb);
185+
}, eb);
189186
};
190187
};
191188
};
@@ -194,91 +191,91 @@ exports._getAttribute = function(nothing) {
194191

195192
exports.getText = function(el) {
196193
return function(cb, eb) {
197-
return el.getText().then(cb).thenCatch(eb);
194+
return el.getText().then(cb, eb);
198195
};
199196
};
200197

201198
exports.isDisplayed = function(el) {
202199
return function(cb, eb) {
203200
return el.isDisplayed().then(function(is) {
204201
return cb(is);
205-
}).thenCatch(eb);
202+
}, eb);
206203
};
207204
};
208205

209206
exports.isEnabled = function(el) {
210207
return function(cb, eb) {
211208
return el.isEnabled().then(function(is) {
212209
return cb(is);
213-
}).thenCatch(eb);
210+
}, eb);
214211
};
215212
};
216213

217214
exports.getCurrentUrl = function(driver) {
218215
return function(cb, eb) {
219-
return driver.getCurrentUrl().then(cb).thenCatch(eb);
216+
return driver.getCurrentUrl().then(cb, eb);
220217
};
221218
};
222219

223220
exports.getTitle = function(driver) {
224221
return function(cb, eb) {
225-
return driver.getTitle().then(cb).thenCatch(eb);
222+
return driver.getTitle().then(cb, eb);
226223
};
227224
};
228225

229226
exports.navigateBack = function(driver) {
230227
return function(cb, eb) {
231228
var n = new webdriver.WebDriver.Navigation(driver);
232-
return n.back().then(cb).thenCatch(eb);
229+
return n.back().then(cb, eb);
233230
};
234231
};
235232

236233
exports.navigateForward = function(driver) {
237234
return function(cb, eb) {
238235
var n = new webdriver.WebDriver.Navigation(driver);
239-
return n.forward().then(cb).thenCatch(eb);
236+
return n.forward().then(cb, eb);
240237
};
241238
};
242239

243240
exports.refresh = function(driver) {
244241
return function(cb, eb) {
245242
var n = new webdriver.WebDriver.Navigation(driver);
246-
return n.refresh().then(cb).thenCatch(eb);
243+
return n.refresh().then(cb, eb);
247244
};
248245
};
249246

250247
exports.navigateTo = function(url) {
251248
return function(driver) {
252249
return function(cb, eb) {
253250
var n = new webdriver.WebDriver.Navigation(driver);
254-
return n.to(url).then(cb).thenCatch(eb);
251+
return n.to(url).then(cb, eb);
255252
};
256253
};
257254
};
258255

259256

260257
exports.getInnerHtml = function(el) {
261258
return function(cb, eb) {
262-
el.getInnerHtml().then(cb).thenCatch(eb);
259+
el.getInnerHtml().then(cb, eb);
263260
};
264261
};
265262

266263
exports.getSize = function(el) {
267264
return function(cb, eb) {
268-
el.getSize().then(cb).thenCatch(eb);
265+
el.getSize().then(cb, eb);
269266
};
270267
};
271268

272269
exports.getLocation = function(el) {
273270
return function(cb, eb) {
274-
el.getLocation().then(cb).thenCatch(eb);
271+
el.getLocation().then(cb, eb);
275272
};
276273
};
277274

278275
function execute(driver) {
279276
return function(action) {
280277
return function(cb, eb) {
281-
driver.executeScript(action).then(cb).thenCatch(eb);
278+
driver.executeScript(action).then(cb, eb);
282279
};
283280
};
284281
}
@@ -295,22 +292,21 @@ exports.affLocator = function(aff) {
295292

296293
exports.clearEl = function(el) {
297294
return function(cb, eb) {
298-
el.clear().then(cb).thenCatch(eb);
295+
el.clear().then(cb, eb);
299296
};
300297
};
301298

302299
exports.clickEl = function(el) {
303300
return function(cb, eb) {
304-
el.click().then(cb).thenCatch(eb);
301+
el.click().then(cb, eb);
305302
};
306303
};
307304

308305

309306
exports.takeScreenshot = function(driver) {
310307
return function(cb, eb) {
311308
driver.takeScreenshot()
312-
.then(cb)
313-
.thenCatch(eb);
309+
.then(cb, eb);
314310
};
315311
};
316312

@@ -330,8 +326,7 @@ exports.saveScreenshot = function(fileName) {
330326
if (err) return eb(err);
331327
return cb();
332328
});
333-
})
334-
.thenCatch(eb);
329+
}, eb);
335330
};
336331
};
337332
};
@@ -351,33 +346,29 @@ exports.getWindow = function(window) {
351346
exports.getWindowPosition = function(window) {
352347
return function(cb, eb) {
353348
return window.getPosition()
354-
.then(cb)
355-
.thenCatch(eb);
349+
.then(cb, eb);
356350
};
357351
};
358352

359353
exports.getWindowSize = function(window) {
360354
return function(cb, eb) {
361355
return window.getSize()
362-
.then(cb)
363-
.thenCatch(eb);
356+
.then(cb, eb);
364357
};
365358
};
366359

367360
exports.maximizeWindow = function(window) {
368361
return function(cb, eb) {
369362
return window.maximize()
370-
.then(cb)
371-
.thenCatch(eb);
363+
.then(cb, eb);
372364
};
373365
};
374366

375367
exports.setWindowPosition = function(loc) {
376368
return function(window) {
377369
return function(cb, eb) {
378370
return window.setPosition(loc.x, loc.y)
379-
.then(cb)
380-
.thenCatch(eb);
371+
.then(cb, eb);
381372
};
382373
};
383374
};
@@ -386,8 +377,7 @@ exports.setWindowSize = function(size) {
386377
return function(window) {
387378
return function(cb, eb) {
388379
return window.setSize(size.width, size.height)
389-
.then(cb)
390-
.thenCatch(eb);
380+
.then(cb, eb);
391381
};
392382
};
393383
};
@@ -399,32 +389,32 @@ exports.getWindowScroll = function(driver) {
399389
x: window.scrollX,
400390
y: window.scrollY
401391
};
402-
}).then(cb).thenCatch(eb);
392+
}).then(cb, eb);
403393
};
404394
};
405395

406396
exports.getWindowHandle = function(driver) {
407397
return function(cb, eb) {
408-
driver.getWindowHandle().then(cb).thenCatch(eb);
398+
driver.getWindowHandle().then(cb, eb);
409399
};
410400
};
411401

412402
exports._getAllWindowHandles = function(driver) {
413403
return function(cb, eb) {
414-
driver.getAllWindowHandles().then(cb).thenCatch(eb);
404+
driver.getAllWindowHandles().then(cb, eb);
415405
};
416406
};
417407

418408
exports.switchTo = function(handle) {
419409
return function(driver) {
420410
return function(cb, eb) {
421-
return driver.switchTo().window(handle).then(cb).thenCatch(eb);
411+
return driver.switchTo().window(handle).then(cb, eb);
422412
};
423413
};
424414
};
425415

426416
exports.close = function(driver) {
427417
return function(cb, eb) {
428-
return driver.close().then(cb).thenCatch(eb);
418+
return driver.close().then(cb, eb);
429419
};
430420
};

src/Selenium/ActionSequence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports.newSequence = function(driver) {
1515
exports.performSequence = function(sequence) {
1616
return function(cb, eb) {
1717
try {
18-
return sequence.perform().then(cb).thenCatch(eb);
18+
return sequence.perform().then(cb, eb);
1919
}
2020
catch (e) {
2121
return eb(e);

src/Selenium/FFProfile.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ exports._setFFPreference = function(key) {
1717
exports._encode = function(p) {
1818
return function(cb, eb) {
1919
p.encode()
20-
.then(function(c) { return cb({firefox_profile: c});})
21-
.thenCatch(eb);
20+
.then(function(c) { return cb({firefox_profile: c});}, eb);
2221
};
2322
};

0 commit comments

Comments
 (0)