docs: function (complete) {
          if (this._initialized)
              return complete();
  
          var self = this;
          this._initialized = true;
  
          this.webdriver = webdriverio;
  
          async.series(
              [
                  function (cb) {
                      if (self.options.httpServer.disable)
                          cb();
                      else
                      {
                          function tryLaunchWithPort(port, cb)
                          {
                              self._log("Launching local web server (http://localhost:" + port + "/)...");
  
                              portscanner.checkPortStatus(port, 'localhost', function (err, status) {
                                  if (status === 'open')
                                  {
                                      var msg = "Port " + port + " is already open. ";
                                      switch(self.options.httpServer.portConflict)
                                      {
                                          case 'disable':
                                              self._log(msg + 'Skipping web server launch.');
                                              cb();
                                              break;
  
                                          case 'random':
                                              var min = 49152;
                                              var max = 65535;
                                              self.options.httpServer.port = Math.random() * (max - min) + min;
                                              self._log(msg + 'Trying port ' + self.options.httpServer.port + ' instead.');
                                              tryLaunchWithPort(self.options.httpServer.port, cb);
                                              break;
  
                                          case 'exit':
                                          default:
                                              self._doError(msg + 'Exiting now.', cb);
                                              break;
                                      }
                                  }
                                  else {
                                      self.httpServer = httpserver.createServer(self.options.httpServer);
                                      self.httpServer.listen(port, function () {
                                          self._log("Web server ready on port " + port + ".");
                                          cb();
                                      });
                                  }
                              });
                          }
  
                          tryLaunchWithPort(self.options.httpServer.port, cb);
                      }
                  },
                  function (cb) {
  
                      // Initialize SauceLabs
                      self.options.sauceLabs.username = self.options.sauceLabs.username || self.options.sauceUsername;
                      self.options.sauceLabs.password = self.options.sauceLabs.password || self.options.sauceAccessKey;
  
                      if (self.options.sauceLabs.username && self.options.sauceLabs.password) {
                          self._log("Initializing SauceLabs API.");
                          self.sauceLabs = new SauceLabs({
                              username: self.options.sauceLabs.username,
                              password: self.options.sauceLabs.password
                          });
                      }
  
                      self.options.sauceConnect.username = self.options.sauceConnect.username || self.options.sauceUsername;
                      self.options.sauceConnect.accessKey = self.options.sauceConnect.accessKey || self.options.sauceAccessKey;
  
                      if (self.options.sauceConnect.username && self.options.sauceConnect.accessKey) {
                          if (self.options.sauceConnect.disable) {
                              self._log("Sauce Connect disabled.");
                              cb();
                          }
                          else {
                              self._log("Launching Sauce Connect...");
                              self._log("Username: " + self.options.sauceConnect.username);
                              self._log("Access Key: " + self.options.sauceConnect.accessKey.replace(/.(?=.{4,})/g, '*'));
                              delete self.options.sauceConnect.disable;
                              sauceConnectLauncher(self.options.sauceConnect, function (errmsg, process) {
                                  if (errmsg) {
                                      if (process) process.close();
                                      return self._doError('Error launching Sauce Connect:\n' + errmsg, cb);
                                  }
                                  self.sauceConnect = process;
                                  self._log("Sauce Connect ready.");
                                  cb();
                              });
                          }
                      }
                      else {
                          self._log("Selenium Standalone: No SauceLabs username/accessKey. Launching locally...");
  
                          portscanner.checkPortStatus(self.options.webdriver.port, 'localhost', function (err, status) {
                              if (status === 'open') {
                                  var msg = "Selenium Standalone: Port " + self.options.webdriver.port + " is already open. ";
                                  switch(self.options.selenium.portConflict)
                                  {
                                      case 'disable':
                                          self._log(msg + 'Skipping launch.');
                                          cb();
                                          break;
  
                                      case 'exit':
                                      default:
                                          self._doError(msg + 'Exiting now.', cb);
                                          break;
                                  }
                              }
                              else {
                                  selenium.install({
                                      logger: function(message) {
                                      }
                                  }, function(err) {
                                      if(err)
                                          return self._doError("Selenium Standalone: installation error: " + err, cb);
  
                                      selenium.start({ seleniumArgs: self.options.selenium.args }, function(err, child) {
                                          self.selenium = child;
                                          if(err)
                                              self._doError("Selenium Standalone: startup error: " + typeof(err) + err, cb);
                                          else
                                          {
                                              self._log("Selenium Standalone: launched.");
                                              cb();
                                          }
                                      });
                                  });
                              }
                          });
                      }
                  }
              ],
              complete
          );
      }