无法获得量角器directConnect功能

时间:2017-08-08 17:25:38

标签: angular protractor e2e-testing angularjs-e2e

我可以独立运行protractor,让cucumberwebdriver-manager start工作。但是,我需要使用directConnect直接连接到浏览器,我已更新了protractor.conf.js,但是,我看不出它是如何工作的。目前,它打开了浏览器,但没有任何反应。它没有点击端口8000上的应用程序,也没有尝试验证任何类型的测试。我错过了什么吗?

exports.config = {
  baseUrl: 'http://localhost:8000/',
  // seleniumAddress: 'http://localhost:4444/wd/hub',
  // seleniumPort: 4444,
  directConnect: true,
  getPageTimeout: 60000,
  allScriptsTimeout: 500000,
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  capabilities: {
    browserName: 'chrome'
  },
  specs: [
    'tests/**/*.feature'
  ],
  cucumberOpts: {
    require: [
      'tests/support/**/*.js',
      'tests/step_definitions/**/*.js',
    ],
    format: 'pretty',
    tags: false,
    profile: false,
    'no-source': true
  },
  onPrepare: () => {
    browser.driver.manage().window().setPosition(0, 0);
    browser.driver.manage().window().setSize(1280, 720);
  }
};

1 个答案:

答案 0 :(得分:-1)

它为我工作:

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {

    let location : CLLocation = locations.last!

    if location.coordinate.latitude != lastLat && location.coordinate.longitude != lastLon{
        // take action
    }
}

};