From 852470cfbb947433a3fc3d0ad3cc5d2765637ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 13 Sep 2024 13:31:23 +0200 Subject: [PATCH] SquishTests: Update and clean up toggling of QML debugging - The old code was waiting for labels but their properties were outdated. Since these were only used to issue a warning, I removed them. - After removing that, the remaining code branches could be merged. - The branch for CMake would try clicking a button which would not appear at this point in time anymore. That dialog - with changed properties - will now be shown when starting a build. It didn't matter because that brach was unused anyway. I removed it. Change-Id: I564ea7a7c918ba910d50cc42306683613222226d Reviewed-by: Christian Stenger --- tests/system/objects.map | 1 - tests/system/shared/build_utils.py | 43 ++++++------------------------ 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index 6ad38f58318..e18f8512d7c 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -213,7 +213,6 @@ :scrollArea.Details_Utils::DetailsButton {text='Details' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :scrollArea.Edit build configuration:_QComboBox {leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'} :scrollArea.Edit build configuration:_QLabel {text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'} -:scrollArea.Library not available_QLabel {name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :sourceFileLineEdit_Utils::FileNameValidatingLineEdit {name='SrcFileName' type='Utils::FancyLineEdit' visible='1' window=':New_ProjectExplorer::JsonWizard'} :splitter.Commit File(s)_VcsBase::QActionPushButton {text~='(Commit .+/.+ File.*)' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :splitter.Description_QGroupBox {container=':Qt Creator.splitter_QSplitter' name='descriptionBox' title='Description' type='QGroupBox' visible='1'} diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index a47416ca333..fb28c8d8569 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -142,41 +142,14 @@ def verifyBuildConfig(currentTarget, configName, shouldBeDebug=False, enableShad buildCfCombo = waitForObject("{leftWidget=':scrollArea.Edit build configuration:_QLabel' " "type='QComboBox' unnamed='1' visible='1'}") - if shouldBeDebug: - test.compare(buildCfCombo.currentText, 'Debug', "Verifying whether it's a debug build") - else: - test.compare(buildCfCombo.currentText, 'Release', "Verifying whether it's a release build") - if enableQmlDebug: - try: - libLabel = waitForObject(":scrollArea.Library not available_QLabel", 2000) - mouseClick(libLabel, libLabel.width - 10, libLabel.height / 2, 0, Qt.LeftButton) - except: - pass - # Since waitForObject waits for the object to be enabled, - # it will wait here until compilation of the debug libraries has finished. - runCMakeButton = ("{type='QPushButton' text='Run CMake' unnamed='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}") - qmlDebuggingCombo = findObject(':Qt Creator.QML debugging and profiling:_QComboBox') - if selectFromCombo(qmlDebuggingCombo, 'Enable'): - if buildSystem is None or buildSystem == "CMake": # re-run cmake to apply - clickButton(waitForObject(runCMakeButton)) - elif buildSystem == "qmake": # Don't rebuild now - clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000)) - try: - problemFound = waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' " - "type='QLabel' name='problemLabel' visible='1'}", 1000) - if problemFound: - test.warning('%s' % problemFound.text) - except: - pass - else: - qmlDebuggingCombo = findObject(':Qt Creator.QML debugging and profiling:_QComboBox') - if selectFromCombo(qmlDebuggingCombo, "Disable"): - test.log("Qml debugging libraries are available - unchecked qml debugging.") - if buildSystem is None or buildSystem == "CMake": # re-run cmake to apply - clickButton(waitForObject(runCMakeButton)) - elif buildSystem == "qmake": # Don't rebuild now - clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000)) + buildType = "Debug" if shouldBeDebug else "Release" + test.compare(buildCfCombo.currentText, buildType, + "Verifying whether it's a %s build" % buildType) + qmlDebuggingCombo = waitForObject(':Qt Creator.QML debugging and profiling:_QComboBox') + if (selectFromCombo(qmlDebuggingCombo, "Enable" if enableQmlDebug else "Disable") + and buildSystem == "qmake"): + # Don't rebuild now + clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000)) clickButton(waitForObject(":scrollArea.Details_Utils::DetailsButton")) switchViewTo(ViewConstants.EDIT)