TravisCI上的Selenium with Headless Chrome(2016)

问题描述:

Chrome has now a native headless mode。我想将其设置为在没有Xvfb的情况下运行TravisCI上的Selenium测试。TravisCI上的Selenium with Headless Chrome(2016)

  • 是否有方便的TravisCI安装无头的Chrome二进制文件,因为大多数的食谱只能从源头

  • 是否硒需要任何特定的提示编译无头Chrome中的无头铬

使用时启动

特拉维斯提供usage of the chrome add-on。如果你想在Linux上运行你的构建(可信赖),你需要做的就是在你的travis文件中指定chrome并在开始测试之前以无头模式启动浏览器。

dist: trusty 
addons: 
    chrome: stable 
before_install: 
    - # start your web application and listen on `localhost` 
    - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &