Skip to content

Commit

Permalink
Change registration
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Dec 29, 2023
1 parent a12fef1 commit b0116c4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
17 changes: 0 additions & 17 deletions lib/decidim/iframe/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,6 @@ class Engine < ::Rails::Engine
end
end

Capybara.register_driver :headless_chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new
options.args << "--headless=new"
options.args << "--no-sandbox"
options.args << if ENV["BIG_SCREEN_SIZE"].present?
"--window-size=1920,3000"
else
"--window-size=1920,1080"
end
options.args << "--ignore-certificate-errors" if ENV["TEST_SSL"]
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
capabilities: [options]
)
end

def load_seed
nil
end
Expand Down
22 changes: 22 additions & 0 deletions lib/decidim/iframe/test/rspec_support/capybara.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

require "selenium-webdriver"

module Decidim
Capybara.register_driver :headless_chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new
options.args << "--headless=new"
options.args << "--no-sandbox"
options.args << if ENV["BIG_SCREEN_SIZE"].present?
"--window-size=1920,3000"
else
"--window-size=1920,1080"
end
options.args << "--ignore-certificate-errors" if ENV["TEST_SSL"]
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
capabilities: [options]
)
end
end

0 comments on commit b0116c4

Please sign in to comment.