django
django copied to clipboard
Fixed selenium tests in Firefox.
Unlike Chromium-based browsers, Firefox does not automatically scroll elements into view when using the Actions API with move_to_element
. This calls the scrollIntoView
function explicitly, which fixes some selenium tests when not running in headless mode.
Namely, the admin_views.tests.SeleniumTests.test_prepopulated_fields
test has a page larger than the viewport, and some elements are hidden, leading the test failing with an Exception like:
selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: Move target (570, 968) is out of bounds of viewport dimensions (1280, 955)