【问题标题】:Selenium with Headless Chrome (2016) on TravisCITravisCI 上的 Selenium with Headless Chrome (2016)
【发布时间】:2017-03-04 18:33:10
【问题描述】:

Chrome has now a native headless mode。我想将其设置为在 TravisCI 上运行 Selenium 测试,无需 Xvfb。

  • 是否有容易在 TravisCI 上安装 Headless Chrome 二进制文件,因为大多数食谱只是从源代码编译 Headless Chrome 开始

  • Selenium 与 Headless Chrome 一起使用时是否需要任何特定提示

【问题讨论】:

    标签: google-chrome selenium travis-ci


    【解决方案1】:

    Travis 提供usage of the chrome add-on。如果你想在 Linux(trusty) 上运行你的构建,你所要做的就是在你的 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 &
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-22
      • 2020-04-16
      • 1970-01-01
      • 2018-07-15
      • 2017-12-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多