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 67a0e03 commit 817ef79
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
is_ci = ENV.fetch('IS_CI', false)

Capybara.register_driver :headless_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_option('--headless')
options.add_option('--no-sandbox')
options.add_option('--disable-gpu')
options.add_option('--disable-dev-shm-usage')
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w[--headless --disable-gpu] },
'goog:loggingPrefs': {
browser: 'ALL'
}
)

options = ::Selenium::WebDriver::Chrome::Options.new

options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--window-size=1400,1400')

Capybara::Selenium::Driver.new(
app,
browser: :chrome,
options: options
)
app,
browser: :chrome,
desired_capabilities: capabilities,
options: options
)
end

Capybara.default_driver = :headless_chrome

RSpec.configure do |config|
if is_ci
config.before(:each, type: :feature) do
Expand Down

0 comments on commit 817ef79

Please sign in to comment.