thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 428 forks source link

Unable to maximize the window #1078

Open sureshpathipati opened 5 years ago

sureshpathipati commented 5 years ago

Currently I am unable to maximize the window. I tried maximum functions(resize_window, Capybara.current_window.maximize, execute_script("window.resizeTo(1024, screen.height)")) to maximize the window with no luck.

Gem version 'capybara-webkit', '~> 1.15.1'

twalpole commented 5 years ago

What do you think maximize means in a fully headless browser?

sureshpathipati commented 5 years ago

maximize generally expands the browser to the resolution available. But I don't know if it works same for webkit.

sureshpathipati commented 5 years ago

Some how the following snippet worked for me

Before do |scenario|
  #<code>
  Capybara.page.current_window.resize_to(1600, 1600)
end