Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Multiple flightpath dockingwidget updates only local new flighpathes #2313

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions tests/_test_msui/test_mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import requests.exceptions
import mock
import pytest
import random

import mslib.utils.auth
from mslib.mscolab.conf import mscolab_settings
Expand Down Expand Up @@ -411,6 +412,69 @@ def assert_logout_text():
qtbot.wait_until(assert_label_text)
# ToDo verify all operations disabled again without a visual check

def test_operation_while_switching_error(self, qtbot):
"""Test that operation switching trigger the KeyError"""

# test after activating operation
self._activate_operation_at_index(0)
self.window.actionTopView.trigger()

def assert_active_views():
# check 1 view opened
assert len(self.window.get_active_views()) == 1
qtbot.wait_until(assert_active_views)

topview_0 = self.window.listViews.item(0)
assert topview_0.window.tv_window_exists is True
# topview_0.window.setAttribute(QtCore.Qt.WA_DeleteOnClose)

# def assert_attribute():
# assert topview_0.window.testAttribute(QtCore.Qt.WA_DeleteOnClose)
# qtbot.wait_until(assert_attribute)

# open multiple flightpath
topview_0.window.cbTools.currentIndexChanged.emit(6)

def assert_dock_loaded():
assert topview_0.window.docks[5] is not None
qtbot.wait_until(assert_dock_loaded)

# more operations for the user
for op_name in ["second", "third"]:
assert add_operation(op_name, "description")
assert add_user_to_operation(path=op_name, emailid=self.userdata[0])

self._connect_to_mscolab(qtbot)
modify_config_file({"MSS_auth": {self.url: self.userdata[0]}})
self._login(qtbot, emailid=self.userdata[0], password=self.userdata[2])

# activate all operation, this enables them in the docking widget too
for _ in range(6):
self._activate_operation_at_index(random.randint(0, 2))
self._activate_flight_track_at_index(0)

# # Create the new operation
# op_name = "fourth"
# assert add_operation(op_name, "description")
# assert add_user_to_operation(path=op_name, emailid=self.userdata[0])
#
# for _ in range(4):
# self._activate_operation_at_index(random.randint(0, 3))
# self._activate_flight_track_at_index(0)

with mock.patch("PyQt5.QtWidgets.QMessageBox.warning", return_value=QtWidgets.QMessageBox.Yes):
topview_0.window.close()

def assert_window_closed():
assert topview_0.window.tv_window_exists is False
qtbot.wait_until(assert_window_closed)

self.window.mscolab.logout()

def assert_logout_text():
assert self.window.usernameLabel.text() == "User"
qtbot.wait_until(assert_logout_text)

def test_multiple_flightpath_switching_to_flighttrack_and_logout(self, qtbot):
"""
checks that we can switch in topviews with the multiple flightpath dockingwidget
Expand Down