forked from qt-creator/qt-creator
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 <robert.loehning@qt.io>
This commit is contained in:
@@ -27,8 +27,6 @@ source("../../shared/qtcreator.py")
|
|||||||
source("Tree.py")
|
source("Tree.py")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
test.xfail("Skipping test. This must be rewritten for current kits.")
|
|
||||||
return
|
|
||||||
if os.getenv("SYSTEST_OPENGL_MISSING") == "1":
|
if os.getenv("SYSTEST_OPENGL_MISSING") == "1":
|
||||||
test.xfail("This test needs OpenGL - skipping...")
|
test.xfail("This test needs OpenGL - skipping...")
|
||||||
return
|
return
|
||||||
@@ -73,9 +71,13 @@ def main():
|
|||||||
earlyExit("Could not find expected Inspector tree inside Locals and Expressions.")
|
earlyExit("Could not find expected Inspector tree inside Locals and Expressions.")
|
||||||
return
|
return
|
||||||
# reduce items to outer Rectangle object
|
# reduce items to outer Rectangle object
|
||||||
items = items.getChild("QQmlEngine")
|
items = items.getChild("QQuickView")
|
||||||
if items == None:
|
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
|
return
|
||||||
items = items.getChild("Rectangle")
|
items = items.getChild("Rectangle")
|
||||||
if items == None:
|
if items == None:
|
||||||
@@ -97,19 +99,24 @@ def main():
|
|||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def __unfoldTree__():
|
def __unfoldTree__():
|
||||||
rootIndex = getQModelIndexStr("text='QQmlEngine'",
|
# TODO inspect the qmlengine as well?
|
||||||
|
rootIndex = getQModelIndexStr("text='QQuickView'",
|
||||||
':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
||||||
mainRect = getQModelIndexStr("text='Rectangle'", rootIndex)
|
unfoldQModelIndex(rootIndex, False)
|
||||||
unfoldQModelIndexIncludingProperties(mainRect)
|
quickRootItem = getQModelIndexStr("text='QQuickRootItem'", rootIndex)
|
||||||
|
unfoldQModelIndex(quickRootItem, False)
|
||||||
|
mainRect = getQModelIndexStr("text='Rectangle'", quickRootItem)
|
||||||
|
unfoldQModelIndex(mainRect)
|
||||||
subItems = ["text='Rectangle'", "text='Rectangle' occurrence='2'", "text='Text'"]
|
subItems = ["text='Rectangle'", "text='Rectangle' occurrence='2'", "text='Text'"]
|
||||||
for item in subItems:
|
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')
|
tv = waitForObject(':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
||||||
# HACK to avoid failing clicks
|
# HACK to avoid failing clicks
|
||||||
tv.scrollToBottom()
|
tv.scrollToBottom()
|
||||||
doubleClick(waitForObject(indexStr))
|
doubleClick(waitForObject(indexStr))
|
||||||
|
if includingProperties:
|
||||||
propIndex = getQModelIndexStr("text='Properties'", indexStr)
|
propIndex = getQModelIndexStr("text='Properties'", indexStr)
|
||||||
# HACK to avoid failing clicks
|
# HACK to avoid failing clicks
|
||||||
tv.scrollToBottom()
|
tv.scrollToBottom()
|
||||||
|
Reference in New Issue
Block a user