配置这个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. oracle 数据库添加Java方法

    create or replace and compile java source named "Bitconverter" aspublic class Bitconverter ...

  2. Spring发送基于freemarker模板的邮件

    在项目开发过程中,我们经常会遇到需要发送邮件的场景,比如:用户验证邮箱的时候,有活动通知或者提醒通知的时候……有些时候我们可能只需要发送一些简单文本内容即可,但是大多数情况下我们更希望邮件的内容是丰富 ...

  3. Centos 7 ip地址

    vim /etc/sysconfig/network-scripts/ifcfg-ens33 HWADDR="00:15:5D:07:F1:02" TYPE="Ether ...

  4. CSS浮动的3个特性(高手绕行)

    1.  浮动元素会脱离正常的文档流,按照其外边距指定的位置相对于它的上一个块级元素(或父元素)显示: 代码示例: <!DOCTYPE HTML > <html> <hea ...

  5. 6、Object、String、StringBuffer

    Java的Api以及Object类 API概念 * A:API(Application Programming Interface) * 应用程序编程接口 * B:Java API * 就是Java提 ...

  6. 分布式ID生成器PHP+Swoole实现(下) - 代码实现

    上篇文章主要介绍<实现原理>,这篇看主要代码的编写. 实现IDGenerator类 64位ID由以下元素组成:固定位占2位,时间戳占41位,服务实例数字编号占4位,业务编号占10位,自增i ...

  7. 阿里云服务器windows server流量不大的情况下,tomcat经常出现访问阻塞,手动ctrl+c或者点击右键又访问正常

    我被这个问题折磨了好几天,因为这两天要帮别人做推广,不能再出现这样的情况了,不然广告费就白烧了,所以特意查了一下资料,结果解决方案被我找出来了. 问题发生原因是因为打开编辑选项后,一不小心点到dos窗 ...

  8. 二进制之Java中的进制(二)

    1. jdk中的进制转换 十进制转十六进制 Integer.toHexString(int i); 十进制转八进制 Integer.toOctalString(int i); 十进制转二进制 Inte ...

  9. Hibernate与mybatis比较

    Hibernate与mybatis比较 1.先说底层: a)Jdbc:全称java数据库连接,是java语言用来规范客户端如何访问数据库的程序接口. b) 一般步骤: i.加载驱动程序 ii.获得数据 ...

  10. json的省市联动

    1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 < ...