Skip to content

Update gems, RoR to 10.1.4 #435

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 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.4.1
ruby-2.4.3
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language:
- ruby
rvm:
- 2.4.1
- 2.4.3
sudo: false
notifications:
slack: shakacode:YvfXbuFMcFAHt6ZjABIs0KET
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
ruby "2.4.1"
ruby "2.4.3"

gem "react_on_rails", "10.0.2"
gem "react_on_rails", "10.1.4"
gem "webpacker"

# Bundle edge Rails instead: gem "rails", github: "rails/rails"
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ GEM
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rdoc (4.3.0)
react_on_rails (10.0.2)
react_on_rails (10.1.4)
addressable
connection_pool
execjs (~> 2.5)
Expand Down Expand Up @@ -358,7 +358,7 @@ DEPENDENCIES
rails-html-sanitizer
rails_best_practices
rainbow
react_on_rails (= 10.0.2)
react_on_rails (= 10.1.4)
redis (= 3.3.3)
rspec-rails (= 3.6.1)
rspec-retry
Expand All @@ -375,7 +375,7 @@ DEPENDENCIES
webpacker

RUBY VERSION
ruby 2.4.1p111
ruby 2.4.3p205

BUNDLED WITH
1.16.0
1.16.1
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"react-bootstrap": "^0.31.5",
"react-dom": "^16.1.1",
"react-intl": "^2.4.0",
"react-on-rails": "^10.0.2",
"react-on-rails": "^10.1.4",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
Expand Down
6 changes: 3 additions & 3 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5294,9 +5294,9 @@ react-intl@^2.4.0:
intl-relativeformat "^2.0.0"
invariant "^2.1.1"

react-on-rails@^10.0.2:
version "10.0.2"
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-10.0.2.tgz#4d17b9e1df403ad3ff013f36654957051761c35a"
react-on-rails@^10.1.4:
version "10.1.4"
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-10.1.4.tgz#50e1b7596928746cff2ef90c00adb8e7cd41fe98"

react-overlays@^0.7.4:
version "0.7.4"
Expand Down
8 changes: 4 additions & 4 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
# Using errors_ok as there is a timing issue causing crashes without this setting
# https://github.com/teampoltergeist/poltergeist/issues/830

default_driver = :selenium_chrome
default_driver = :selenium_chrome_headless

supported_drivers = %i[ poltergeist poltergeist_errors_ok
poltergeist_no_animations webkit
selenium_chrome selenium_firefox selenium]
selenium_chrome selenium_chrome_headless selenium_firefox selenium]
driver = ENV["DRIVER"].try(:to_sym) || default_driver
Capybara.default_driver = driver

Expand Down Expand Up @@ -95,7 +95,7 @@
js_driver.render(path, full: true)
end

when :selenium_chrome
when :selenium_chrome, :selenium_chrome_headless
DriverRegistration.register_selenium_chrome
when :selenium_firefox, :selenium
DriverRegistration.register_selenium_firefox
Expand Down Expand Up @@ -185,7 +185,7 @@ def js_errors_driver
end

def js_selenium_driver
driver = Capybara.javascript_driver == :selenium_firefox ? :selenium_firefox : :selenium_chrome
driver = Capybara.javascript_driver == :selenium_firefox ? :selenium_firefox : :selenium_chrome_headless
if driver == :selenium_firefox
DriverRegistration.register_selenium_firefox
else
Expand Down
11 changes: 10 additions & 1 deletion spec/support/driver_registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ module DriverRegistration
def self.register_selenium_chrome
return if @selenium_chrome_registered
Capybara.register_driver :selenium_chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
Capybara::Selenium::Driver.new(app,
browser: :chrome)
end
Capybara.register_driver :selenium_chrome_headless do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w[headless disable-gpu] }
)
Capybara::Selenium::Driver.new(app,
browser: :chrome,
desired_capabilities: capabilities)
end
Capybara::Screenshot.register_driver(:selenium_chrome) do |js_driver, path|
js_driver.browser.save_screenshot(path)
Expand Down
92 changes: 0 additions & 92 deletions spec/support/poltergeist.rb

This file was deleted.

48 changes: 48 additions & 0 deletions spec/support/selenium_logger.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
RSpec.configure do |config|
config.after(:each, :js) do
next unless [:selenium_chrome, :selenium_chrome_headless].include?(Capybara.current_driver)

errors = []

page.driver.browser.manage.logs.get(:browser).each do |entry|
next if entry.message =~ /Download the React DevTools for a better development experience/

# Chrome doesn't allow suppressing log entries for network responses with statuses >= 400 (even if this is valid
# api behaviour) and always show them in log as SEVERE errors prior to any js error resolving. Some info here:
# https://bugs.chromium.org/p/chromium/issues/detail?id=677599
# https://bugs.chromium.org/p/chromium/issues/detail?id=124534
# https://bugs.chromium.org/p/chromium/issues/detail?id=96212
# This doesn't skips unhandled js errors which should be properly catched
next if @skipped_chrome_network_errors&.any? do |e|
entry.message.include? \
"#{e[:path]} - Failed to load resource: the server responded with a status of #{e[:status]}"
end

# needs external mock server for selenium
if entry.message =~ /res.cloudinary.com/
puts entry.message
next
end

# several places SLV
if entry.message =~ /"Warning: Text content did not match. Server: \\"1000\\" Client: \\"1,000\\""/
puts entry.message
next
end

pretty_message = if entry.message =~ %r{http://(127.0.0.1|app.lvh.me)[^ ]+ [\d:]+ }
entry.message[/[^ ]+ [^ ]+ (.*)$/, 1]&.gsub(/\A"|"\Z/, "")&.gsub(/\\n/, "\n")
else
entry.message
end

%w[DEBUG INFO WARNING].include?(entry.level) ? puts(pretty_message) : errors << pretty_message
end

page.driver.browser.manage.logs.get(:driver).each do |entry|
%w[DEBUG INFO WARNING].include?(entry.level) ? puts(entry.message) : errors << entry.message
end

raise("Java Script Error(s) on the page:\n\n" + errors.join("\n")) if errors.present?
end
end