Chromedriver on Travis-CI

前端 未结 3 1742
孤街浪徒
孤街浪徒 2021-02-01 18:53

I am having trouble getting chromedriver on Travis-CI working for my project knockout-secure-binding. I am trying to use WebdriverJS to automate testing with Chrome, at the leas

3条回答
  •  不知归路
    2021-02-01 19:25

    There's an easier way to launch Chrome on Travis CI, simply specify google-chrome in addons/apt/sources and google-chrome-package in addons/apt/packages.

    Here's my sample config for a better understanding:

    sudo: required
    dist: trusty
    addons:
      apt:
        sources:
          - google-chrome
        packages:
          - google-chrome-stable
    
    language: node_js
    node_js:
      - "6"
    cache:
      directories: node_modules
    branches:
      only: master
    
    before_script:
      - export DISPLAY=:99.0
      - sh -e /etc/init.d/xvfb start
      - npm i -g npm@^3
      - sleep 3
    

提交回复
热议问题