Added test_persistent_password

This commit is contained in:
Micah Lee 2019-11-10 10:25:24 -08:00
parent 48425e230f
commit 53e5515f38
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -12,13 +12,6 @@ from .gui_base_test import GuiBaseTest
class TestShare(GuiBaseTest): class TestShare(GuiBaseTest):
# Shared test methods # Shared test methods
# Persistence tests
def have_same_password(self, tab, password):
"""Test that we have the same password"""
self.assertEqual(tab.get_mode().server_status.web.password, password)
# Share-specific tests
def file_selection_widget_has_files(self, tab, num=3): def file_selection_widget_has_files(self, tab, num=3):
"""Test that the number of items in the list is as expected""" """Test that the number of items in the list is as expected"""
self.assertEqual( self.assertEqual(
@ -312,14 +305,6 @@ class TestShare(GuiBaseTest):
self.run_all_share_mode_started_tests(tab) self.run_all_share_mode_started_tests(tab)
self.run_all_share_mode_individual_file_download_tests(tab) self.run_all_share_mode_individual_file_download_tests(tab)
def run_all_share_mode_persistent_tests(self, tab):
"""Same as end-to-end share tests but also test the password is the same on multiple shared"""
self.run_all_share_mode_setup_tests(tab)
self.run_all_share_mode_started_tests(tab)
password = tab.get_mode().server_status.web.password
self.run_all_share_mode_download_tests(tab)
self.have_same_password(tab, password)
def run_all_share_mode_timer_tests(self, tab): def run_all_share_mode_timer_tests(self, tab):
"""Auto-stop timer tests in share mode""" """Auto-stop timer tests in share mode"""
self.run_all_share_mode_setup_tests(tab) self.run_all_share_mode_setup_tests(tab)
@ -523,3 +508,22 @@ class TestShare(GuiBaseTest):
self.server_status_indicator_says_closed(tab) self.server_status_indicator_says_closed(tab)
self.close_all_tabs() self.close_all_tabs()
@pytest.mark.gui
def test_persistent_password(self):
"""
Test a large download
"""
tab = self.new_share_tab()
tab.get_mode().mode_settings_widget.persistent_checkbox.click()
self.run_all_common_setup_tests()
self.run_all_share_mode_setup_tests(tab)
self.run_all_share_mode_started_tests(tab)
password = tab.get_mode().server_status.web.password
self.run_all_share_mode_download_tests(tab)
self.run_all_share_mode_started_tests(tab)
self.assertEqual(tab.get_mode().server_status.web.password, password)
self.run_all_share_mode_download_tests(tab)
self.close_all_tabs()