LoginSignup
1

More than 5 years have passed since last update.

Travis CI: しばらくの間、ヘッドレスChromeはbetaを指定したほうがいい

Last updated at Posted at 2018-03-08

追記 2018-09-14: 現在では、安定版のChromeでもエラーは出なくなりました。
下記のようにベータ版を使う必要はありません。


私は、Laravelで作った簡素なCRUDのテストをTravis CIで行っています。
:link: 関連記事: Laravel: TravisCIでテストしてCodecovでカバレッジを取得する

今日もコミットをGitHubへプッシュして、Travis CI上のヘッドレスChromeでブラウザテストを実行してもらっていたら、下記のようなエラーが。

TravisCIのログ
$ php artisan dusk

(中略)

There were 5 errors:
1) Tests\Browser\LoginTest::testLogin
Facebook\WebDriver\Exception\UnknownServerException: unknown error: call function result missing 'value'
  (Session info: headless chrome=65.0.3325.146)
  (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.4.0-101-generic x86_64)

call function result missing 'value'でググると、chromedriverのv2.35ならば解決するそうです。

:link: Stack Overflowの質問

Travis CIではどうすればいいのかと思いましたが、chromeアドオンのベータ版を利用することで解決しました。
:link: Travis CIの公式ドキュメント

.travis.yml
 dist: trusty # Linux環境
 addons:
-  chrome: stable
+  chrome: beta

(中略)

 script:
-  - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
+  - chrome --headless --disable-gpu --remote-debugging-port=9222 http://localhost &

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1