通过远程硒网格运行黄瓜测试

时间:2016-03-08 13:54:49

标签: angularjs jenkins cucumber automated-tests selenium-grid

我为我的角度应用设置了一些黄瓜测试,如果我在本地使用selenium服务器运行它会正常工作。

现在我想通过远程selenium网格运行测试(准备将所有内容放在Jenkins上)。尽管如此,这并不像我希望的那样顺利。我收到以下错误:

Error while waiting for Protractor to sync with the page: "angular could not be found on the window"

我希望有人可以给我一些见解吗?这是我的conf文件中的任何帮助(我已经屏蔽了硒网格地址......)。当我在本地运行它时,我取消注释chromedriver和seleniumserverjar部分并评论seleniumaddress部分。

exports.config = {
    //chromeDriver: '../../node_modules/selenium-chromedriver/bin/chromedriver.exe',

    //seleniumServerJar: '../../node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-2.52.0.jar',


    seleniumAddress: 'http://x.x.x.x:4444/wd/hub',

    framework: 'cucumber',
    specs: [
        'features/*.feature'
    ],
    rootElement: "[ng-app]",
    capabilities: {
        browserName: 'chrome',
        'chromeOptions': {
            args: ['--disable-gpu']
        },
        version: '',
        platform: 'ANY'
    },
    cucumberOpts: {
        require: ['step_definitions/*_steps.js'],
        format: 'pretty'
    }
};

我从gulpfile开始我的黄瓜测试。任务配置如下:

gulp.task('cucumber', ['js', 'connect:st', 'clean:e2eReporters'], function () {
return gulp.src([])
    .pipe($.protractor.protractor({
        configFile: './test/system-test/cucumber.conf.js',
        args: ['--baseUrl', 'http://' + ip.address() + ':9001']
    }))
    .on('error', function (err) {
        $.connect.serverClose();
        throw err;
    }).once('end', function (err) {
        process.exit();
    });
});

0 个答案:

没有答案