-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Can't run RSpec system specs without Chrome installed, even specifying Rack::Test explicitly #37410
Comments
sinsoku
added a commit
to sinsoku/rails
that referenced
this issue
Oct 15, 2019
If you require "action_dispatch/system_test_case", the driven_by method will be executed immediately. * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_test_case.rb#L162 Then the preload method is called in SystemTesting::Driver#initialize. * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_testing/driver.rb#L13 * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_testing/browser.rb#L46-L63 Therefore, a "Webdrivers::BrowserNotFound" error occurs in the browser preloading when you run system tests witout Chrome. This commit avoid the error by lazy configuring the driver. ref: rails#37410
There are two causes of this issue.
I fixed driver configuration to be lazy for #37476 and rspec/rspec-rails#2188. |
Mr0grog
added a commit
to edgi-govdata-archiving/web-monitoring-db
that referenced
this issue
Nov 1, 2019
We don't use Selenium at all, but Rails 6 requires it from the get-go no matter what. See this change: rails/rails@b21ef26 I think we're basically hitting a flavor of this issue: rails/rails#37410 ...and fixes are still pending.
Mr0grog
added a commit
to edgi-govdata-archiving/web-monitoring-db
that referenced
this issue
Nov 18, 2019
We don't use Selenium at all, but Rails 6 requires it from the get-go no matter what. See this change: rails/rails@b21ef26 I think we're basically hitting a flavor of this issue: rails/rails#37410 ...and fixes are still pending.
sinsoku
added a commit
to sinsoku/rails
that referenced
this issue
Nov 20, 2019
If users specify `driven_by(:rack_test)`, it uses Chrome by default arguments. However, `Rack::Test` does not use a browser and does not need to be preloaded. Furthermore, it occurs `Webdrivers::BrowserNotFound` when run in a container (or a machine) without Chrome. ref: rails#37410
y-yagi
pushed a commit
that referenced
this issue
Nov 20, 2019
* Allow system tests using Rack::Test to run without Chrome If you require "action_dispatch/system_test_case", the driven_by method will be executed immediately. * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_test_case.rb#L162 Then the preload method is called in SystemTesting::Driver#initialize. * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_testing/driver.rb#L13 * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_testing/browser.rb#L46-L63 Therefore, a "Webdrivers::BrowserNotFound" error occurs in the browser preloading when you run system tests witout Chrome. This commit avoid the error by lazy configuring the driver. ref: #37410 * Don't preload the browser with :rack_test If users specify `driven_by(:rack_test)`, it uses Chrome by default arguments. However, `Rack::Test` does not use a browser and does not need to be preloaded. Furthermore, it occurs `Webdrivers::BrowserNotFound` when run in a container (or a machine) without Chrome.
Fixed by #37476. |
I just wanted to mention here that I have similar problem, only that it works fine locally but chrome is required for rack_test when it is running on @circleci |
y-yagi
pushed a commit
that referenced
this issue
Feb 23, 2020
* Allow system tests using Rack::Test to run without Chrome If you require "action_dispatch/system_test_case", the driven_by method will be executed immediately. * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_test_case.rb#L162 Then the preload method is called in SystemTesting::Driver#initialize. * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_testing/driver.rb#L13 * https://github.com/rails/rails/blob/v6.0.0/actionpack/lib/action_dispatch/system_testing/browser.rb#L46-L63 Therefore, a "Webdrivers::BrowserNotFound" error occurs in the browser preloading when you run system tests witout Chrome. This commit avoid the error by lazy configuring the driver. ref: #37410 * Don't preload the browser with :rack_test If users specify `driven_by(:rack_test)`, it uses Chrome by default arguments. However, `Rack::Test` does not use a browser and does not need to be preloaded. Furthermore, it occurs `Webdrivers::BrowserNotFound` when run in a container (or a machine) without Chrome.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RSpec tests configured to run with
Rack::Test
can't be run in a container (or on a machine) without Chrome, becauseActiveSupport::TestCase
tries to load Chrome as soon as it's required, resulting inWebdrivers::BrowserNotFound
.Steps to reproduce
Clone the repository: dmolesUC/rack_test_rails_6, consisting of a minimal Rails 6 app with one RSpec-based system test, configured to run with
Rack::Test
.Following the instructions in the README, stand up a Docker stack and attempt to run the specs.
docker-compose up --pull && \ docker-compose run --rm rails spec
Expected behavior
Spec runs with Rack::Test.
Actual behavior
Spec can't even be loaded, and fail with the following error:
System configuration
Rails version: 6.0.0
Ruby version: 2.6.4
The text was updated successfully, but these errors were encountered: