From 22cd3cf9f1fbcf773a49db2deb2a499cd0a9b669 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Thu, 9 Nov 2023 22:28:01 +0200 Subject: [PATCH] test: Fix selenium tests. --- basicswap/basicswap.py | 7 +- basicswap/templates/inc_messages.html | 6 +- basicswap/templates/settings.html | 2 +- scripts/createoffers.py | 2 +- tests/basicswap/selenium/notes.txt | 2 + tests/basicswap/selenium/test_offer.py | 31 ++++----- tests/basicswap/selenium/test_settings.py | 67 ++++++++++++++----- .../basicswap/selenium/test_swap_direction.py | 23 ++++--- tests/basicswap/selenium/test_wallets.py | 40 +++++------ tests/basicswap/selenium/util.py | 14 ++++ 10 files changed, 119 insertions(+), 75 deletions(-) create mode 100644 tests/basicswap/selenium/notes.txt create mode 100644 tests/basicswap/selenium/util.py diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index fbc242f..24ecd5a 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -6137,7 +6137,7 @@ class BasicSwap(BaseApp): if 'chart_api_key' in data: new_value = data['chart_api_key'] - ensure(isinstance(new_value, bool), 'New chart_api_key value not a string') + ensure(isinstance(new_value, str), 'New chart_api_key value not a string') ensure(len(new_value) <= 128, 'New chart_api_key value too long') if all(c in string.hexdigits for c in new_value): if settings_copy.get('chart_api_key', '') != new_value: @@ -6196,7 +6196,10 @@ class BasicSwap(BaseApp): remotedaemonurls.add(url.strip()) if set(settings_cc.get('remote_daemon_urls', [])) != remotedaemonurls: - settings_cc['remote_daemon_urls'] = list(remotedaemonurls) + if len(remotedaemonurls) == 0 and 'remote_daemon_urls' in settings_cc: + del settings_cc['remote_daemon_urls'] + else: + settings_cc['remote_daemon_urls'] = list(remotedaemonurls) settings_changed = True suggest_reboot = True diff --git a/basicswap/templates/inc_messages.html b/basicswap/templates/inc_messages.html index fe98501..47880f7 100644 --- a/basicswap/templates/inc_messages.html +++ b/basicswap/templates/inc_messages.html @@ -11,7 +11,7 @@
-

{{ m[1] }}

+

{{ m[1] }}

@@ -45,7 +45,7 @@
-
{% endif %} - \ No newline at end of file + diff --git a/basicswap/templates/settings.html b/basicswap/templates/settings.html index e460f86..a5ac4ea 100644 --- a/basicswap/templates/settings.html +++ b/basicswap/templates/settings.html @@ -48,7 +48,7 @@