diff options
author | Miguel Jacq <mig@mig5.net> | 2021-05-06 15:24:19 +1000 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2021-05-06 15:24:26 +1000 |
commit | 50d5cf57402a59821208b0740a2b8bb7072a24a9 (patch) | |
tree | 374586beb9904147e2dce4d753896cafd445cbd9 /desktop/tests | |
parent | cde46b676e89a27e7f5cec97ab67c020bde601a6 (diff) | |
download | onionshare-50d5cf57402a59821208b0740a2b8bb7072a24a9.tar.gz onionshare-50d5cf57402a59821208b0740a2b8bb7072a24a9.zip |
GUI tests for v3 Client Auth (albeit only in local mode, so kind of stubbed
Diffstat (limited to 'desktop/tests')
-rw-r--r-- | desktop/tests/gui_base_test.py | 10 | ||||
-rw-r--r-- | desktop/tests/test_gui_share.py | 16 |
2 files changed, 25 insertions, 1 deletions
diff --git a/desktop/tests/gui_base_test.py b/desktop/tests/gui_base_test.py index c6a5da2f..da61f4e5 100644 --- a/desktop/tests/gui_base_test.py +++ b/desktop/tests/gui_base_test.py @@ -371,7 +371,7 @@ class GuiBaseTest(unittest.TestCase): self.assertFalse(tab.get_mode().server_status.url.isVisible()) self.assertFalse(tab.get_mode().server_status.url_description.isVisible()) self.assertFalse( - tab.get_mode().server_status.copy_hidservauth_button.isVisible() + tab.get_mode().server_status.copy_client_auth_v3_button.isVisible() ) def web_server_is_stopped(self, tab): @@ -452,6 +452,14 @@ class GuiBaseTest(unittest.TestCase): # We should have timed out now self.assertEqual(tab.get_mode().server_status.status, 0) + def clientauth_is_visible(self, tab): + self.assertTrue( + tab.get_mode().server_status.copy_client_auth_v3_button.isVisible() + ) + tab.get_mode().server_status.copy_client_auth_v3_button.click() + clipboard = tab.common.gui.qtapp.clipboard() + self.assertEqual(clipboard.text(), "E2GOT5LTUTP3OAMRCRXO4GSH6VKJEUOXZQUC336SRKAHTTT5OVSA") + # Grouped tests follow from here def run_all_common_setup_tests(self): diff --git a/desktop/tests/test_gui_share.py b/desktop/tests/test_gui_share.py index 380d63f6..08924ca6 100644 --- a/desktop/tests/test_gui_share.py +++ b/desktop/tests/test_gui_share.py @@ -608,3 +608,19 @@ class TestShare(GuiBaseTest): self.hit_401(tab) self.close_all_tabs() + + def test_client_auth(self): + """ + Test the ClientAuth is received from the backend and that + the widget is visible in the UI + """ + tab = self.new_share_tab() + tab.get_mode().mode_settings_widget.toggle_advanced_button.click() + tab.get_mode().mode_settings_widget.client_auth_v3_checkbox.click() + + self.run_all_common_setup_tests() + self.run_all_share_mode_setup_tests(tab) + self.run_all_share_mode_started_tests(tab) + self.clientauth_is_visible(tab) + + self.close_all_tabs() |