From cc026a16212254e6959961fae236045b37d6a41c Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Tue, 26 Mar 2024 16:53:08 -0400 Subject: [PATCH] wait for animation to complete --- movie/creation/movieCreator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/movie/creation/movieCreator.py b/movie/creation/movieCreator.py index 94fc660b..2736b807 100644 --- a/movie/creation/movieCreator.py +++ b/movie/creation/movieCreator.py @@ -127,7 +127,7 @@ def _set_captions_on_page(self, roundNum, caption, showGraphTitleInsteadOfRoundN def _generate_image_for_round_synchronously(self, roundNum): try: - self.browser.execute_script(f'transitionEachBarForRound({roundNum});') + self.browser.execute_script(f'transitionEachBarForRound({roundNum})') except selenium.common.exceptions.JavascriptException as exception: errorText = "This error commonly occurs with Xvfb issues: " errorText += str(exception) @@ -135,8 +135,8 @@ def _generate_image_for_round_synchronously(self, roundNum): errorText += self.browser.page_source[0:1000] raise ProbablyFailedToLaunchBrowser(errorText) from exception - time.sleep(0.3) # flushAllD3Transitions doesn't seem to work, so just sleep - # self.browser.execute_script("flushAllD3Transitions();") + self.browser.execute_script("flushAllD3Transitions();") + time.sleep(0.6) # flushAllD3Transitions doesn't seem to work, so just sleep with tempfile.NamedTemporaryFile(suffix=".png") as tf: self.browser.save_screenshot(tf.name)