mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-25 10:42:58 -03:00
Added test_autostart_timer_cancel
This commit is contained in:
parent
08298d9ffd
commit
44b534de6c
2 changed files with 29 additions and 6 deletions
|
@ -304,6 +304,16 @@ class GuiBaseTest(unittest.TestCase):
|
|||
"""Test that the counter has incremented"""
|
||||
self.assertEqual(tab.get_mode().history.completed_count, count)
|
||||
|
||||
def stop_running_server(self, tab):
|
||||
"""Stop a server that's running"""
|
||||
self.assertNotEqual(tab.get_mode().server_status.status, 0)
|
||||
|
||||
tab.get_mode().server_status.server_button.click()
|
||||
QtTest.QTest.qWait(200)
|
||||
|
||||
self.server_is_stopped(tab)
|
||||
self.web_server_is_stopped(tab)
|
||||
|
||||
def server_is_stopped(self, tab):
|
||||
"""Test that the server stops when we click Stop"""
|
||||
if (
|
||||
|
|
|
@ -215,7 +215,7 @@ class TestShare(GuiBaseTest):
|
|||
QtTest.QTest.mousePress(
|
||||
tab.get_mode().server_status.server_button, QtCore.Qt.LeftButton
|
||||
)
|
||||
QtTest.QTest.qWait(50)
|
||||
QtTest.QTest.qWait(100)
|
||||
QtTest.QTest.mouseRelease(
|
||||
tab.get_mode().server_status.server_button, QtCore.Qt.LeftButton
|
||||
)
|
||||
|
@ -384,12 +384,8 @@ class TestShare(GuiBaseTest):
|
|||
self.web_server_is_stopped(tab)
|
||||
self.scheduled_service_started(tab, 2200)
|
||||
self.web_server_is_running(tab)
|
||||
QtTest.QTest.qWait(200)
|
||||
tab.get_mode().server_status.server_button.click()
|
||||
QtTest.QTest.qWait(200)
|
||||
self.server_is_stopped(tab)
|
||||
self.web_server_is_stopped(tab)
|
||||
|
||||
self.stop_running_server(tab)
|
||||
self.close_all_tabs()
|
||||
|
||||
@pytest.mark.gui
|
||||
|
@ -414,3 +410,20 @@ class TestShare(GuiBaseTest):
|
|||
QtCore.QTimer.singleShot(200, accept_dialog)
|
||||
tab.get_mode().server_status.server_button.click()
|
||||
self.assertEqual(tab.get_mode().server_status.status, 0)
|
||||
|
||||
self.close_all_tabs()
|
||||
|
||||
@pytest.mark.gui
|
||||
def test_autostart_timer_cancel(self):
|
||||
"""
|
||||
Test canceling a scheduled share
|
||||
"""
|
||||
tab = self.new_share_tab()
|
||||
tab.get_mode().mode_settings_widget.toggle_advanced_button.click()
|
||||
tab.get_mode().mode_settings_widget.autostart_timer_checkbox.click()
|
||||
|
||||
self.run_all_common_setup_tests()
|
||||
self.run_all_share_mode_setup_tests(tab)
|
||||
self.cancel_the_share(tab)
|
||||
|
||||
self.close_all_tabs()
|
||||
|
|
Loading…
Add table
Reference in a new issue