Skip to content
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

Revert "Merge pull request #2203 from tvdeyen/switch-to-cuprite" #2255

Merged
merged 1 commit into from
Mar 9, 2022
Merged
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
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,3 @@ group :development, :test do
gem "brakeman", require: false
end
end

# Necessary for system tests in Rails 6.0
if ENV["RAILS_VERSION"] == "6.0"
gem "selenium-webdriver"
end
2 changes: 1 addition & 1 deletion alchemy_cms.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ Gem::Specification.new do |gem|

gem.add_development_dependency "capybara", ["~> 3.0"]
gem.add_development_dependency "capybara-screenshot", ["~> 1.0"]
gem.add_development_dependency "cuprite", ["~> 0.13"]
gem.add_development_dependency "factory_bot_rails", ["~> 6.0"]
gem.add_development_dependency "puma", ["~> 5.0"]
gem.add_development_dependency "rails-controller-testing", ["~> 1.0"]
gem.add_development_dependency "rspec-activemodel-mocks", ["~> 1.0"]
gem.add_development_dependency "rspec-rails", [">= 4.0.0.beta2"]
gem.add_development_dependency "simplecov", ["~> 0.20"]
gem.add_development_dependency "webdrivers", ["~> 5.0"]
gem.add_development_dependency "webmock", ["~> 3.3"]
gem.add_development_dependency "shoulda-matchers", ["~> 5.0"]
gem.add_development_dependency "timecop", ["~> 0.9"]
Expand Down
20 changes: 12 additions & 8 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
require "rails-controller-testing"
require "rspec-activemodel-mocks"
require "rspec/rails"
require "webdrivers/chromedriver"
require "shoulda-matchers"
require "factory_bot"

Expand Down Expand Up @@ -46,17 +47,20 @@
# Configure capybara for integration testing
Capybara.default_selector = :css
Capybara.ignore_hidden_elements = false
Capybara.server = :puma

FactoryBot.definition_file_paths.append(Alchemy::TestSupport.factories_path)
FactoryBot.find_definitions

require "capybara/cuprite"
Capybara.register_driver(:cuprite) do |app|
Capybara::Cuprite::Driver.new(app, {
window_size: [1280, 800],
timeout: 10,
})
Capybara.register_driver :selenium_chrome_headless do |app|
Capybara::Selenium::Driver.load_selenium
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.args << "--headless"
opts.args << "--disable-gpu" if Gem.win_platform?
# Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
opts.args << "--disable-site-isolation-trials"
opts.args << "--window-size=1280,800"
end
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end

Shoulda::Matchers.configure do |config|
Expand Down Expand Up @@ -103,6 +107,6 @@
end

config.before(:each, type: :system, js: true) do
driven_by :cuprite
driven_by :selenium_chrome_headless
end
end
1 change: 1 addition & 0 deletions spec/views/admin/attachments/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
it "displays urls to file" do
assign(:attachment, attachment)
render
puts rendered
aggregate_failures do
expect(rendered).to have_selector("label:contains('URL') + p:contains('/attachment/#{attachment.id}/show')")
expect(rendered).to have_selector("label:contains('Download-URL') + p:contains('/attachment/#{attachment.id}/download')")
Expand Down