File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ group :test do
3434 gem "selenium-webdriver"
3535 gem "shoulda-matchers"
3636 gem "timecop"
37+ gem "webdrivers"
3738 gem "webmock"
3839 gem "xpath" , "3.2.0"
3940end
Original file line number Diff line number Diff line change 304304 unicorn (6.0.0 )
305305 kgio (~> 2.6 )
306306 raindrops (~> 0.7 )
307+ webdrivers (5.0.0 )
308+ nokogiri (~> 1.6 )
309+ rubyzip (>= 1.3.0 )
310+ selenium-webdriver (~> 4.0 )
307311 webmock (3.14.0 )
308312 addressable (>= 2.8.0 )
309313 crack (>= 0.3.2 )
@@ -352,6 +356,7 @@ DEPENDENCIES
352356 timecop
353357 uglifier
354358 unicorn
359+ webdrivers
355360 webmock
356361 xpath (= 3.2.0 )
357362 yard
Original file line number Diff line number Diff line change @@ -23,11 +23,6 @@ bundle exec rake db:setup dev:prime
2323# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
2424mkdir -p .git/safe
2525
26- if ! command -v chromedriver > /dev/null; then
27- printf ' chromedriver is not installed.\n'
28- printf ' See https://chromedriver.chromium.org for install instructions.\n'
29- fi
30-
3126# Only if this isn't CI
3227# if [ -z "$CI" ]; then
3328# fi
Original file line number Diff line number Diff line change 1- require "webmock/rspec"
2-
31# http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
42RSpec . configure do |config |
53 config . expect_with :rspec do |expectations |
1210
1311 config . order = :random
1412end
15-
16- WebMock . disable_net_connect! ( allow_localhost : true )
Original file line number Diff line number Diff line change 1+ require "webmock/rspec"
2+
3+ # Allow downloading webdrivers for Selenium
4+ driver_hosts = Webdrivers ::Common . subclasses .
5+ map { |driver | URI ( driver . base_url ) . host }
6+
7+ # Downloading the Firefox driver involves a redirect
8+ driver_hosts += [ "github-releases.githubusercontent.com" ]
9+
10+ # Additionally, avoid conflict with Selenium (localhost)
11+ WebMock . disable_net_connect! ( allow_localhost : true , allow : driver_hosts )
You can’t perform that action at this time.
0 commit comments