-
-
Notifications
You must be signed in to change notification settings - Fork 96
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.runIt 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_sizecould accept a:maximizedvalue in ferrum/cuprite, and it would addstart-maximizedto the browser options:window_sizecould accept anilvalue in ferrum/cuprite, so it could work withstart-maximized- Not pass the
:window_sizeparameter to chrome unless explicitly specified, but that is a minor breaking change
Metadata
Metadata
Assignees
Labels
No labels