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):