Skip to content

Instantly share code, notes, and snippets.

@blafri
Last active November 7, 2025 15:23
Show Gist options
  • Select an option

  • Save blafri/ea0744a0be2571a7a32ed5947451f354 to your computer and use it in GitHub Desktop.

Select an option

Save blafri/ea0744a0be2571a7a32ed5947451f354 to your computer and use it in GitHub Desktop.
Hack to fix browser size issues with the current version of chrome driver that is not respecting the screen_size option.
# There is a bug with the chrome driver that does not respect the screen_size option, so we have this hack
# to resize the window to the proper size after it visits a page.
#
# This should be removed in the future once the bug is fixed.
#
# See: https://github.com/SeleniumHQ/selenium/issues/15827
def visit(...)
super.tap do
page.driver.browser.manage.window.resize_to(1400, 800)
end
end
@blafri
Copy link
Author

blafri commented Nov 5, 2025

This should be added to test/application_system_test_case.rb inside the ApplicationSystemTestCase class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment