5

actually i am struggling with absence of bigger picture on how to proceed , here is the case :

I have protractor test suite running headless using Chrome 60 (beta) binary by giving binary location in chrome options in windows environment.

I want to port this to available CI CD Jenkins instance (linux) and run headless there. I can think of two approaches :

Approach 1 :

Install chrome plugin in jenkins , so chrome becomes available to be driven by chrome driver < webdriver modules .so that i can use jenkins job as shown below :

npm install

npm run start (from script , runs webdriver-manager start )

npm run update (from script , runs webdriver-manager update )

npm run test (from script , runs protractor protactor.conf.js )

Approach 2 : install chrome as module like other npm modules .then

npm install

npm run start (from script , runs webdriver-manager start )

npm run update (from script , runs webdriver-manager update )

npm run test (from script , runs protractor protactor.conf.js )

I have looked into simple-headless-chrome , headless-chromium , chrome-runner npm modules , but not able to understand how these will work .

My understanding is to somehow have chrome binaries in node_modules and give path for chrome binaries in chrome options so that chrome driver can find it .

Can anyone enlighten me a little bit about bigger picture and how things will workout for Second approach .As i want dont have access to get chrome plugin installed on jenkins server and want to keep my setup independent.(nodejs and npm , java etc are available in jenkins)

4

1 回答 1

1

关于“通过在 windows 环境中的 chrome 选项中提供二进制位置来使用 Chrome 60 (beta) 二进制文件。”,您并不需要,量角器为您提供了一种指定标签以运行 chrome 二进制文件的方法:

https://github.com/angular/protractor/blob/master/docs/browser-setup.md#using-headless-chrome

我认为您没有安装 chrome 的节点模块,或者至少没有像 google chrome 本身那样可靠的东西,所以我所做的是在我的运行 jenkins slave 的 ubuntu 服务器上安装 google chrome,而您现在有一个google-chrome可以运行的二进制文件--headless

以前我的詹金斯奴隶在 CentOS 上运行,但我很难在它上面设置 chrome,所以改为 ubuntu。

于 2017-07-27T16:11:09.607 回答