角度+量角器+竹 [英] Angular + Protractor + Bamboo

查看:108
本文介绍了角度+量角器+竹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人在Bamboo CI上设置了Protractor e2e测试吗?

Has anyone setup Protractor e2e tests on Bamboo CI?

我一直通过grunt-protractor-runner/grunt-protractor-webdriver项目从Grunt在本地运行WebDriver测试.量角器配置是标准配置.相关的Grunt配置:

I've been running my WebDriver tests locally from Grunt via the grunt-protractor-runner / grunt-protractor-webdriver projects. Protractor config is standard. Relevant Grunt config:

grunt.initConfig({
    protractor: {
        options: {
            keepAlive: false,
            noColor: false
        },
        modules: {
            configFile: 'protractor.e2e.conf.js'
        }
    },
    protractor_webdriver: {
        modules: {
            options: {
                path: 'node_modules/protractor/bin/',
                command: 'webdriver-manager start'
            }
        }
    }
});

grunt.registerTask('e2e', [ 'protractor_webdriver', 'protractor' ]);

这就像一个带有简单grunt e2e

试图在Bamboo上进行这项工作效果不佳.到目前为止,我的任务:

Trying to get this working on Bamboo is less than effective. My tasks so far:

  • 结帐回购源
  • npm install
  • webdriver-manager update
  • grunt e2e
  • Checkout repo source
  • npm install
  • webdriver-manager update
  • grunt e2e

日志显示它正在启动Selenium服务器,启动Firefox,然后失败,并出现以下错误:

The log shows it starting up Selenium server, launching Firefox, then failing with the following error:

UnknownError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified

推荐答案

从Bamboo运行此程序时,还应该安装Xvfb之类的东西,这使您可以启动无头屏幕,该屏幕可从命令行使用.

When running this from bamboo you should also install something like Xvfb this enables you to start a headless screen that can be used from the commandline.

在安装Xvfb之后,您可以通过运行

after installing Xvfb you can start a new screen by running

Xvfb :97 -ac -screen 0 1600x1200x24

在Grunt配置中,您可以添加新任务

in you grunt config you can add a new task

env : {
  xvfb: {
        DISPLAY: ':97'
  }
}

启动量角器之前,应连接屏幕.这可以通过

You shoud connect the screen before starting protractor. this can be done with

grunt.registerTask('e2e', [ 'env:xvfb','protractor_webdriver', 'protractor' ]);

这篇关于角度+量角器+竹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆