Skip to content

Commit b8b2ced

Browse files
committed
[tests] Selenium: allow passing html ID to hide_loading_overlay
1 parent d05262c commit b8b2ced

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openwisp_utils/tests/selenium.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ def wait_for(self, method, by, value, timeout=2, driver=None):
199199
print(self.get_browser_logs(driver))
200200
self.fail(f'{method} of "{value}" failed: {e}')
201201

202-
def hide_loading_overlay(self, timeout=2, driver=None):
202+
def hide_loading_overlay(self, html_id='loading-overlay', timeout=2, driver=None):
203203
"""The geckodriver can't figure out the loading overlay is still fading out, so let's just hide it."""
204204
driver = driver or self.web_driver
205205
driver.execute_script(
206-
'document.getElementById("loading-overlay").style.display="none";'
206+
f'document.getElementById("{html_id}").style.display="none";'
207207
)
208-
self.wait_for_invisibility(By.CSS_SELECTOR, '#loading-overlay', timeout, driver)
208+
self.wait_for_invisibility(By.ID, html_id, timeout, driver)

0 commit comments

Comments
 (0)