配置这个Protractor环境真是折磨死人了,webdriver-manage update怎么都不成功,即使自己下载好chromederiver放到相应文件夹下,也不能使用。费时三四天终于按照https://github.com/angular/protractor-cookbook/tree/master/protractor-docker这里的方法弄好了

首先你得确保安装了docker

docker -v

如果已经成功安装了会显示如下

Docker version 17.12.-ce, build c97c6d6

Step 0 - Download the docker images for Selenium Hub and Selenium Node

docker pull selenium/hub:latest
docker pull selenium/node-chrome:latest

如果你想要使用firefox-node,可以pull 'node-firefox'。想要了解不同镜像的更多信息,可以查看Docker Selenium Images List

Step1 - Starting the Selenium Grid

docker run -d -p : --name selenium-hub selenium/hub:latest

One can change the tag from 'latest' to '2.53.0' or any other version as they see fit.

Step2 - Starting the Selenium Nodes

docker run -d --link selenium-hub:hub selenium/node-chrome:latest

The above would create a chrome node and link it to the Selenium hub/grid created earlier.

Step3 - Running the tests

更新配置文件中的SeleniumAddress如下:

seleniumAddress: 'http://localhost:4444/wd/hub'

运行测试文件

./node_modules/.bin/protractor protractor-conf.js

有时候会不支持es6的语法结构,可以先使用babel进行转码, 需要安装babel,babel-cli,babel-core,babel-preset-latest,babel-preset-stage-2等依赖,配置.babelrc文件。

babel-node ./node_modules/.bin/protractor protractor-conf.js

我的项目中package.json

.babelrc文件

Running Protractor Tests on Docker的更多相关文章

  1. SWTError: No more handles [gtk_init_check() failed] running platform tests (on Linux)

    http://www.lemmster.de/2013-12-19-swterror-no-more-handles-gtk_init_check-failed-running-platform-te ...

  2. Configuring and Running Django + Celery in Docker Containers

    Configuring and Running Django + Celery in Docker Containers  Justyna Ilczuk  Oct 25, 2016  0 Commen ...

  3. Running Web API using Docker and Kubernetes

    Context As companies are continuously seeking ways to become more Agile and embracing DevOps culture ...

  4. VMWare File Format Learning && Use VHD File To Boot VMWare && CoreOS Docker Configuration And Running

    目录 . Virtual Machine Introduce . Vmware Image File Format . VHD File Format . Convert VHD File Into ...

  5. 转:VS2010调试NUnit测试项目 (Running or debugging NUnit tests from Visual Studio without any extensions)

    If you write unit tests and use NUnit test framework this may be helpful. I decided to write this si ...

  6. [Git] Automatically running tests before commits with ghooks

    Wouldn't it be nice if everyone ran the tests before committing code? With ghooks, you can automatic ...

  7. Running tests on PyCharm using Robot Framework

    问题: I started using PyCharm with the robot framework, but i'm facing an issue. how can i run my test ...

  8. Scala + Play + Sbt + Protractor

    Scala + Play + Sbt + Protractor = One Build 欢迎关注我的新博客地址:http://cuipengfei.me/ 我所在的项目的技术栈选用的是Play fra ...

  9. docker之常用命令、自定制镜像、公(私)仓库的上传和下载

    一.docker命令 1.参数和命令汇总 1. 参数 Options: --config=~/.docker Location of client config files #客户端配置文件的位置 - ...

随机推荐

  1. [转]Format a ui-grid grid column as currency

    本文转自:https://stackoverflow.com/questions/27747184/format-a-ui-grid-grid-column-as-currency-rc-3-0 Yo ...

  2. IoC容器之Unity

    关于IoC.Unity见博友文章点击这里. 话不多说,上程序HelloUnity,程序采用VS2010,Unity2.1. 1.程序框架如下 2.类库HelloUnity.Objects,主要为实体类 ...

  3. C# 条码生成类

    using System.Collections; using System.Text.RegularExpressions; namespace DotNet.Utilities { public ...

  4. 给Solr配置中文分词器

    第一步下载分词器https://pan.baidu.com/s/1X8v65YZ4gIkNQXsXfSULBw 第二歩打开已经解压的ik分词器文件夹 将ik-analyzer-solr5-5.x.ja ...

  5. apache Header set Cache-Control

    设置静态页面的缓存最大值 在.htaccess中添加下面的代码 <FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$"> Hea ...

  6. fb登陆遇到傻逼问题

    centos中curl需要ssl的支持, 所以我重新安装了curl,并安装了openssl-devel,这个是依赖,必须的. so 完美

  7. 代码实现SpringMvc

    偶然看到一篇100多行实现SpringMvc的博客,阅读后整理加实现出来.大家共勉!(纸上得来终觉浅,绝知此事要躬行.) 实现Spring的部分. Bean工厂,统一创建Bean: IOC,实现Bea ...

  8. OpenStack IceHouse 部署 - 2 - 网络与软件环境初始化

    OpenStack应用:节点软硬件环境配置    节点硬件与IP分配 实验室网关 10.14.39.1 各个节点 节点名称 硬件(Linux硬盘分区,RAM,CPU) ip地址(接口) 作用与运行的服 ...

  9. HDU P3341 Lost's revenge 题解+数据生成器

    Lost and AekdyCoin are friends. They always play "number game"(A boring game based on numb ...

  10. reac——父组件向子组件传递值,子组件何时能同步获得父组件改变后的值

    //这里是父组件的代码:export default class HeaderCom_son extends React.Component { constructor(props) { super( ...