From 96f33150fef7dbea51ea67438cf213cb37e32850 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 7 May 2024 09:43:33 +0200 Subject: [PATCH] SquishTests: Adapt to changed reload behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default for the reload behavior has changed, so explicitly set the setting when necessary. Change-Id: Ibcc3e8d2decf3f50dd3d1288c38ec3d027fbc23e Reviewed-by: Robert Löhning --- tests/system/shared/utils.py | 10 ++++++++++ .../system/suite_editors/tst_delete_externally/test.py | 3 +++ tests/system/suite_editors/tst_edit_externally/test.py | 2 ++ 3 files changed, 15 insertions(+) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 6921007c7aa..221e4eeada5 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -630,3 +630,13 @@ class GitClone: def __exit__(self, exc_type, exc_value, traceback): deleteDirIfExists(self.localPath) + + +def setReloadBehavior(to): + # QC 14 changed the default, so change the preferences + invokeMenuItem("Edit", "Preferences...") + mouseClick(waitForObjectItem(":Options_QListView", "Environment")) + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "System") + selectFromCombo("{type='QComboBox' unnamed='1' leftWidget={type='QLabel' " + "text='When files are externally modified:'}}", to) + clickButton(":Options.OK_QPushButton") diff --git a/tests/system/suite_editors/tst_delete_externally/test.py b/tests/system/suite_editors/tst_delete_externally/test.py index e36377cb56b..31583877c74 100644 --- a/tests/system/suite_editors/tst_delete_externally/test.py +++ b/tests/system/suite_editors/tst_delete_externally/test.py @@ -10,6 +10,9 @@ def main(): startQC() if not startedWithoutPluginError(): return + + setReloadBehavior("Always Ask") + for currentFile in files: test.log("Opening file %s" % currentFile) invokeMenuItem("File", "Open File or Project...") diff --git a/tests/system/suite_editors/tst_edit_externally/test.py b/tests/system/suite_editors/tst_edit_externally/test.py index e04ab19670a..13cd68127f1 100644 --- a/tests/system/suite_editors/tst_edit_externally/test.py +++ b/tests/system/suite_editors/tst_edit_externally/test.py @@ -23,6 +23,8 @@ def main(): if not startedWithoutPluginError(): return + setReloadBehavior("Always Ask") + mBox = ("{text?='The file * has been changed on disk. Do you want to reload it?' " "type='QMessageBox' unnamed='1' visible='1'}") popupText = ("

The file %s has been changed on disk. Do you want to reload it?

"