E2E测试之Headless browser容器化
目的
- E2E测试执行过程中不依赖UI界面
- 可在*nix系统中运行
- 为什么不用
PhantomJS
,Protractor官方不推荐使用PhantomJS
来测试
We recommend against using PhantomJS for tests with Protractor. There are many reported issues with PhantomJS crashing and behaving differently from real browsers.
Docker
安装
- 下载系统所需要的安装包,下载地址:https://www.docker.com/products/docker
- 注册https://hub.docker.com/账号
- 使用
pull
来获取docker 镜像protractor-headless
,此过程会比较慢,耐心等待 docker hub地址:https://hub.docker.com/r/webnicer/protractor-headless/ git hub地址:https://github.com/jciolek/docker-protractor-headless
docker pull webnicer/protractor-headless
……