我正在使用AngularJS / JBOSS构建SaaS解决方案,该解决方案托管在AWS EC2实例上;我们所有的功能都包含在单元和e2e测试中。所有测试都在本地运行良好。我们无法弄清楚如何在AWS上运行它们。我们的AWS安装包括根据these instructions安装的无头CHROME:
重现步骤
观察到的行为 1. webdriver终端上显示以下错误:
/usr/local/lib/node_modules/protractor/selenium/chromedriver: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
06:41:15.140 WARN - Exception thrown
预期行为 1.量角器测试执行无误
其他资源: 1.量角器配置文件
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../test/e2e/**/*.js'],
// A base URL for your application under test. Calls to browser.get()
// with relative paths will be prepended with this.
baseUrl: 'http://localhost:8080/markodojo_solution/#/a3bc8692-5af4-4a4d-b21b-4e6f87dc2a32',
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
defaultTimeoutInterval: 30000
},
//Options to output testreuslts in xml format
onPrepare: function() {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('xmloutput', true, true));
}
};
提前感谢您的任何帮助!
答案 0 :(得分:0)
使用无头Chrome选项
这极大地简化了工作流程并且不得不使用更多系统资源。
按照以下广泛步骤操作:
将量角器选项更改为如下所示。重要的是--headless
。另外请记住,无头模式需要预先指定浏览器大小: -
chromeOptions: {
args: [ "--headless", "--disable-gpu", "--window-size=800,600" ]
}