-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
817ef79
commit 195bb80
Showing
1 changed file
with
9 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,24 @@ | ||
is_ci = ENV.fetch('IS_CI', false) | ||
|
||
Capybara.register_driver :headless_chrome do |app| | ||
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | ||
chromeOptions: { args: %w[--headless --disable-gpu] }, | ||
'goog:loggingPrefs': { | ||
browser: 'ALL' | ||
} | ||
) | ||
|
||
options = ::Selenium::WebDriver::Chrome::Options.new | ||
|
||
options = Selenium::WebDriver::Chrome::Options.new | ||
options.add_argument('--headless') | ||
options.add_argument('--no-sandbox') | ||
options.add_argument('--window-size=1400,1400') | ||
options.add_argument('--disable-gpu') | ||
options.add_argument('--disable-dev-shm-usage') | ||
|
||
|
||
Capybara::Selenium::Driver.new( | ||
app, | ||
browser: :chrome, | ||
desired_capabilities: capabilities, | ||
options: options | ||
) | ||
app, | ||
browser: :chrome, | ||
options: options | ||
) | ||
end | ||
|
||
Capybara.default_driver = :headless_chrome | ||
|
||
RSpec.configure do |config| | ||
if is_ci | ||
config.before(:each, type: :feature) do | ||
driven_by :headless_chrome | ||
Capybara.current_driver = :headless_chrome | ||
end | ||
end | ||
end |