mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
tests: functional: Disable smooth scrolling from Bootstrap 5
- When an item needs to be scrolled into view, the slow scrolling leads to an early click causing the click to happen on an element that is not in view. Fix this by disabling smooth scrolling in browser options. - https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2576#note_558614 - https://github.com/SeleniumHQ/selenium/issues/11136#issuecomment-1370803713 Tests: - Run functional tests on wordpress app. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> [vexch: Move importing from selenium into function to prevent unit tests depend on selenium] Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
765e3176fa
commit
2aa9f72ea1
@ -121,6 +121,15 @@ def splinter_wait_time():
|
||||
return 0.01
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def splinter_driver_kwargs():
|
||||
"""Disable smooth scrolling to fix 'Element x not clickable' errors."""
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
driver_options = Options()
|
||||
driver_options.set_preference('general.smoothScroll', False)
|
||||
return {'options': driver_options}
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def splinter_browser_load_condition():
|
||||
"""When a page it loaded, wait until <body> is available."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user