GUI tests for v3 Client Auth (albeit only in local mode, so kind of stubbed

This commit is contained in:
Miguel Jacq 2021-05-06 15:24:19 +10:00
parent cde46b676e
commit 50d5cf5740
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
2 changed files with 25 additions and 1 deletions

View File

@ -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.isVisible())
self.assertFalse(tab.get_mode().server_status.url_description.isVisible()) self.assertFalse(tab.get_mode().server_status.url_description.isVisible())
self.assertFalse( 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): def web_server_is_stopped(self, tab):
@ -452,6 +452,14 @@ class GuiBaseTest(unittest.TestCase):
# We should have timed out now # We should have timed out now
self.assertEqual(tab.get_mode().server_status.status, 0) 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 # Grouped tests follow from here
def run_all_common_setup_tests(self): def run_all_common_setup_tests(self):

View File

@ -608,3 +608,19 @@ class TestShare(GuiBaseTest):
self.hit_401(tab) self.hit_401(tab)
self.close_all_tabs() 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()