YusukeIwaki/puppeteer-ruby

Argument --window-size is not recognised via Capybara DSL

ExReanimator opened this issue · 1 comments

Step To Reproduce / Observed behavior

Capybara.register_driver(:selenium_chrome_with_puppeteer) do |app|
  options = Selenium::WebDriver::Chrome::Options.new

  Puppeteer.default_args.each do |arg|
    options.add_argument(arg)
  end
  options.add_argument('--remote-debugging-port=9222')
  options.add_argument('--window-size=1280,800') # <--- THIS ONE

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

Capybara::Screenshot.register_driver(:selenium_chrome_with_puppeteer) do |driver, path|
  driver.browser.save_screenshot(path)
end

The Selenium::WebDriver::Chrome::Options contains this arg, but the Viewport is still with default 800x600 resolution:

<Selenium::WebDriver::Chrome::Options:0x00005596d489e570 @Args=#<Set: {"--disable-background-networking", "--enable-features=NetworkService,NetworkServiceInProcess", "--disable-background-timer-throttling", "--disable-backgrounding-occluded-windows", "--disable-breakpad", "--disable-client-side-phishing-detection", "--disable-component-extensions-with-background-pages", "--disable-default-apps", "--disable-dev-shm-usage", "--disable-extensions", "--disable-features=Translate,BackForwardCache,AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync", "--disable-hang-monitor", "--disable-ipc-flooding-protection", "--disable-popup-blocking", "--disable-prompt-on-repost", "--disable-renderer-backgrounding", "--disable-sync", "--force-color-profile=srgb", "--metrics-recording-only", "--no-first-run", "--enable-automation", "--password-store=basic", "--use-mock-keychain", "--enable-blink-features=IdleDetection", "--headless", "--hide-scrollbars", "--mute-audio", "about:blank", "--remote-debugging-port=9222", "--window-size=1280,800"}>

Test fails, because it can not find element hidden because of small resolution of the viewport.
Can you please help to figure out? It's not implemented yet or it's a bug?

Expected behavior

Viewport should be 1280x800 size.

Environment

ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]

Sorry, problem was on my side.