@@ -104,6 +104,12 @@ var Builder = function() {
104
104
/** @private {opera.Options} */
105
105
this . operaOptions_ = null ;
106
106
107
+ /** @private {ie.Options} */
108
+ this . ieOptions_ = null ;
109
+
110
+ /** @private {safari.Options} */
111
+ this . safariOptions_ = null ;
112
+
107
113
/** @private {boolean} */
108
114
this . ignoreEnv_ = false ;
109
115
} ;
@@ -258,10 +264,10 @@ Builder.prototype.setAlertBehavior = function(behavior) {
258
264
259
265
260
266
/**
261
- * Sets Chrome- specific options for drivers created by this builder. Any
262
- * logging or proxy settings defined on the given options will take precedence
263
- * over those set through { @link #setLoggingPrefs} and { @link #setProxy},
264
- * respectively.
267
+ * Sets Chrome specific { @linkplain selenium-webdriver/chrome.Options options}
268
+ * for drivers created by this builder. Any logging or proxy settings defined
269
+ * on the given options will take precedence over those set through
270
+ * { @link #setLoggingPrefs} and { @link #setProxy}, respectively.
265
271
*
266
272
* @param {!chrome.Options } options The ChromeDriver options to use.
267
273
* @return {!Builder } A self reference.
@@ -273,10 +279,10 @@ Builder.prototype.setChromeOptions = function(options) {
273
279
274
280
275
281
/**
276
- * Sets Firefox- specific options for drivers created by this builder. Any
277
- * logging or proxy settings defined on the given options will take precedence
278
- * over those set through { @link #setLoggingPrefs} and { @link #setProxy},
279
- * respectively.
282
+ * Sets Firefox specific { @linkplain selenium-webdriver/firefox.Options options}
283
+ * for drivers created by this builder. Any logging or proxy settings defined
284
+ * on the given options will take precedence over those set through
285
+ * { @link #setLoggingPrefs} and { @link #setProxy}, respectively.
280
286
*
281
287
* @param {!firefox.Options } options The FirefoxDriver options to use.
282
288
* @return {!Builder } A self reference.
@@ -288,10 +294,10 @@ Builder.prototype.setFirefoxOptions = function(options) {
288
294
289
295
290
296
/**
291
- * Sets Opera- specific options for drivers created by this builder. Any
292
- * logging or proxy settings defined on the given options will take precedence
293
- * over those set through { @link #setLoggingPrefs} and { @link #setProxy},
294
- * respectively.
297
+ * Sets Opera specific { @linkplain selenium-webdriver/opera.Options options} for
298
+ * drivers created by this builder. Any logging or proxy settings defined on the
299
+ * given options will take precedence over those set through
300
+ * { @link #setLoggingPrefs} and { @link #setProxy}, respectively.
295
301
*
296
302
* @param {!opera.Options } options The OperaDriver options to use.
297
303
* @return {!Builder } A self reference.
@@ -302,6 +308,36 @@ Builder.prototype.setOperaOptions = function(options) {
302
308
} ;
303
309
304
310
311
+ /**
312
+ * Sets Internet Explorer specific
313
+ * {@linkplain selenium-webdriver/ie.Options options} for drivers created by
314
+ * this builder. Any proxy settings defined on the given options will take
315
+ * precedence over those set through {@link #setProxy}.
316
+ *
317
+ * @param {!ie.Options } options The IEDriver options to use.
318
+ * @return {!Builder } A self reference.
319
+ */
320
+ Builder . prototype . setIeOptions = function ( options ) {
321
+ this . ieOptions_ = options ;
322
+ return this ;
323
+ } ;
324
+
325
+
326
+ /**
327
+ * Sets Safari specific {@linkplain selenium-webdriver/safari.Options options}
328
+ * for drivers created by this builder. Any logging settings defined on the
329
+ * given options will take precedence over those set through
330
+ * {@link #setLoggingPrefs}.
331
+ *
332
+ * @param {!safari.Options } options The Safari options to use.
333
+ * @return {!Builder } A self reference.
334
+ */
335
+ Builder . prototype . setSafariOptions = function ( options ) {
336
+ this . safariOptions_ = options ;
337
+ return this ;
338
+ } ;
339
+
340
+
305
341
/**
306
342
* Sets the control flow that created drivers should execute actions in. If
307
343
* the flow is never set, or is set to {@code null}, it will use the active
@@ -355,9 +391,14 @@ Builder.prototype.build = function() {
355
391
} else if ( browser === Browser . FIREFOX && this . firefoxOptions_ ) {
356
392
capabilities . merge ( this . firefoxOptions_ . toCapabilities ( ) ) ;
357
393
394
+ } else if ( browser === Browser . INTERNET_EXPLORER && this . ieOptions_ ) {
395
+ capabilities . merge ( this . ieOptions_ . toCapabilities ( ) ) ;
396
+
358
397
} else if ( browser === Browser . OPERA && this . operaOptions_ ) {
359
398
capabilities . merge ( this . operaOptions_ . toCapabilities ( ) ) ;
360
399
400
+ } else if ( browser === Browser . SAFARI && this . safariOptions_ ) {
401
+ capabilities . merge ( this . safariOptions_ . toCapabilities ( ) ) ;
361
402
}
362
403
363
404
// Check for a remote browser.
@@ -407,6 +448,12 @@ Builder.prototype.build = function() {
407
448
var phantomjs = require ( './phantomjs' ) ;
408
449
return new phantomjs . Driver ( capabilities , this . flow_ ) ;
409
450
451
+ case Browser . SAFARI :
452
+ // Requiring 'safari' would create a cycle:
453
+ // index -> builder -> safari -> index
454
+ var safari = require ( './safari' ) ;
455
+ return new safari . Driver ( capabilities , this . flow_ ) ;
456
+
410
457
default :
411
458
throw new Error ( 'Do not know how to build driver: ' + browser
412
459
+ '; did you forget to call usingServer(url)?' ) ;
0 commit comments