mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
589e34d00c
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Claire <claire.github-309c@sitedethib.com>
32 lines
761 B
Ruby
32 lines
761 B
Ruby
# frozen_string_literal: true
|
|
|
|
Capybara.server_host = 'localhost'
|
|
Capybara.server_port = 3000
|
|
Capybara.app_host = "http://#{Capybara.server_host}:#{Capybara.server_port}"
|
|
|
|
require 'selenium/webdriver'
|
|
|
|
Capybara.register_driver :chrome do |app|
|
|
Capybara::Selenium::Driver.new(app, browser: :chrome)
|
|
end
|
|
|
|
Capybara.register_driver :headless_chrome do |app|
|
|
options = Selenium::WebDriver::Chrome::Options.new
|
|
options.add_argument '--headless=new'
|
|
options.add_argument '--window-size=1680,1050'
|
|
|
|
Capybara::Selenium::Driver.new(
|
|
app,
|
|
browser: :chrome,
|
|
options: options
|
|
)
|
|
end
|
|
|
|
Capybara.javascript_driver = :headless_chrome
|
|
|
|
RSpec.configure do |config|
|
|
config.before(:each, type: :system) do
|
|
driven_by Capybara.javascript_driver
|
|
end
|
|
end
|