Created
October 13, 2013 01:58
-
-
Save mars/6957187 to your computer and use it in GitHub Desktop.
Set window size for Capybara/Selenium/chromedriver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Capybara.register_driver :chrome do |app| | |
| Capybara::Selenium::Driver.new(app, | |
| browser: :chrome, | |
| desired_capabilities: { | |
| "chromeOptions" => { | |
| "args" => %w{ window-size=1024,768 } | |
| } | |
| } | |
| ) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was not able to get this to work for me with the
HEADLESS=true bundle exec rspecsyntax. I ended up registering two drivers:selenium_chromeand:selenium_chrome_headlessand using a separateselenium.rb: