You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2023/01/17 18:01:01 UTC
[superset] branch master updated: fix: change order of webdriver timeout checks (#22698)
This is an automated email from the ASF dual-hosted git repository.
elizabeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 0a2fc9cdde fix: change order of webdriver timeout checks (#22698)
0a2fc9cdde is described below
commit 0a2fc9cdde48b59dc177beecca26d5a6d4e15671
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Tue Jan 17 10:00:51 2023 -0800
fix: change order of webdriver timeout checks (#22698)
---
superset/utils/webdriver.py | 13 ++++++++-----
tests/integration_tests/thumbnails_tests.py | 2 +-
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/superset/utils/webdriver.py b/superset/utils/webdriver.py
index 991790339a..b1ba784281 100644
--- a/superset/utils/webdriver.py
+++ b/superset/utils/webdriver.py
@@ -177,16 +177,19 @@ class WebDriverProxy:
element = WebDriverWait(driver, self._screenshot_locate_wait).until(
EC.presence_of_element_located((By.CLASS_NAME, element_name))
)
- logger.debug("Wait for .loading to be done")
- WebDriverWait(driver, self._screenshot_load_wait).until_not(
- EC.presence_of_all_elements_located((By.CLASS_NAME, "loading"))
- )
- logger.debug("Wait for chart to have content")
+
+ logger.debug("Wait for chart containers to draw")
WebDriverWait(driver, self._screenshot_locate_wait).until(
EC.visibility_of_all_elements_located(
(By.CLASS_NAME, "slice_container")
)
)
+
+ logger.debug("Wait for loading element of charts to be gone")
+ WebDriverWait(driver, self._screenshot_load_wait).until_not(
+ EC.presence_of_all_elements_located((By.CLASS_NAME, "loading"))
+ )
+
selenium_animation_wait = current_app.config[
"SCREENSHOT_SELENIUM_ANIMATION_WAIT"
]
diff --git a/tests/integration_tests/thumbnails_tests.py b/tests/integration_tests/thumbnails_tests.py
index 0ee420fda8..efa0d73cb4 100644
--- a/tests/integration_tests/thumbnails_tests.py
+++ b/tests/integration_tests/thumbnails_tests.py
@@ -180,7 +180,7 @@ class TestWebDriverProxy(SupersetTestCase):
)
url = get_url_path("Superset.slice", slice_id=1, standalone="true")
webdriver.get_screenshot(url, "chart-container", user=user)
- assert mock_webdriver_wait.call_args_list[1] == call(ANY, 15)
+ assert mock_webdriver_wait.call_args_list[2] == call(ANY, 15)
@patch("superset.utils.webdriver.WebDriverWait")
@patch("superset.utils.webdriver.firefox")