From 7048a0acbdb85fce4deedc8283fb139e2c83aba6 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sat, 21 Jan 2023 13:47:32 +0100 Subject: [PATCH] UI - Fix wrong logic when dealing with webdriver/playwright watch screenshot settings (#1325) --- changedetectionio/__init__.py | 2 +- .../tests/visualselector/test_fetch_data.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 5b9a2bb1..0489fa35 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -652,7 +652,7 @@ def changedetection_app(config=None, datastore_o=None): system_uses_webdriver = datastore.data['settings']['application']['fetch_backend'] == 'html_webdriver' is_html_webdriver = False - if (watch.get('fetch_backend') == 'system' and system_uses_webdriver) or watch.get('fetch_backend') == 'html_requests': + if (watch.get('fetch_backend') == 'system' and system_uses_webdriver) or watch.get('fetch_backend') == 'html_webdriver': is_html_webdriver = True output = render_template("edit.html", diff --git a/changedetectionio/tests/visualselector/test_fetch_data.py b/changedetectionio/tests/visualselector/test_fetch_data.py index 6bde6713..63c85438 100644 --- a/changedetectionio/tests/visualselector/test_fetch_data.py +++ b/changedetectionio/tests/visualselector/test_fetch_data.py @@ -52,3 +52,12 @@ def test_visual_selector_content_ready(client, live_server): # Open it and see if it roughly looks correct with open(os.path.join('test-datastore', uuid, 'elements.json'), 'r') as f: json.load(f) + + # Some options should be enabled + # @todo - in the future, the visibility should be toggled by JS from the request type setting + res = client.get( + url_for("edit_page", uuid="first"), + follow_redirects=True + ) + assert b'notification_screenshot' in res.data +