Make wait times in TestTabs much shorter, which makes tests run much quicker

This commit is contained in:
Micah Lee 2019-11-08 17:08:21 +08:00
parent f767268b5d
commit 7ff0e9d772
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -70,14 +70,14 @@ class TestTabs(GuiBaseTest):
tab.get_mode().server_status.status, tab.get_mode().server_status.status,
tab.get_mode().server_status.STATUS_WORKING, tab.get_mode().server_status.STATUS_WORKING,
) )
QtTest.QTest.qWait(1000) QtTest.QTest.qWait(500)
self.assertEqual( self.assertEqual(
tab.get_mode().server_status.status, tab.get_mode().server_status.status,
tab.get_mode().server_status.STATUS_STARTED, tab.get_mode().server_status.STATUS_STARTED,
) )
# Prepare to reject the dialog # Prepare to reject the dialog
QtCore.QTimer.singleShot(1000, tab.close_dialog.reject_button.click) QtCore.QTimer.singleShot(200, tab.close_dialog.reject_button.click)
# Close tab # Close tab
QtTest.QTest.mouseClick( QtTest.QTest.mouseClick(
@ -90,7 +90,7 @@ class TestTabs(GuiBaseTest):
self.assertTrue(tab.get_mode().isVisible()) self.assertTrue(tab.get_mode().isVisible())
# Prepare to accept the dialog # Prepare to accept the dialog
QtCore.QTimer.singleShot(1000, tab.close_dialog.accept_button.click) QtCore.QTimer.singleShot(200, tab.close_dialog.accept_button.click)
# Close tab # Close tab
QtTest.QTest.mouseClick( QtTest.QTest.mouseClick(
@ -113,7 +113,7 @@ class TestTabs(GuiBaseTest):
self.assertTrue(os.path.exists(tab.settings.filename)) self.assertTrue(os.path.exists(tab.settings.filename))
# Prepare to reject the dialog # Prepare to reject the dialog
QtCore.QTimer.singleShot(1000, tab.close_dialog.reject_button.click) QtCore.QTimer.singleShot(200, tab.close_dialog.reject_button.click)
# Close tab # Close tab
QtTest.QTest.mouseClick( QtTest.QTest.mouseClick(
@ -129,7 +129,7 @@ class TestTabs(GuiBaseTest):
self.assertTrue(os.path.exists(tab.settings.filename)) self.assertTrue(os.path.exists(tab.settings.filename))
# Prepare to accept the dialog # Prepare to accept the dialog
QtCore.QTimer.singleShot(1000, tab.close_dialog.accept_button.click) QtCore.QTimer.singleShot(200, tab.close_dialog.accept_button.click)
# Close tab # Close tab
QtTest.QTest.mouseClick( QtTest.QTest.mouseClick(
@ -304,14 +304,14 @@ class TestTabs(GuiBaseTest):
tab.get_mode().server_status.status, tab.get_mode().server_status.status,
tab.get_mode().server_status.STATUS_WORKING, tab.get_mode().server_status.STATUS_WORKING,
) )
QtTest.QTest.qWait(1000) QtTest.QTest.qWait(500)
self.assertEqual( self.assertEqual(
tab.get_mode().server_status.status, tab.get_mode().server_status.status,
tab.get_mode().server_status.STATUS_STARTED, tab.get_mode().server_status.STATUS_STARTED,
) )
# Prepare to reject the dialog # Prepare to reject the dialog
QtCore.QTimer.singleShot(1000, self.gui.close_dialog.reject_button.click) QtCore.QTimer.singleShot(200, self.gui.close_dialog.reject_button.click)
# Close the window # Close the window
self.gui.close() self.gui.close()