Skip to content

Commit 48f5552

Browse files
committed
Update rails, capybara, webdriver dependencies
Updates js error inspection to match more recent Selenium Webdriver API
1 parent 9267ca2 commit 48f5552

File tree

5 files changed

+130
-69
lines changed

5 files changed

+130
-69
lines changed

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
source "https://rubygems.org"
22

33
gem "rubocop", ">= 0.47", require: false
4-
gem "rails", "~> 5.2.0"
5-
gem "puma", "~> 4.0"
4+
gem "pry-byebug"
65

76
# Specify your gem's dependencies in webpacker-react.gemspec
87
gemspec

Gemfile.lock

Lines changed: 112 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,76 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
specs:
9-
actioncable (5.2.8.1)
10-
actionpack (= 5.2.8.1)
9+
actioncable (7.0.4)
10+
actionpack (= 7.0.4)
11+
activesupport (= 7.0.4)
1112
nio4r (~> 2.0)
1213
websocket-driver (>= 0.6.1)
13-
actionmailer (5.2.8.1)
14-
actionpack (= 5.2.8.1)
15-
actionview (= 5.2.8.1)
16-
activejob (= 5.2.8.1)
14+
actionmailbox (7.0.4)
15+
actionpack (= 7.0.4)
16+
activejob (= 7.0.4)
17+
activerecord (= 7.0.4)
18+
activestorage (= 7.0.4)
19+
activesupport (= 7.0.4)
20+
mail (>= 2.7.1)
21+
net-imap
22+
net-pop
23+
net-smtp
24+
actionmailer (7.0.4)
25+
actionpack (= 7.0.4)
26+
actionview (= 7.0.4)
27+
activejob (= 7.0.4)
28+
activesupport (= 7.0.4)
1729
mail (~> 2.5, >= 2.5.4)
30+
net-imap
31+
net-pop
32+
net-smtp
1833
rails-dom-testing (~> 2.0)
19-
actionpack (5.2.8.1)
20-
actionview (= 5.2.8.1)
21-
activesupport (= 5.2.8.1)
22-
rack (~> 2.0, >= 2.0.8)
34+
actionpack (7.0.4)
35+
actionview (= 7.0.4)
36+
activesupport (= 7.0.4)
37+
rack (~> 2.0, >= 2.2.0)
2338
rack-test (>= 0.6.3)
2439
rails-dom-testing (~> 2.0)
25-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
26-
actionview (5.2.8.1)
27-
activesupport (= 5.2.8.1)
40+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
41+
actiontext (7.0.4)
42+
actionpack (= 7.0.4)
43+
activerecord (= 7.0.4)
44+
activestorage (= 7.0.4)
45+
activesupport (= 7.0.4)
46+
globalid (>= 0.6.0)
47+
nokogiri (>= 1.8.5)
48+
actionview (7.0.4)
49+
activesupport (= 7.0.4)
2850
builder (~> 3.1)
2951
erubi (~> 1.4)
3052
rails-dom-testing (~> 2.0)
31-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
32-
activejob (5.2.8.1)
33-
activesupport (= 5.2.8.1)
53+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
54+
activejob (7.0.4)
55+
activesupport (= 7.0.4)
3456
globalid (>= 0.3.6)
35-
activemodel (5.2.8.1)
36-
activesupport (= 5.2.8.1)
37-
activerecord (5.2.8.1)
38-
activemodel (= 5.2.8.1)
39-
activesupport (= 5.2.8.1)
40-
arel (>= 9.0)
41-
activestorage (5.2.8.1)
42-
actionpack (= 5.2.8.1)
43-
activerecord (= 5.2.8.1)
44-
marcel (~> 1.0.0)
45-
activesupport (5.2.8.1)
57+
activemodel (7.0.4)
58+
activesupport (= 7.0.4)
59+
activerecord (7.0.4)
60+
activemodel (= 7.0.4)
61+
activesupport (= 7.0.4)
62+
activestorage (7.0.4)
63+
actionpack (= 7.0.4)
64+
activejob (= 7.0.4)
65+
activerecord (= 7.0.4)
66+
activesupport (= 7.0.4)
67+
marcel (~> 1.0)
68+
mini_mime (>= 1.1.0)
69+
activesupport (7.0.4)
4670
concurrent-ruby (~> 1.0, >= 1.0.2)
47-
i18n (>= 0.7, < 2)
48-
minitest (~> 5.1)
49-
tzinfo (~> 1.1)
71+
i18n (>= 1.6, < 2)
72+
minitest (>= 5.1)
73+
tzinfo (~> 2.0)
5074
addressable (2.8.1)
5175
public_suffix (>= 2.0.2, < 6.0)
52-
arel (9.0.0)
5376
ast (2.4.2)
5477
builder (3.2.4)
78+
byebug (11.1.3)
5579
capybara (3.37.1)
5680
addressable
5781
matrix
@@ -62,8 +86,10 @@ GEM
6286
regexp_parser (>= 1.5, < 3.0)
6387
xpath (~> 3.2)
6488
childprocess (4.1.0)
89+
coderay (1.1.3)
6590
concurrent-ruby (1.1.10)
6691
crass (1.0.6)
92+
digest (3.1.0)
6793
erubi (1.11.0)
6894
globalid (1.0.0)
6995
activesupport (>= 5.0)
@@ -81,46 +107,68 @@ GEM
81107
mini_mime (1.1.2)
82108
mini_portile2 (2.8.0)
83109
minitest (5.16.3)
110+
net-imap (0.2.3)
111+
digest
112+
net-protocol
113+
strscan
114+
net-pop (0.1.1)
115+
digest
116+
net-protocol
117+
timeout
118+
net-protocol (0.1.3)
119+
timeout
120+
net-smtp (0.3.1)
121+
digest
122+
net-protocol
123+
timeout
84124
nio4r (2.5.8)
85125
nokogiri (1.13.8)
86126
mini_portile2 (~> 2.8.0)
87127
racc (~> 1.4)
88128
parallel (1.22.1)
89129
parser (3.1.2.1)
90130
ast (~> 2.4.1)
131+
pry (0.14.1)
132+
coderay (~> 1.1)
133+
method_source (~> 1.0)
134+
pry-byebug (3.10.1)
135+
byebug (~> 11.0)
136+
pry (>= 0.13, < 0.15)
91137
public_suffix (5.0.0)
92-
puma (4.3.12)
138+
puma (5.6.5)
93139
nio4r (~> 2.0)
94140
racc (1.6.0)
95141
rack (2.2.4)
96142
rack-proxy (0.7.2)
97143
rack
98144
rack-test (2.0.2)
99145
rack (>= 1.3)
100-
rails (5.2.8.1)
101-
actioncable (= 5.2.8.1)
102-
actionmailer (= 5.2.8.1)
103-
actionpack (= 5.2.8.1)
104-
actionview (= 5.2.8.1)
105-
activejob (= 5.2.8.1)
106-
activemodel (= 5.2.8.1)
107-
activerecord (= 5.2.8.1)
108-
activestorage (= 5.2.8.1)
109-
activesupport (= 5.2.8.1)
110-
bundler (>= 1.3.0)
111-
railties (= 5.2.8.1)
112-
sprockets-rails (>= 2.0.0)
146+
rails (7.0.4)
147+
actioncable (= 7.0.4)
148+
actionmailbox (= 7.0.4)
149+
actionmailer (= 7.0.4)
150+
actionpack (= 7.0.4)
151+
actiontext (= 7.0.4)
152+
actionview (= 7.0.4)
153+
activejob (= 7.0.4)
154+
activemodel (= 7.0.4)
155+
activerecord (= 7.0.4)
156+
activestorage (= 7.0.4)
157+
activesupport (= 7.0.4)
158+
bundler (>= 1.15.0)
159+
railties (= 7.0.4)
113160
rails-dom-testing (2.0.3)
114161
activesupport (>= 4.2.0)
115162
nokogiri (>= 1.6)
116163
rails-html-sanitizer (1.4.3)
117164
loofah (~> 2.3)
118-
railties (5.2.8.1)
119-
actionpack (= 5.2.8.1)
120-
activesupport (= 5.2.8.1)
165+
railties (7.0.4)
166+
actionpack (= 7.0.4)
167+
activesupport (= 7.0.4)
121168
method_source
122-
rake (>= 0.8.7)
123-
thor (>= 0.19.0, < 2.0)
169+
rake (>= 12.2)
170+
thor (~> 1.0)
171+
zeitwerk (~> 2.5)
124172
rainbow (3.1.1)
125173
rake (13.0.6)
126174
regexp_parser (2.5.0)
@@ -152,11 +200,16 @@ GEM
152200
actionpack (>= 5.2)
153201
activesupport (>= 5.2)
154202
sprockets (>= 3.0.0)
203+
strscan (3.0.4)
155204
thor (1.2.1)
156-
thread_safe (0.3.6)
157-
tzinfo (1.2.10)
158-
thread_safe (~> 0.1)
205+
timeout (0.3.0)
206+
tzinfo (2.0.5)
207+
concurrent-ruby (~> 1.0)
159208
unicode-display_width (2.2.0)
209+
webdrivers (5.0.0)
210+
nokogiri (~> 1.6)
211+
rubyzip (>= 1.3.0)
212+
selenium-webdriver (~> 4.0)
160213
webpacker (5.4.3)
161214
activesupport (>= 5.2)
162215
rack-proxy (>= 0.6.1)
@@ -168,6 +221,7 @@ GEM
168221
websocket-extensions (0.1.5)
169222
xpath (3.2.0)
170223
nokogiri (~> 1.8)
224+
zeitwerk (2.6.0)
171225

172226
PLATFORMS
173227
ruby
@@ -176,11 +230,14 @@ DEPENDENCIES
176230
bundler
177231
capybara
178232
minitest
179-
puma (~> 4.0)
180-
rails (~> 5.2.0)
233+
pry-byebug
234+
puma
235+
rails
181236
rake
182237
rubocop (>= 0.47)
183238
selenium-webdriver
239+
sprockets-rails
240+
webdrivers
184241
webpacker
185242
webpacker-react!
186243

test/example_app/config/application.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# you've limited to :test, :development, or :production.
1717
Bundler.require(*Rails.groups)
1818

19+
require "webpacker"
20+
1921
module WebpackerReactExample
2022
class Application < Rails::Application
2123
# Settings in config/environments/* take precedence over those specified here.

test/test_helper.rb

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
require "minitest/autorun"
66
require "capybara/rails"
77

8-
require "selenium/webdriver"
8+
# Capybara.register_driver :headless_chrome do |app|
9+
# capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
10+
# chromeOptions: { args: %w(headless disable-gpu) }
11+
# )
912

10-
Capybara.register_driver :headless_chrome do |app|
11-
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
12-
chromeOptions: { args: %w(headless disable-gpu) }
13-
)
13+
# Capybara::Selenium::Driver.new app,
14+
# browser: :chrome,
15+
# desired_capabilities: capabilities
16+
# end
1417

15-
Capybara::Selenium::Driver.new app,
16-
browser: :chrome,
17-
desired_capabilities: capabilities
18-
end
19-
20-
Capybara.javascript_driver = :headless_chrome
18+
Capybara.javascript_driver = :selenium_chrome_headless
19+
Capybara.server = :puma, { Silent: true }
2120

2221
class ActionDispatch::IntegrationTest
2322
class DriverJSError < StandardError; end
@@ -48,7 +47,7 @@ def require_js
4847
end
4948

5049
def current_js_errors
51-
page.driver.browser.manage.logs.get(:browser)
50+
page.driver.browser.logs.get(:browser)
5251
.select { |e| e.level == "SEVERE" && message.present? }
5352
.map(&:message)
5453
.to_a

webpacker-react.gemspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Gem::Specification.new do |spec|
2424
spec.required_ruby_version = ">= 2.3.0"
2525

2626
spec.add_development_dependency "webpacker"
27+
spec.add_development_dependency "rails"
28+
spec.add_development_dependency "sprockets-rails"
29+
spec.add_development_dependency "webdrivers"
30+
spec.add_development_dependency "puma"
2731
spec.add_development_dependency "bundler"
2832
spec.add_development_dependency "rake"
2933
spec.add_development_dependency "minitest"

0 commit comments

Comments
 (0)