需要掌握的基础技术内容
- Java程序开发
- IntelliJ Idea使用
- Maven的配置与使用
- git与github 的配置与使用
- Rest-assured接口测试框架的使用
- Java + Selenium 自动化测试程序开发
- Java + Appium 自动化测试程序开发
- Jenkins Allure Report测试报告输出
- Jenkins JUnit Report测试报告输出
- Jenkins 基础使用技巧
环境准备
- 已搭建 Jenkins Server
- Java 运行环境
- Selenium 运行环境
- Appium 运行环境, 包括已搭建Appium Server 和 可运行的安卓模拟器或者实体机
- Android SDK环境
课堂项目工程
https://github.com/princeqjzh/iSelenium
https://github.com/princeqjzh/iAppium
https://github.com/princeqjzh/AndroidSampleApp
https://github.com/princeqjzh/iAppBVT
如何在Docker中运行Selenium自动测试持续集成
所用 Docker 镜像
- selenium/node-chrome-debug:3.7.1-beryllium
- selenium/hub:3.7.1-beryllium
启动Docker Container参考代码
- docker run -p 5555:4444 -d --name selenium_hub selenium/hub:3.7.1-beryllium
- docker run -P -d --name selenium_chrome --link selenium_hub:hub selenium/node-chrome-debug:3.7.1-beryllium
WebDriver 实例化参考代码
dockerRemote = “http://localhost:5555/wd/hub”
driver = new RemoteWebDriver(new URL(dockerRemote), DesiredCapabilities.chrome());
参考项目位置
- URL: https://github.com/princeqjzh/iSelenium
- 分支:docker
实现思路关键点
- 需要采用远程WebDriver形式运行Web UI自动化测试
- 远程WebDriver 服务运行在Docker Container中,每次运行自动化测试的时候动态启动
Jenkins 配置
- 项目Git repo 分支:docker
- currentBrowser 添加参数:docker
- 运行效果