Add findChild to TestCase.
authorMitch Curtis <mitch.curtis@digia.com>
Wed, 2 Jul 2014 07:53:00 +0000 (09:53 +0200)
committerLiang Qi <liang.qi@digia.com>
Fri, 4 Jul 2014 21:10:32 +0000 (23:10 +0200)
commit97cd2af9ac4c9b516ddf7ed19041041444b5f5e0
treeb737817f91d558bcf96098bf65313ad7cd5b8055
parent92658ebb755bda136a7e4fa455b8d116c2dd0c6f
Add findChild to TestCase.

This is useful for auto tests where it's necessary to have access to
dynamically created child items. For example:

property Component threeItemDelegate: Text {
    objectName: "delegate" + styleData.index
    text: styleData.value
}

...

function test_stuff() {
    ...

    var delegate0 = findChild(item, "delegate0");
    // check delegate0 for some condition...
}

[ChangeLog][QtTest][TestCase] Added findChild function to TestCase.

Change-Id: I04a8b07c9904768c07ec12f4b03f1afb1989e054
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
src/imports/testlib/TestCase.qml
src/qmltest/quicktestresult.cpp
src/qmltest/quicktestresult_p.h
tests/auto/qmltest/selftests/tst_findChild.qml [new file with mode: 0644]