Files
fizzy/test/application_system_test_case.rb
T
Mike Dalessio 5dec991d7c Introduce a few system tests
Primarily I'm trying to exercise active storage and action cable /
turbo streams, both of which have been brittle when making changes to
tenanting.
2025-09-13 13:18:32 -04:00

32 lines
1.3 KiB
Ruby

require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
browser_options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.add_argument("--window-size=1200,800")
opts.add_argument("--disable-extensions")
# Disable non-foreground tabs from getting a lower process priority
opts.add_argument("--disable-renderer-backgrounding")
# Normally, Chrome will treat a 'foreground' tab instead as backgrounded if the surrounding
# window is occluded (aka visually covered) by another window. This flag disables that.
opts.add_argument("--disable-backgrounding-occluded-windows")
# Suppress all permission prompts by automatically denying them.
opts.add_argument("--deny-permission-prompts")
opts.add_argument("--enable-automation")
end
Capybara.register_driver :chrome_headless do |app|
browser_options.add_argument("--headless")
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end
if ENV["SYSTEM_TESTS_BROWSER"]
driven_by :chrome, screen_size: [ 1200, 1000 ]
else
driven_by :chrome_headless, screen_size: [ 1200, 1000 ]
end
end