Merge pull request #1366 from internetee/tune-test-env

Tune test env
This commit is contained in:
Timo Võhmar 2019-10-17 17:53:49 +03:00 committed by GitHub
commit 227031e7b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 26 deletions

View file

@ -20,7 +20,7 @@ class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase
self.use_transactional_fixtures = false
DatabaseCleaner.strategy = :truncation
Capybara.register_driver(:chrome) do |_app|
Capybara.register_driver(:chrome) do |app|
options = ::Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
@ -28,13 +28,10 @@ class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--window-size=1400,1400')
Capybara::Selenium::Driver.new(Rails.application, browser: :chrome, options: options)
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end
Capybara.register_server(:silent_puma) do |app, port, _host|
require 'rack/handler/puma'
Rack::Handler::Puma.run(app, Port: port, Threads: '0:2', Silent: true)
end
Capybara.server = :puma, { Silent: true }
def setup
DatabaseCleaner.start
@ -42,7 +39,6 @@ class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase
super
Capybara.current_driver = :chrome
Capybara.server = :silent_puma
end
def teardown