Closed DeeDeeG closed 6 years ago
Filed an issue upstream at the Poltergeist repo in case this might be a genuine bug in Poltergeist: https://github.com/teampoltergeist/poltergeist/issues/917
Comment in the upstream issue:
If you run it with selenium
as the driver you can see the same things happens, and see the browser is waiting for a request from csi.gstatic.com
. The issue appears to be that the map display hangs requesting resources to populate the iframe it adds to the page. You can get the tests to run (some fail) by configuring the driver to ignore JS errors and blacklist googleapis.com
-
Capybara::Poltergeist::Driver.new(app,
:js_errors => false,
url_blacklist: ['googleapis.com']
)
This means you won't actually be able to test anything relating to the map, but I'm not sure what else can be done if the map display just hangs.
So, this probably isn't a Poltergeist or PhantomJS bug; it happens even with Selenium, which I think uses Firefox. (In any case, Selenium has nothing to do with Poltergeist.)
This looks like a problem on the Maps API side. Maybe our maps API quota is being maxed out? Or some other issue with GMaps?
Thanks @DeeDeeG that's a huge help! I think I'm going to disable those tests for now in favor of having all tests run, and we can create an issue about map tests.
Actually, this is hanging in production too, so I'll try to figure out what's up.
This is fixed here: https://github.com/RefugeRestrooms/refugerestrooms/pull/457
Just stopped using the experimental version of the maps API
Fix is now deployed
Starting this issue to track efforts to solve this problem.
Routes to solve the problem:
Tweak tons of small things, see if any of them fix the failing tests
Switch away from Poltergeist for another headless browser
Switching away from Poltergeist is supposed to be pretty easy, and should not require re-writing any tests. Capybara abstracts away all browser capabilities, and since we use Capybara, we should be able to easily swap out any headless browser compatible with Capybara.
Past attempts to fix this: