配置这个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. 每天一道leetcode141-环形链表

    考试结束,班级平均分只拿到了年级第二,班主任于是问道:大家都知道世界第一高峰珠穆朗玛峰,有人知道世界第二高峰是什么吗?正当班主任要继续发话,只听到角落默默想起来一个声音:”乔戈里峰” 前言 2018. ...

  2. IOS项目之弹出动画终结篇

    在之前写过IOS项目之弹出动画一.IOS项目之弹出动画二.IOS项目之弹出动画三,今天来一个终极封装已经上传到Github上弹出动画总结篇UIPopoverTableView. UIPopoverTa ...

  3. 什么是SSH

    SSH不仅实现了视图.控制器与模型的彻底分离,而且还实现了业务逻辑层与持久层的分离,耦合度降低,系统的灵活性更好,可复用性高 官方的说法:SSH是 struts+spring+hibernate的一个 ...

  4. C# List用Lambda表达式排序

    降序: lstroot.Sort((x,y)=>y.static_count.CompareTo(x.static_count)); 升序: lstroot.Sort((x,y)=>x.s ...

  5. VS中特殊的注释——TODO/UNDONE/HACK的使用

    在代码的后面添加形如下面注释: //TODO: (未实现)…… //UNDONE:(没有做完)…… //HACK:(修改)…… 等到再次打开VS的时候,找到 :视图>任务列表 即可显示所有带有T ...

  6. MySql的隔离级别总结

    使用MySql也有一段时间了,但是很多MySql相关或者说是数据库相关的知识还是一知半解,最近在学hibernate这个框架时碰到挺多和数据库相关的知识盲区,所以下面根据自己对MySql系统相关知识消 ...

  7. 二、hdfs单节点安装

    一.准备环境 在配置hdfs之前,我们需要先安装好hadoop的配置,本文主要讲述hdfs单节点的安装配置. hadoop的单节点安装配置请参考:https://www.cnblogs.com/lay ...

  8. 深入理解Java虚拟机---类加载机制(简略版)

    类加载机制 谈起类加载机制,在这里说个题外话,当初本人在学了两三个月的Java后,只了解了一些皮毛知识,就屁颠屁颠得去附近学校的招聘会去蹭蹭面试经验,和HR聊了一会后开始了技术面试,前抛出了两个简单的 ...

  9. ES6学习笔记(二)-字符串的扩展

    一.字符的 Unicode 表示法 JavaScript 允许采用\uxxxx形式表示一个字符,其中xxxx表示字符的 Unicode 码点. 表示法只限于码点在\u0000~\uFFFF之间的字符, ...

  10. BZOJ3600:没有人的算术

    传送门 如果能给每个 \(pair\) 按照权值编号就好了 假设之前已经有了所有的权值的编号,现在考虑编号新的 \(pair\) 如果看过了陈立杰的论文的话,不难得到一个重量平衡树的做法 给树上每个子 ...