Skip to content

Add selenium to avoid loading issue in 'action_dispatch/system_test_case' #2165

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

Closed
wants to merge 11 commits into from

Conversation

benoittgt
Copy link
Member

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.

This error 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

Also I bump last Rubies

benoittgt and others added 11 commits August 24, 2019 15:41
…ase'

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
Prevent webdrivers from using `&.` method on unsupported ruby.
RVM doesn't provide old Ruby binaries for newer Ubuntu distributions.
Until it's fixed, we need to use old Ubuntu distributions in CI.
@benoittgt benoittgt force-pushed the fix_build_load_issue branch from 6f45f66 to c2e6d3e Compare August 24, 2019 13:41
@benoittgt
Copy link
Member Author

Will do all the change on #2160

@benoittgt benoittgt closed this Aug 24, 2019
@benoittgt benoittgt deleted the fix_build_load_issue branch August 24, 2019 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants