From 57f01b4377417b48fae2a1b4ad986f86bf8a4b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Ri=C3=9Fe?= Date: Thu, 22 Feb 2024 15:38:09 +0100 Subject: [PATCH] fixup! WIP --- tests/_test_msui/test_mscolab.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/_test_msui/test_mscolab.py b/tests/_test_msui/test_mscolab.py index 5b8a8fc23..666f847fc 100644 --- a/tests/_test_msui/test_mscolab.py +++ b/tests/_test_msui/test_mscolab.py @@ -110,18 +110,20 @@ def test_disconnect(self): # set ui_name_winodw default assert self.main_window.usernameLabel.text() == 'User' - def test_login(self): + def test_login(self, qtbot): self._connect_to_mscolab() modify_config_file({"MSS_auth": {self.url: self.userdata[0]}}) self._login(self.userdata[0], self.userdata[2]) - QtWidgets.QApplication.processEvents() - # show logged in widgets - assert self.main_window.usernameLabel.text() == self.userdata[1] - assert self.main_window.connectBtn.isVisible() is False - assert self.main_window.mscolab.connect_window is None - assert self.main_window.local_active is True - # test operation listing visibility - assert self.main_window.listOperationsMSC.model().rowCount() == 1 + + def assert_(): + # show logged in widgets + assert self.main_window.usernameLabel.text() == self.userdata[1] + assert self.main_window.connectBtn.isVisible() is False + assert self.main_window.mscolab.connect_window is None + assert self.main_window.local_active is True + # test operation listing visibility + assert self.main_window.listOperationsMSC.model().rowCount() == 1 + qtbot.wait_until(assert_) @mock.patch("PyQt5.QtWidgets.QMessageBox.question", return_value=QtWidgets.QMessageBox.Yes) def test_login_with_different_account_shows_update_credentials_popup(self, mockbox):