'use strict';

var ChromeDriver = require('..');
var detectPort = require('detect-port');
var Install = require('../lib/install');

describe('test', function() {
  it('should be ok', function() {
    ChromeDriver.should.be.ok();
  });

  it('should start success', function *() {
    var proxyPort = yield detectPort(9515);
    var chromedriver = new ChromeDriver({
      proxyPort: proxyPort
    });

    chromedriver.should.be.ok();

    try {
      yield chromedriver.start({
        browserName: 'chrome'
      });
    } catch (err) {
      console.log(err);
    }
  });
  it('install specific chromedriver version', function *() {
    process.env.CHROMEDRIVER_CDNURL='http://cdn.npm.taobao.org/dist/chromedriver';
    Install('2.30').then(() => {
      logger.info(`Install chromedriver version ${this.version} succeed!`);
    }).catch(() => {
      logger.error(`Install chromedriver version ${this.version} failed!`);
    });
  });
});

@@ -572,372 +572,8 @@
 %7D);%0A
-  it('install specific chromedriver version', function *() %7B%0A    process.env.CHROMEDRIVER_CDNURL='http://cdn.npm.taobao.org/dist/chromedriver';%0A    Install('2.30').then(() =%3E %7B%0A      logger.info(%60Install chromedriver version $%7Bthis.version%7D succeed!%60);%0A    %7D).catch(() =%3E %7B%0A      logger.error(%60Install chromedriver version $%7Bthis.version%7D failed!%60);%0A    %7D);%0A  %7D);%0A
 %7D);%0A

deprecate the case