From b434e6a22d210f196ea4ac83f92c1dd5a14a912c Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 16 Oct 2019 12:36:18 +0300 Subject: [PATCH 1/7] Do not load `capybara` gem in development --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 0afebca97..0e53cdb60 100644 --- a/Gemfile +++ b/Gemfile @@ -86,7 +86,6 @@ group :development do end group :development, :test do - gem 'capybara' gem 'selenium-webdriver' # debug @@ -100,6 +99,7 @@ group :development, :test do end group :test do + gem 'capybara' gem 'database_cleaner' gem 'simplecov', require: false gem 'webmock' From 041b63e8b6028082b3c1d8fa89af07f94eb2386c Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 16 Oct 2019 12:39:43 +0300 Subject: [PATCH 2/7] Replace `selenium-webdriver` gem with `webdrivers` --- Gemfile | 4 +--- Gemfile.lock | 17 ++++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 0e53cdb60..a58648a1c 100644 --- a/Gemfile +++ b/Gemfile @@ -86,9 +86,6 @@ group :development do end group :development, :test do - gem 'selenium-webdriver' - - # debug gem 'pry', '0.10.1' gem 'bullet', '4.14.7' # for finding database optimizations @@ -102,5 +99,6 @@ group :test do gem 'capybara' gem 'database_cleaner' gem 'simplecov', require: false + gem 'webdrivers' gem 'webmock' end diff --git a/Gemfile.lock b/Gemfile.lock index 8c140d0f0..0c83297e7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -131,8 +131,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - childprocess (0.9.0) - ffi (~> 1.0, >= 1.0.11) + childprocess (3.0.0) chronic (0.10.2) coderay (1.1.0) coercible (1.0.0) @@ -332,7 +331,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.6.0) rspec-support (3.6.0) - rubyzip (1.3.0) + rubyzip (2.0.0) safe_yaml (1.0.5) sass (3.4.23) sass-rails (5.0.6) @@ -358,9 +357,9 @@ GEM select2-rails (3.5.9.3) thor (~> 0.14) selectize-rails (0.12.1) - selenium-webdriver (3.13.0) - childprocess (~> 0.5) - rubyzip (~> 1.2) + selenium-webdriver (3.142.6) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) simplecov (0.16.1) docile (~> 1.1) json (>= 1.8, < 3) @@ -406,6 +405,10 @@ GEM wasabi (3.5.0) httpi (~> 2.0) nokogiri (>= 1.4.2) + webdrivers (4.1.3) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (>= 3.0, < 4.0) webmock (3.6.0) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -467,12 +470,12 @@ DEPENDENCIES sdoc (= 0.4.1) select2-rails (= 3.5.9.3) selectize-rails (= 0.12.1) - selenium-webdriver simplecov simpleidn (= 0.0.7) uglifier uuidtools (= 2.1.5) validates_email_format_of (= 1.6.3) + webdrivers webmock whenever (= 0.9.4) From d8acd998793c23a5441d01693e5991a9754c2a53 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 16 Oct 2019 12:47:50 +0300 Subject: [PATCH 3/7] Use block variable --- test/application_system_test_case.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index ea3b6dff5..743138b63 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -20,7 +20,7 @@ class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase self.use_transactional_fixtures = false DatabaseCleaner.strategy = :truncation - Capybara.register_driver(:chrome) do |_app| + Capybara.register_driver(:chrome) do |app| options = ::Selenium::WebDriver::Chrome::Options.new options.add_argument('--headless') @@ -28,7 +28,7 @@ class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase options.add_argument('--disable-dev-shm-usage') options.add_argument('--window-size=1400,1400') - Capybara::Selenium::Driver.new(Rails.application, browser: :chrome, options: options) + Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) end Capybara.register_server(:silent_puma) do |app, port, _host| From 42c574746c7457ac888715222603e0b3a751cfdc Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 16 Oct 2019 12:50:30 +0300 Subject: [PATCH 4/7] Simplify Puma config --- test/application_system_test_case.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 743138b63..036ecd382 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -31,10 +31,7 @@ class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) end - Capybara.register_server(:silent_puma) do |app, port, _host| - require 'rack/handler/puma' - Rack::Handler::Puma.run(app, Port: port, Threads: '0:2', Silent: true) - end + Capybara.server = :puma, { Silent: true } def setup DatabaseCleaner.start @@ -42,7 +39,6 @@ class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase super Capybara.current_driver = :chrome - Capybara.server = :silent_puma end def teardown From e7832e621860d2cbc27a0cc2deea3a5726ca8d06 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 16 Oct 2019 12:57:41 +0300 Subject: [PATCH 5/7] Update `capybara` gem --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0c83297e7..cc5b8d976 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,8 +94,8 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) airbrake (9.4.3) airbrake-ruby (~> 4.6) airbrake-ruby (4.6.0) @@ -123,7 +123,7 @@ GEM activesupport (>= 3.0.0) uniform_notifier (~> 1.9.0) cancancan (3.0.1) - capybara (3.22.0) + capybara (3.29.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) @@ -259,7 +259,7 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - public_suffix (3.1.0) + public_suffix (4.0.1) puma (3.12.1) que (0.10.0) que-web (0.4.0) @@ -308,7 +308,7 @@ GEM i18n rbtree3 (0.5.0) rdoc (4.3.0) - regexp_parser (1.5.1) + regexp_parser (1.6.0) request_store (1.4.1) rack (>= 1.4) responders (2.4.1) From a25943bdf807fdc6adf1c67a001d6144a2c0e588 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 16 Oct 2019 13:00:14 +0300 Subject: [PATCH 6/7] Update `simplecov` gem --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index cc5b8d976..1322c108d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -167,7 +167,7 @@ GEM responders warden (~> 1.2.3) diff-lcs (1.3) - docile (1.3.1) + docile (1.3.2) domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) equalizer (0.0.11) @@ -360,7 +360,7 @@ GEM selenium-webdriver (3.142.6) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) - simplecov (0.16.1) + simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) From 51926bcc36e9c4d012bc9726b8f27e4d421ff9b4 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 16 Oct 2019 13:01:58 +0300 Subject: [PATCH 7/7] Update `puma` gem --- Gemfile.lock | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1322c108d..cc822dab7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -244,6 +244,7 @@ GEM mustermann-grape (1.0.0) mustermann (~> 1.0.0) netrc (0.11.0) + nio4r (2.5.2) nokogiri (1.10.4) mini_portile2 (~> 2.4.0) nori (2.6.0) @@ -260,7 +261,8 @@ GEM method_source (~> 0.8.1) slop (~> 3.4) public_suffix (4.0.1) - puma (3.12.1) + puma (4.2.1) + nio4r (~> 2.0) que (0.10.0) que-web (0.4.0) erubis