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 8254a3d commit ed4e78d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@ def setup
login_as(user, role: User::STAFF)
end

driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400] do |options|
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driven_by :selenium, using: :headless_chrome, screen_size: [1280, 800],
options: { browser: :remote, url: "http://#{ENV.fetch('SELENIUM_SERVER')}:4444"} do |chrome_options|
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

# Add preferences
options.add_preference(:download, {
chrome_options.add_preference(:download, {
prompt_for_download: false,
default_directory: File.join(Rails.root, 'tmp')
})

# Remote driver setup
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app,
browser: :remote,
url: "http://#{ENV.fetch('SELENIUM_SERVER')}:4444",
options: options
options: chrome_options
)
end
end
Expand Down

0 comments on commit ed4e78d

Please sign in to comment.