From 412b6616728b778159f2d0d6fe422c91569b61d1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 25 Feb 2021 11:57:43 +0100 Subject: [PATCH] Squish: Correct hitting "Do Not Show Again" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original implementation just made it work for the common use case. If the order or the selected buttons differed from the common case this failed. Beside this it is later on more easily to extend. Change-Id: I581b0af2579fa728a81b9946028ade5559f17fd8 Reviewed-by: Robert Löhning --- tests/system/objects.map | 1 - tests/system/shared/qtcreator.py | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index 1c016aea443..817db13c37c 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -2,7 +2,6 @@ :*Qt Creator.Cancel Build_QToolButton {text='Cancel Build' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Continue_Core::Internal::FancyToolButton {name='Debug.Button' toolTip?='Continue *' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:*Qt Creator.Do Not Show Again_QToolButton {text='Do Not Show Again' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Find_Find::Internal::FindToolBar {name='Core__Internal__FindWidget' type='Core::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'} :*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack {name='FormEditorStack' type='Designer::Internal::FormEditorStack' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Interrupt_Core::Internal::FancyToolButton {name='Debug.Button' toolTip='Interrupt' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 9ecec40a207..d78da01d925 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -54,6 +54,14 @@ source("../../shared/clang.py") source("../../shared/welcome.py") source("../../shared/workarounds.py") # include this at last + +def __closeInfoBarEntry__(leftButtonText): + toolButton = ("text='%s' type='QToolButton' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'") + doNotShowAgain = toolButton % "Do Not Show Again" + leftWidget = "leftWidget={%s}" % (toolButton % leftButtonText) + clickButton(waitForObject("{%s %s}" % (doNotShowAgain, leftWidget))) + # additionalParameters must be a list or tuple of strings or None def startQC(additionalParameters=None, withPreparedSettingsPath=True, closeLinkToQt=True, cancelTour=True): global SettingsPath @@ -69,9 +77,9 @@ def startQC(additionalParameters=None, withPreparedSettingsPath=True, closeLinkT if closeLinkToQt or cancelTour: progressBarWait(3000) # wait for the "Updating documentation" progress bar if closeLinkToQt: - clickButton(waitForObject(":*Qt Creator.Do Not Show Again_QToolButton")) + __closeInfoBarEntry__("Link with Qt") if cancelTour: - clickButton(waitForObject(":*Qt Creator.Do Not Show Again_QToolButton")) + __closeInfoBarEntry__("Take UI Tour") return appContext; def startedWithoutPluginError():