mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
GUI tests for v3 Client Auth (albeit only in local mode, so kind of stubbed
This commit is contained in:
parent
cde46b676e
commit
50d5cf5740
@ -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):
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user