aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/testlib/TestCase.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/testlib/TestCase.qml')
-rw-r--r--src/imports/testlib/TestCase.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 37addd1d7d..f946a4eef3 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -638,6 +638,21 @@ Item {
}
/*!
+ \since 5.4
+ \qmlmethod QtObject TestCase::findChild(parent, objectName)
+
+ Returns the first child of \a parent with \a objectName,
+ or \c null if no such item exists. Children are searched recursively.
+
+ \code
+ compare(findChild(item, "childObject"), expectedChildObject);
+ \endcode
+ */
+ function findChild(parent, objectName) {
+ return qtest_results.findChild(parent, objectName);
+ }
+
+ /*!
\qmlmethod TestCase::tryCompare(obj, property, expected, timeout = 5000, message = "")
Fails the current test case if the specified \a property on \a obj