-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use headless Chrome for browser tests #447
Conversation
This reverts commit 2194899.
Capybara-webkit does not currently support ES6 syntax. Headless chrome appears to require full file paths.
I like option (2) and I think it'd keep techops happy as well. Ben and I discussed a related issue to this the other day, which was rendering PDFs from a headless chrome process running in a separate container. He was concerned about xvfb being included in the app container so I think if we add chromium too there'll be the same concern and we'll eventually need to pull it out. The tests for supporters.eff.org work this way and we have a Dockerfile for chrome headless in kittens at tests/Dockerfile.google-chrome. For problem (1) -- I'm not sure whether you tried it but when I was working on the PDF issue I used the chromedriver-helper gem to install chromedriver and that seemed to work well. |
Runs chrome with the --no-sandbox flag in order to pass tests in Travis, as mentioned in travis-ci/travis-ci#8836 (comment) The additional changes to spec/rails_helper.rb in this commit are just to reproduce the behavior of the predefined :selenium_chrome_headless driver.
The chromdriver-helper gem is nice. I switched it in for tests run on the host and on Travis, thanks! It doesn't work within the Alpine container for the reason described here: flavorjones/chromedriver-helper#48 (comment) I'd like to revisit Docker support as a separate ticket. |
Loading the
react
andreact-ujs
packages requires loading ES6 syntax, which isn't supported by our current webdriver (capybara-webpack) or the one we're using on the Action Center (poltergeist). This PR switches SEC to use headless Chrome, which would allow us to write JS tests for the admin interface (ex #198) and add React to the user-facing site without breaking the existing JS tests.This is working smoothly except within Docker, where there are two problems
Options I see are