Skip to content

Commit

Permalink
test tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Aug 27, 2024
1 parent 19487f1 commit 1a759b2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def setup
Capybara.app_host = "http://#{IPSocket.getaddress(Socket.gethostname)}" if ENV["SELENIUM_SERVER"].present?
Capybara.default_max_wait_time = 5
Capybara.save_path = "tmp/test-screenshots"
Capybara.default_driver = :selenium

super

Expand All @@ -18,13 +19,15 @@ def setup

selenium_remote_url = "http://#{ENV.fetch('SELENIUM_SERVER')}:4444"

driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400] do |chrome_options|
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driven_by :selenium,
using: :headless_chrome,
screen_size: [1400, 1400] do |driver_option|
driver_option.add_argument('--disable-gpu')
driver_option.add_argument('--no-sandbox')
driver_option.add_argument('--disable-dev-shm-usage')

# Add preferences
chrome_options.add_preference(:download, {
driver_option.add_preference(:download, {
prompt_for_download: false,
default_directory: File.join(Rails.root, 'tmp')
})
Expand All @@ -34,7 +37,7 @@ def setup
Capybara::Selenium::Driver.new(app,
browser: :remote,
url: selenium_remote_url,
options: chrome_options
options: driver_option
)
end
end
Expand Down

0 comments on commit 1a759b2

Please sign in to comment.