From 5cefb16e5279cf7dba6dbc1588d088b18f31b35c Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 25 May 2022 15:38:40 +0200 Subject: [PATCH] Minor code cleanup --- changedetectionio/content_fetcher.py | 5 ----- changedetectionio/tests/test_trigger.py | 6 ------ 2 files changed, 11 deletions(-) diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index 7ea31de4..528a7a2d 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -293,13 +293,10 @@ class base_html_playwright(Fetcher): # Better to not use any smarts from Playwright and just wait an arbitrary number of seconds # This seemed to solve nearly all 'TimeoutErrors' extra_wait = int(os.getenv("WEBDRIVER_DELAY_BEFORE_CONTENT_READY", 5)) + self.render_extract_delay - p=time.time() page.wait_for_timeout(extra_wait * 1000) except playwright._impl._api_types.TimeoutError as e: raise EmptyReply(url=url, status_code=None) - r=time.time()-p - x=1 if response is None: raise EmptyReply(url=url, status_code=None) @@ -308,8 +305,6 @@ class base_html_playwright(Fetcher): # Bug 2(?) Set the viewport size AFTER loading the page page.set_viewport_size({"width": 1280, "height": 1024}) - # Bugish - Let the page redraw/reflow - page.set_viewport_size({"width": 1280, "height": 1024}) self.status_code = response.status self.content = page.content() diff --git a/changedetectionio/tests/test_trigger.py b/changedetectionio/tests/test_trigger.py index 21174e32..cc622ca4 100644 --- a/changedetectionio/tests/test_trigger.py +++ b/changedetectionio/tests/test_trigger.py @@ -135,12 +135,6 @@ def test_trigger_functionality(client, live_server): res = client.get(url_for("diff_history_page", uuid="first")) assert b'Add to cart' in res.data - # https://github.com/dgtlmoon/changedetection.io/issues/616 - # Apparently the actual snapshot that contains the trigger never shows - res = client.get(url_for("diff_history_page", uuid="first")) - assert b'Add to cart' in res.data - - # Check the preview/highlighter, we should be able to see what we triggered on, but it should be highlighted res = client.get(url_for("preview_page", uuid="first"))