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 <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2024-09-13 13:31:23 +02:00
parent 88446ae78a
commit 852470cfbb
2 changed files with 8 additions and 36 deletions

View File

@@ -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'}

View File

@@ -142,40 +142,13 @@ 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
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)