Skip to content

Commit 82dc1eb

Browse files
committed
Add selenium to avoid loading issue in 'action_dispatch/system_test_case'
On Rails 6 we add error in test suite like: ``` LoadError: cannot load such file -- selenium/webdriver System test integration requires Rails >= 5.1 and has a hard dependency on a webserver and `capybara`, please add capybara to your Gemfile and configure a webserver (e.g. `Capybara.server = :webrick`) before attempting to use system specs. ``` Thoses errors come from `lib/rspec/rails/example/system_example_group.rb#L51`: ``` 2.6.3 :002 > require 'action_dispatch/system_test_case' Traceback (most recent call last): 16: from /Users/bti/code/rspec-dev/repos/rspec-rails/spec/rspec/rails/example/system_example_group_spec.rb:11:in `block (4 levels) in <module:Rails>' 15: from /Users/bti/code/rspec-dev/repos/rspec-rails/spec/rspec/rails/example/system_example_group_spec.rb:11:in `include' 14: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/concern.rb:122:in `append_features' 13: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/concern.rb:122:in `class_eval' 12: from /Users/bti/code/rspec-dev/repos/rspec-rails/lib/rspec/rails/example/system_example_group.rb:50:in `block in <module:SystemExampleGroup>' 11: from <internal:prelude>:145:in `irb' 10: from (irb):2:in `block in <module:SystemExampleGroup>' 9: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require' 8: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency' 7: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require' 6: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require' 5: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.0/lib/action_dispatch/system_test_case.rb:7:in `<top (required)>' 4: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require' 3: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency' 2: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require' 1: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require' LoadError (cannot load such file -- selenium/webdriver) ``` This is probably related to: > rails/rails#36592 We need to load selenium-driver if we are in Rails 6
1 parent 17edc6a commit 82dc1eb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ end
3232

3333
if MAJOR >= 6
3434
gem 'sqlite3', '~> 1.4', platforms: [:ruby]
35+
gem 'selenium-webdriver', '~> 3.5', :require => false
3536
else
3637
gem 'sqlite3', '~> 1.3.6', platforms: [:ruby]
3738
end

0 commit comments

Comments
 (0)