We were having some tests flake when using chrome and chromedriver. For example,
spec/system/pages_spec.rb was often failing with:
Failure/Error: visit root_path
Net::ReadTimeout:
Net::ReadTimeout with #<TCPSocket:(closed)>
This is a bug in chrome/chromedriver, documented here in the capybara repo:
https://github.com/teamcapybara/capybara/issues/2770
I also tried cuprite, but something between it and
capybara_accessible_selectors is incompatible. I'd rather use Firefox instead of giving up capybara_accessible_selectors.
Switching to firefox/geckodriver as the browser to test with, I was unable to
get the same test to fail, whereas with chrome it would fail pretty easily
(maybe 50% of the time or more).
Two changes were needed to use firefox. First, date inputs are in the format of
yyyy-mm-dd not mm-dd-yyyy. Second, times don't have AM/PM; e.g. 06:30 instead
of 06:30AM.
I also ignored a deprecation warning that capybara has yet to fix to prevent
lots of warnings while running tests:
https://github.com/teamcapybara/capybara/issues/2779#issuecomment-2493919716
We were having some tests flake when using chrome and chromedriver. For example,
spec/system/pages_spec.rb was often failing with:
```
Failure/Error: visit root_path
Net::ReadTimeout:
Net::ReadTimeout with #<TCPSocket:(closed)>
```
This is a bug in chrome/chromedriver, documented here in the capybara repo:
https://github.com/teamcapybara/capybara/issues/2770
I also tried [cuprite](https://github.com/rubycdp/cuprite), but something between it and
[capybara_accessible_selectors](https://github.com/citizensadvice/capybara_accessible_selectors) is incompatible. I'd rather use Firefox instead of giving up capybara_accessible_selectors.
Switching to firefox/geckodriver as the browser to test with, I was unable to
get the same test to fail, whereas with chrome it would fail pretty easily
(maybe 50% of the time or more).
Two changes were needed to use firefox. First, date inputs are in the format of
yyyy-mm-dd not mm-dd-yyyy. Second, times don't have AM/PM; e.g. `06:30` instead
of `06:30AM`.
I also ignored a deprecation warning that capybara has yet to fix to prevent
lots of warnings while running tests:
https://github.com/teamcapybara/capybara/issues/2779#issuecomment-2493919716