量角器测试不是抓取基本URL



我有许多量角器测试工作正常,直到我更新量角器(到 1.6.1)和茉莉花(到 2.1.1)。 现在,当我尝试运行测试时,Chrome 浏览器会打开,但不会导航到基本网址。下面是我的配置文件,敏感信息替换为 xxx:

 exports.config = {
seleniumServerJar: './node_modules/selenium-server/lib/runner/selenium-server-standalone-2.44.0.jar',
chromeDriver: './node_modules/chromedriver/lib/chromedriver/chromedriver',
shardTestFiles: false,
specs: [
    'test/e2e/policy-add.spec.js'
],
jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 600000,
    isVerbose: true,
    includeStackTrace: true
},
capabilities: {
    browserName: 'chrome',
    'chromeOptions': {
    args: ['--test-type']
    },
},
params: {
    login: {
    user: 'xxx@xxx.com',
    password: 'xxx'
    },
    webform: 'https://xxx'
},
baseUrl: 'https://xxx.xxx.com',
rootElement: 'body',
framework: 'jasmine',
onPrepare: function () {
    var loginHelpers = require('./test/e2e/helpers/login-helpers.js');
    loginHelpers.login();
}

};

这就是我使用browser.get的方式:

this.navigate = function(url){
    browser.get(url);
    browser.ignoreSynchronization = true;
};

我调用该函数:

globalHelpers.navHelpers.navigate('#/');

问题似乎出在配置文件的 onPrepare 部分中调用登录函数。 当我将登录功能移动到规范文件时,浏览器打开并导航到基本 URL。

最新更新