Add test_autostop_timer

This commit is contained in:
Micah Lee 2019-11-10 11:26:28 -08:00
parent 270ff21e7e
commit 329339dab8
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -146,14 +146,6 @@ class TestReceive(GuiBaseTest):
self.server_status_indicator_says_closed(tab, False) self.server_status_indicator_says_closed(tab, False)
self.upload_dir_permissions(0o755) self.upload_dir_permissions(0o755)
def run_all_receive_mode_timer_tests(self, tab):
"""Auto-stop timer tests in receive mode"""
self.run_all_receive_mode_setup_tests(tab)
self.set_timeout(tab, 5)
self.autostop_timer_widget_hidden(tab)
self.server_timed_out(tab, 15000)
self.web_server_is_stopped(tab)
def run_all_clear_all_button_tests(self, tab): def run_all_clear_all_button_tests(self, tab):
"""Test the Clear All history button""" """Test the Clear All history button"""
self.run_all_receive_mode_setup_tests(tab) self.run_all_receive_mode_setup_tests(tab)
@ -168,7 +160,7 @@ class TestReceive(GuiBaseTest):
@pytest.mark.gui @pytest.mark.gui
def test_clear_all_button(self): def test_clear_all_button(self):
""" """
Public mode should skip the rate limit Clear all history items should work
""" """
tab = self.new_receive_tab() tab = self.new_receive_tab()
@ -176,3 +168,21 @@ class TestReceive(GuiBaseTest):
self.run_all_clear_all_button_tests(tab) self.run_all_clear_all_button_tests(tab)
self.close_all_tabs() self.close_all_tabs()
@pytest.mark.gui
def test_autostop_timer(self):
"""
Test autostop timer
"""
tab = self.new_receive_tab()
tab.get_mode().mode_settings_widget.toggle_advanced_button.click()
tab.get_mode().mode_settings_widget.autostop_timer_checkbox.click()
self.run_all_common_setup_tests()
self.run_all_receive_mode_setup_tests(tab)
self.set_timeout(tab, 5)
self.autostop_timer_widget_hidden(tab)
self.server_timed_out(tab, 15000)
self.web_server_is_stopped(tab)
self.close_all_tabs()