Module: Bidi2pdf::TestHelpers::Testcontainers::SessionTestHelper

Defined in:
lib/bidi2pdf/test_helpers/testcontainers/chromedriver_test_helper.rb

Instance Method Summary collapse

Instance Method Details

#chrome_argsObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/bidi2pdf/test_helpers/testcontainers/chromedriver_test_helper.rb', line 19

def chrome_args
  chrome_args = Bidi2pdf::Bidi::Session::DEFAULT_CHROME_ARGS.dup

  # within github actions, the sandbox is not supported, when we start our own container
  # some privileges are not available ???
  if ENV["DISABLE_CHROME_SANDBOX"]
    chrome_args << "--no-sandbox"

    puts "🚨 Chrome sandbox disabled"
  end
  chrome_args
end

#create_session(session_url) ⇒ Object



32
33
34
# File 'lib/bidi2pdf/test_helpers/testcontainers/chromedriver_test_helper.rb', line 32

def create_session(session_url)
  Bidi2pdf::Bidi::Session.new(session_url: session_url, headless: true, chrome_args: chrome_args)
end