Skip to content

Commit

Permalink
fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Feb 22, 2024
1 parent 817ef79 commit 195bb80
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions spec/support/capybara.rb
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

0 comments on commit 195bb80

Please sign in to comment.