From 38458c3e401d5fcafca6fa5b97fae7dd7c1865f4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 12 Mar 2020 13:20:13 +0100 Subject: [PATCH] Squish: Fix tst_qml_locals The content of the locals and expressions had changed as it nowadays provides information on the qml engine as well. Adapt the test accordingly. Change-Id: Ib5fa96e3150206a374ac5e115e789cc3b983497b Reviewed-by: Robert Loehning --- .../suite_debugger/tst_qml_locals/test.py | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py index 63516e89518..5f89fc8942f 100644 --- a/tests/system/suite_debugger/tst_qml_locals/test.py +++ b/tests/system/suite_debugger/tst_qml_locals/test.py @@ -27,8 +27,6 @@ source("../../shared/qtcreator.py") source("Tree.py") def main(): - test.xfail("Skipping test. This must be rewritten for current kits.") - return if os.getenv("SYSTEST_OPENGL_MISSING") == "1": test.xfail("This test needs OpenGL - skipping...") return @@ -73,9 +71,13 @@ def main(): earlyExit("Could not find expected Inspector tree inside Locals and Expressions.") return # reduce items to outer Rectangle object - items = items.getChild("QQmlEngine") + items = items.getChild("QQuickView") if items == None: - earlyExit("Could not find expected QQmlEngine tree inside Locals and Expressions.") + earlyExit("Could not find expected QQuickView tree inside Locals and Expressions.") + return + items = items.getChild("QQuickRootItem") + if items == None: + earlyExit("Could not find expected QQuickRootItem tree inside Locals and Expressions.") return items = items.getChild("Rectangle") if items == None: @@ -97,23 +99,28 @@ def main(): invokeMenuItem("File", "Exit") def __unfoldTree__(): - rootIndex = getQModelIndexStr("text='QQmlEngine'", + # TODO inspect the qmlengine as well? + rootIndex = getQModelIndexStr("text='QQuickView'", ':Locals and Expressions_Debugger::Internal::WatchTreeView') - mainRect = getQModelIndexStr("text='Rectangle'", rootIndex) - unfoldQModelIndexIncludingProperties(mainRect) + unfoldQModelIndex(rootIndex, False) + quickRootItem = getQModelIndexStr("text='QQuickRootItem'", rootIndex) + unfoldQModelIndex(quickRootItem, False) + mainRect = getQModelIndexStr("text='Rectangle'", quickRootItem) + unfoldQModelIndex(mainRect) subItems = ["text='Rectangle'", "text='Rectangle' occurrence='2'", "text='Text'"] for item in subItems: - unfoldQModelIndexIncludingProperties(getQModelIndexStr(item, mainRect)) + unfoldQModelIndex(getQModelIndexStr(item, mainRect)) -def unfoldQModelIndexIncludingProperties(indexStr): +def unfoldQModelIndex(indexStr, includingProperties=True): tv = waitForObject(':Locals and Expressions_Debugger::Internal::WatchTreeView') # HACK to avoid failing clicks tv.scrollToBottom() doubleClick(waitForObject(indexStr)) - propIndex = getQModelIndexStr("text='Properties'", indexStr) - # HACK to avoid failing clicks - tv.scrollToBottom() - doubleClick(waitForObject(propIndex)) + if includingProperties: + propIndex = getQModelIndexStr("text='Properties'", indexStr) + # HACK to avoid failing clicks + tv.scrollToBottom() + doubleClick(waitForObject(propIndex)) def fetchItems(index, valIndex, treeView): tree = Tree()