2

私はangularjsアプリのe2eテストに分度器を使用している初心者です。分度器のセットアップの最新バージョンがあり、Visual Studio 2015 を IDE として使用しています。

私のテストで言及されている関数 browser.get() は機能せず、「Data:,」を含むブラウザ ウィンドウしか開きません。

ここに私のconfig.jsファイルがあります:

'use strict';
exports.config = {
        directConnect: true,
        chromeDriver: './node_modules/protractor/selenium/chromedriver.exe',

    // Capabilities to be passed to the webdriver instance.
    capabilities: {
        'browserName': 'chrome'

    },

    // Spec patterns are relative to the current working directly when
    // protractor is called.
    specs: ['example_spec.js'],
    framework: 'jasmine',

    // Options to be passed to Jasmine-node.
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
    },

    onPrepare: function () {
        browser.driver.manage().window().maximize();
    }
};

ここに私のspec.jsファイルがあります:

describe('angularjs homepage', function () {
    it('should have a title', function () {
      browser.get('http://angularjs.org/');

        expect(browser.getTitle()).toContain('AngularJS');
    });
});

私は何かを見逃していますか?助けてください!私は3日以来これを修正しようとしています。

4

1 に答える 1

0

最初のもの、

chromeDriver: './node_modules/protractor/selenium/chromedriver.exe'

必要ありません。Web ドライバー マネージャーが管理します。

If your protractor version is >3.0  then install node > 4.0.

アップデート :

次のコマンドを実行してください:

webdriver-manager update
于 2016-02-11T14:22:17.940 に答える