-
-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
When window-size
and start-maximized
parameters are passed to Chrome, window-size
takes precedence.
With cuprite, there's no way not to pass window-size
, thus no way to maximize the window.
The following code fails due to window_size: nil
:
require 'capybara/cuprite'
require 'capybara/dsl'
class Browser
include Capybara::DSL
def run
Capybara.current_driver = :cuprite
Capybara.javascript_driver = :cuprite
Capybara.register_driver(:cuprite) do |app|
Capybara::Cuprite::Driver.new(app, headless: false, browser_options: { 'start-maximized' => nil }, window_size: nil)
end
visit 'https://example.com'
end
end
Browser.new.run
It might be a ferrum issue, but it seems to work correctly when invoked through ferrum
require 'ferrum'
browser = Ferrum::Browser.new(headless: false, browser_options: { 'start-maximized' => nil }, window_size: nil)
page = browser.create_page
page.go_to('http://example.com')
Possible solutions:
:window_size
could accept a:maximized
value in ferrum/cuprite, and it would addstart-maximized
to the browser options:window_size
could accept anil
value in ferrum/cuprite, so it could work withstart-maximized
- Not pass the
:window_size
parameter to chrome unless explicitly specified, but that is a minor breaking change
Metadata
Metadata
Assignees
Labels
No labels