Running chromedriver on Travis CI

Hi guys,
did any of you manage to force TravisCI (or CircleCI or anything) to work with Phoenix + Hound via chromedriver? (I can’t use phantomjs, if you ask). Travis documentation is not very helpful in this topic, and I am getting errors that webdriver is not running.

Of course all tests works on the local machine.

1 Like

I will reply to myself, maybe someone will need it in a future. Below is the working travis config for Drab:

language: elixir
dist: trusty
addons:
  chrome: stable
install:
  - mix local.hex --force
  - mix local.rebar --force
  - mix deps.get
  - npm install && node_modules/brunch/bin/brunch build --production
  - mix compile
  - mix phx.digest
before_install:
 - sudo apt-get update
 - sudo apt-get install chromium-chromedriver

elixir:
  - 1.6.0
otp_release:
  - 20.0

env:
  - MIX_ENV=test

before_script:
  - export PATH=$PATH:/usr/lib/chromium-browser/
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - sleep 3 # give xvfb some time to start
  - nohup chromedriver &

script: mix test

after_script:
  - cd $TRAVIS_BUILD_DIR
  - MIX_ENV=docs mix inch.report
3 Likes