Skip to content

Commit

Permalink
test: replace cuprite with selenium
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Roccoberton committed Jul 7, 2024
1 parent 255e188 commit 33b1d8e
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 81 deletions.
1 change: 0 additions & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ appraise 'rails60-administrate' do # latest administrate
gem 'psych', '~> 3.0'
gem 'rails', '~> 6.0.0'
gem 'ransack', '~> 2.3'
gem "selenium-webdriver", "4.1.0", require: false # Fix
gem 'sqlite3', '~> 1.3'
end

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ group :development, :test do

# Testing
gem 'capybara'
gem 'cuprite'
gem 'rails-controller-testing'
gem 'rspec_junit_formatter'
gem 'rspec-rails'
gem 'selenium-webdriver'

# Linters
gem 'fasterer'
Expand Down
3 changes: 1 addition & 2 deletions gemfiles/rails60_administrate.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ gem "ffi", "1.15.5"
gem "psych", "~> 3.0"
gem "rails", "~> 6.0.0"
gem "ransack", "~> 2.3"
gem "selenium-webdriver", "4.1.0", require: false
gem "sqlite3", "~> 1.3"

group :development, :test do
gem "appraisal"
gem "puma"
gem "capybara"
gem "cuprite"
gem "rails-controller-testing"
gem "rspec_junit_formatter"
gem "rspec-rails"
gem "selenium-webdriver"
gem "fasterer"
gem "rubocop"
gem "rubocop-packaging"
Expand Down
12 changes: 1 addition & 11 deletions gemfiles/rails60_administrate.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,11 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.3.3)
crass (1.0.6)
cuprite (0.15.1)
capybara (~> 3.0)
ferrum (~> 0.15.0)
date (3.3.4)
diff-lcs (1.5.1)
erubi (1.13.0)
fasterer (0.11.0)
ruby_parser (>= 3.19.1)
ferrum (0.15)
addressable (~> 2.5)
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (~> 0.7)
ffi (1.15.5)
globalid (1.1.0)
activesupport (>= 5.0)
Expand Down Expand Up @@ -305,7 +297,6 @@ GEM
tzinfo (1.2.11)
thread_safe (~> 0.1)
unicode-display_width (2.5.0)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -325,7 +316,6 @@ DEPENDENCIES
administrate_ransack!
appraisal
capybara
cuprite
fasterer
ffi (= 1.15.5)
pry-rails
Expand All @@ -341,7 +331,7 @@ DEPENDENCIES
rubocop-performance
rubocop-rails
rubocop-rspec
selenium-webdriver (= 4.1.0)
selenium-webdriver
sqlite3 (~> 1.3)

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails61_administrate.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ group :development, :test do
gem "appraisal"
gem "puma"
gem "capybara"
gem "cuprite"
gem "rails-controller-testing"
gem "rspec_junit_formatter"
gem "rspec-rails"
gem "selenium-webdriver"
gem "fasterer"
gem "rubocop"
gem "rubocop-packaging"
Expand Down
21 changes: 11 additions & 10 deletions gemfiles/rails61_administrate.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ GEM
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
builder (3.3.0)
capybara (3.40.0)
addressable
Expand All @@ -95,19 +96,11 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.3.3)
crass (1.0.6)
cuprite (0.15.1)
capybara (~> 3.0)
ferrum (~> 0.15.0)
date (3.3.4)
diff-lcs (1.5.1)
erubi (1.13.0)
fasterer (0.11.0)
ruby_parser (>= 3.19.1)
ferrum (0.15)
addressable (~> 2.5)
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (~> 0.7)
ffi (1.15.5)
globalid (1.2.1)
activesupport (>= 6.1)
Expand All @@ -131,6 +124,7 @@ GEM
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
logger (1.6.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -271,6 +265,7 @@ GEM
ruby_parser (3.21.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
Expand All @@ -280,6 +275,12 @@ GEM
sprockets-rails
tilt
selectize-rails (0.12.6)
selenium-webdriver (4.22.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sexp_processor (4.17.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
Expand All @@ -301,7 +302,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -321,7 +322,6 @@ DEPENDENCIES
administrate_ransack!
appraisal
capybara
cuprite
fasterer
ffi (= 1.15.5)
pry-rails
Expand All @@ -336,6 +336,7 @@ DEPENDENCIES
rubocop-performance
rubocop-rails
rubocop-rspec
selenium-webdriver
sqlite3 (~> 1.3)

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails70_administrate.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ group :development, :test do
gem "appraisal"
gem "puma"
gem "capybara"
gem "cuprite"
gem "rails-controller-testing"
gem "rspec_junit_formatter"
gem "rspec-rails"
gem "selenium-webdriver"
gem "fasterer"
gem "rubocop"
gem "rubocop-packaging"
Expand Down
21 changes: 11 additions & 10 deletions gemfiles/rails70_administrate.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ GEM
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
builder (3.3.0)
capybara (3.40.0)
addressable
Expand All @@ -101,19 +102,11 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.3.3)
crass (1.0.6)
cuprite (0.15.1)
capybara (~> 3.0)
ferrum (~> 0.15.0)
date (3.3.4)
diff-lcs (1.5.1)
erubi (1.13.0)
fasterer (0.11.0)
ruby_parser (>= 3.19.1)
ferrum (0.15)
addressable (~> 2.5)
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (~> 0.7)
ffi (1.15.5)
globalid (1.2.1)
activesupport (>= 6.1)
Expand All @@ -137,6 +130,7 @@ GEM
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
logger (1.6.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -277,6 +271,7 @@ GEM
ruby_parser (3.21.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
Expand All @@ -286,6 +281,12 @@ GEM
sprockets-rails
tilt
selectize-rails (0.12.6)
selenium-webdriver (4.22.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sexp_processor (4.17.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
Expand All @@ -307,7 +308,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -327,7 +328,6 @@ DEPENDENCIES
administrate_ransack!
appraisal
capybara
cuprite
fasterer
ffi (= 1.15.5)
pry-rails
Expand All @@ -342,6 +342,7 @@ DEPENDENCIES
rubocop-performance
rubocop-rails
rubocop-rspec
selenium-webdriver
sqlite3 (~> 1.3)

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails71_administrate.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ group :development, :test do
gem "appraisal"
gem "puma"
gem "capybara"
gem "cuprite"
gem "rails-controller-testing"
gem "rspec_junit_formatter"
gem "rspec-rails"
gem "selenium-webdriver"
gem "fasterer"
gem "rubocop"
gem "rubocop-packaging"
Expand Down
19 changes: 10 additions & 9 deletions gemfiles/rails71_administrate.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,12 @@ GEM
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
crass (1.0.6)
cuprite (0.15.1)
capybara (~> 3.0)
ferrum (~> 0.15.0)
date (3.3.4)
diff-lcs (1.5.1)
drb (2.2.1)
erubi (1.13.0)
fasterer (0.11.0)
ruby_parser (>= 3.19.1)
ferrum (0.15)
addressable (~> 2.5)
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (~> 0.7)
ffi (1.15.5)
globalid (1.2.1)
activesupport (>= 6.1)
Expand Down Expand Up @@ -154,6 +146,7 @@ GEM
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
logger (1.6.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -307,6 +300,7 @@ GEM
ruby_parser (3.21.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
Expand All @@ -316,6 +310,12 @@ GEM
sprockets-rails
tilt
selectize-rails (0.12.6)
selenium-webdriver (4.22.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sexp_processor (4.17.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
Expand All @@ -339,6 +339,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -358,7 +359,6 @@ DEPENDENCIES
administrate_ransack!
appraisal
capybara
cuprite
fasterer
ffi (= 1.15.5)
pry-rails
Expand All @@ -373,6 +373,7 @@ DEPENDENCIES
rubocop-performance
rubocop-rails
rubocop-rspec
selenium-webdriver
sqlite3 (~> 1.3)

BUNDLED WITH
Expand Down
4 changes: 4 additions & 0 deletions spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ class Application < Rails::Application
if (Rails.gem_version >= Gem::Version.new("6.1") && Rails.gem_version < Gem::Version.new("7.1"))
config.active_record.legacy_connection_handling = false
end

if Rails.gem_version >= Gem::Version.new("7.0")
config.active_support.cache_format_version = 7.0
end
end
end
10 changes: 8 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

require 'rspec/rails'
require 'capybara/rails'
require 'selenium-webdriver'

Dir[File.expand_path('support/**/*.rb', __dir__)].sort.each { |f| require f }

# Force deprecations to raise an exception.

if (Rails.gem_version < Gem::Version.new("7.1"))
if Rails.gem_version < Gem::Version.new("7.1")
ActiveSupport::Deprecation.behavior = :raise
else
Rails.application.deprecators.behavior = :raise
Expand Down Expand Up @@ -45,7 +46,12 @@ def setup_data
end

RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
if Rails.gem_version < Gem::Version.new("7.1")
config.fixture_path = Rails.root.join('spec/fixtures').to_s
else
config.fixture_paths = [Rails.root.join('spec/fixtures').to_s]
end

config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!

Expand Down
Loading

0 comments on commit 33b1d8e

Please sign in to comment.