@@ -101,6 +101,9 @@ var Builder = function() {
101101 /** @private {firefox.Options} */
102102 this . firefoxOptions_ = null ;
103103
104+ /** @private {opera.Options} */
105+ this . operaOptions_ = null ;
106+
104107 /** @private {boolean} */
105108 this . ignoreEnv_ = false ;
106109} ;
@@ -284,6 +287,21 @@ Builder.prototype.setFirefoxOptions = function(options) {
284287} ;
285288
286289
290+ /**
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.
295+ *
296+ * @param {!opera.Options } options The OperaDriver options to use.
297+ * @return {!Builder } A self reference.
298+ */
299+ Builder . prototype . setOperaOptions = function ( options ) {
300+ this . operaOptions_ = options ;
301+ return this ;
302+ } ;
303+
304+
287305/**
288306 * Sets the control flow that created drivers should execute actions in. If
289307 * the flow is never set, or is set to {@code null}, it will use the active
@@ -333,10 +351,13 @@ Builder.prototype.build = function() {
333351 // Apply browser specific overrides.
334352 if ( browser === Browser . CHROME && this . chromeOptions_ ) {
335353 capabilities . merge ( this . chromeOptions_ . toCapabilities ( ) ) ;
336- }
337354
338- if ( browser === Browser . FIREFOX && this . firefoxOptions_ ) {
355+ } else if ( browser === Browser . FIREFOX && this . firefoxOptions_ ) {
339356 capabilities . merge ( this . firefoxOptions_ . toCapabilities ( ) ) ;
357+
358+ } else if ( browser === Browser . OPERA && this . operaOptions_ ) {
359+ capabilities . merge ( this . operaOptions_ . toCapabilities ( ) ) ;
360+
340361 }
341362
342363 // Check for a remote browser.
@@ -374,6 +395,12 @@ Builder.prototype.build = function() {
374395 var ie = require ( './ie' ) ;
375396 return new ie . Driver ( capabilities , this . flow_ ) ;
376397
398+ case Browser . OPERA :
399+ // Requiring 'opera' would create a cycle:
400+ // index -> builder -> opera -> index
401+ var opera = require ( './opera' ) ;
402+ return new opera . Driver ( capabilities , this . flow_ ) ;
403+
377404 case Browser . PHANTOM_JS :
378405 // Requiring 'phantomjs' would create a cycle:
379406 // index -> builder -> phantomjs -> index
0 commit comments