我正在使用AngularJS / JBOSS构建SaaS解决方案,该解决方案托管在AWS EC2实例上;我们所有的功能都包含在单元和e2e测试中.所有测试都在本地运行良好.我们无法弄清楚如何在AWS上运行它们.我们的AWS安装包括根据
these instructions安装的无头CHROME:
重现步骤
>在基于linux的x86_64 EC2实例中设置chrome / firefox
>启动webdriver-manager启动
>在单独的终端窗口上,启动量角器
/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)); } };
在此先感谢您的帮助!
使用Headless Chrome选项
原文链接:https://www.f2er.com/angularjs/141136.html这极大地简化了工作流程并且不得不使用更多系统资源.
请按照以下广泛步骤操作:
> Chrome安装.假设您已经安装了Chrome.但是如果没有遵循steps to install Chrome on linux EC2
>将量角器选项更改为如下所示.重要的是 – 无头.另外请记住,无头模式需要预先指定浏览器大小: –
chromeOptions: { args: [ "--headless","--disable-gpu","--window-size=800,600" ] }