Rails アプリケーションのE2Eテストを書きました。
構成は Capybara + Selenium + Headless Chrome です。
このE2Eテストを Wercker で実行するために、
下記のスクリプトで Wercker に Chrome をインストールしました。
- script:
name: install chrome headless
code: |
apt-get update -y
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
apt-get update -y
apt-get install -y google-chrome-stable
注:
apt-get update
を実行時に下記のようなエラーがでることがあります。
Wercker のClear cache
を実行することで解消されます。
E: Release file for http://deb.debian.org/debian/dists/stretch-updates/InRelease is expired (invalid since 93d 8h 8min 57s). Updates for this repository will not be applied.
E: Release file for http://security.debian.org/dists/stretch/updates/InRelease is expired (invalid since 90d 6h 42min 53s). Updates for this repository will not be applied.
参考:
https://github.com/Quramy/angular-karma-chrome-headless-demo/blob/master/wercker.yml
@Quramy さん、ありがとうございます。