forked from qt-creator/qt-creator
Squish: Fix tests for Qml locals view
Nowadays the locals and expression view displays the QQmlEngine as well, adapt tests accordingly. Change-Id: Ide6d3ae4e6dd8a136e44f196773a88a8aa29c702 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
@@ -140,10 +140,11 @@ def main():
|
|||||||
# start debugging
|
# start debugging
|
||||||
clickButton(fancyDebugButton)
|
clickButton(fancyDebugButton)
|
||||||
waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView")
|
waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView")
|
||||||
rootIndex = getQModelIndexStr("text='Rectangle'",
|
rootIndex = getQModelIndexStr("text='QQmlEngine'",
|
||||||
":Locals and Expressions_Debugger::Internal::WatchTreeView")
|
":Locals and Expressions_Debugger::Internal::WatchTreeView")
|
||||||
# make sure the items inside the root item are visible
|
# make sure the items inside the QQmlEngine's root are visible
|
||||||
doubleClick(waitForObject(rootIndex))
|
mainRect = getQModelIndexStr("text='Rectangle'", rootIndex)
|
||||||
|
doubleClick(waitForObject(mainRect))
|
||||||
if not object.exists(":DebugModeWidget_Debugger::Internal::ConsoleView"):
|
if not object.exists(":DebugModeWidget_Debugger::Internal::ConsoleView"):
|
||||||
invokeMenuItem("Window", "Output Panes", "Debugger Console")
|
invokeMenuItem("Window", "Output Panes", "Debugger Console")
|
||||||
progressBarWait()
|
progressBarWait()
|
||||||
@@ -154,19 +155,19 @@ def main():
|
|||||||
("width=66", "66", "width"), ("anchors.centerIn", "<unnamed object>"),
|
("width=66", "66", "width"), ("anchors.centerIn", "<unnamed object>"),
|
||||||
("opacity", "1"), ("opacity = .1875", u"0.\u200b1875", "opacity")]
|
("opacity", "1"), ("opacity = .1875", u"0.\u200b1875", "opacity")]
|
||||||
# check red inner Rectangle
|
# check red inner Rectangle
|
||||||
runChecks("text='Rectangle' occurrence='2'", rootIndex, checks)
|
runChecks("text='Rectangle' occurrence='2'", mainRect, checks)
|
||||||
|
|
||||||
checks = [("color", u"#\u200bff0000"), ("width", "100"), ("height", "100"),
|
checks = [("color", u"#\u200bff0000"), ("width", "100"), ("height", "100"),
|
||||||
("radius = Math.min(width, height) / 2", "50", "radius"),
|
("radius = Math.min(width, height) / 2", "50", "radius"),
|
||||||
("parent.objectName= 'mainRect'", "mainRect")]
|
("parent.objectName= 'mainRect'", "mainRect")]
|
||||||
# check green inner Rectangle
|
# check green inner Rectangle
|
||||||
runChecks("text='Rectangle'", rootIndex, checks)
|
runChecks("text='Rectangle'", mainRect, checks)
|
||||||
|
|
||||||
checks = [("color", u"#\u200b000000"), ("font.pointSize=14", "14", "font.pointSize"),
|
checks = [("color", u"#\u200b000000"), ("font.pointSize=14", "14", "font.pointSize"),
|
||||||
("font.bold", "false"), ("font.weight=Font.Bold", "75", "font.bold", "true"),
|
("font.bold", "false"), ("font.weight=Font.Bold", "75", "font.bold", "true"),
|
||||||
("rotation", "0"), ("rotation = 180", "180", "rotation")]
|
("rotation", "0"), ("rotation = 180", "180", "rotation")]
|
||||||
# check Text element
|
# check Text element
|
||||||
runChecks("text='Text'", rootIndex, checks)
|
runChecks("text='Text'", mainRect, checks)
|
||||||
# extended check must be done separately
|
# extended check must be done separately
|
||||||
originalVal = useDebuggerConsole("x", None)
|
originalVal = useDebuggerConsole("x", None)
|
||||||
if originalVal:
|
if originalVal:
|
||||||
|
@@ -71,6 +71,10 @@ 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")
|
||||||
|
if items == None:
|
||||||
|
earlyExit("Could not find expected QQmlEngine tree inside Locals and Expressions.")
|
||||||
|
return
|
||||||
items = items.getChild("Rectangle")
|
items = items.getChild("Rectangle")
|
||||||
if items == None:
|
if items == None:
|
||||||
earlyExit("Could not find expected Rectangle tree inside Locals and Expressions.")
|
earlyExit("Could not find expected Rectangle tree inside Locals and Expressions.")
|
||||||
@@ -91,12 +95,13 @@ def main():
|
|||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def __unfoldTree__():
|
def __unfoldTree__():
|
||||||
rootIndex = getQModelIndexStr("text='Rectangle'",
|
rootIndex = getQModelIndexStr("text='QQmlEngine'",
|
||||||
':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
||||||
unfoldQModelIndexIncludingProperties(rootIndex)
|
mainRect = getQModelIndexStr("text='Rectangle'", rootIndex)
|
||||||
|
unfoldQModelIndexIncludingProperties(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, rootIndex))
|
unfoldQModelIndexIncludingProperties(getQModelIndexStr(item, mainRect))
|
||||||
|
|
||||||
def unfoldQModelIndexIncludingProperties(indexStr):
|
def unfoldQModelIndexIncludingProperties(indexStr):
|
||||||
tv = waitForObject(':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
tv = waitForObject(':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
||||||
|
Reference in New Issue
Block a user