本文介绍了用量角器运行什么是好的无头浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新用户在这里。

经过几个小时的建立我的烟雾和回归测试,我在网上阅读了很多案例后发现phantomjs已经很难运行了用量角器。詹金斯一直在为它迄今为止所做的所有任务运行幻影。

After hours of building my smoke and regression tests, I found out after reading many cases online that phantomjs is known to be a trouble to run with protractor. Jenkins has been running phantomjs for all the tasks it has been given so far.

他们需要这些测试作为没有安装窗口系统的ci的一部分运行。

所以如果推荐完全无头浏览器或无头镀铬(这将是最有益的)并逐步设置它,我将不胜感激。我已经有一个conf.js和一个e2e.conf.js文件。我的代码与chrome一起工作得非常好。

So I would appreciate it if there is a recommendation for completely headless browser or a headless chrome(that would be most beneficial) and a step by step to set it up. I already have a conf.js and a e2e.conf.js file. My code works perfectly fine with chrome.

我相信iMac和selenium webdriver。

I am on a iMac and selenium webdriver, I believe.

编辑:问题=量角器不适用于phantomjs。
我做了什么=使用不同的网络元素并用google搜索,如果有人遇到类似的情况。还搜索了适用于量角器的无头浏览器,无法找到合适的解决方案。

Problem = protractor doesn't work with phantomjs.What I have done = use different web elements and googled if anyone has faced a similar situation. Also googled for headless browsers that worked for protractor, unable to find a suitable solution.

推荐答案

最好的办法是继续使用Chrome 。通过一些工作,你可以通过CI和无头的方式让它工作 - 我们使用无头的Jenkins和Docker Ubuntu服务器来做这件事。

Your best bet is to continue with Chrome. With a bit of work you can get it to work via a CI and in a headless manner - we do this using Jenkins and Docker Ubuntu servers which are headless.

你将需要配置Chrome才能使用XVFB无头运行。你可以点击这里的要点

You will need to configure Chrome to run headless using XVFB. You can start off by following the gist here https://gist.github.com/addyosmani/5336747

您声明自己在Mac上,因此您可以通过计算机上的Docker运行无头测试,也可以为CI测试设置第二个配置。

You state you are on a Mac so you can either run the headless tests via Docker on your machine or you could set up a second config for the CI tests.

这篇关于用量角器运行什么是好的无头浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 04:42