Can QTest or Qt Quick Test be used for automated system (not unit) testing of QtQuick Control2/C++ application?



  • Hello!
    We'd like to create some automated tests for the whole QtQuickControls2/C++ application with C++ middleware layer providing QML with complex/nested context properties for binding and signals/slot interaction.
    And wonder if Qt unit test frameworks can be used for that.

    Mostly the tests would include navigation through the screens with verification that proper controls are displayed and content of some controls is updated i.e. just changes on some mouse/key events.
    So we need to have the application started, an access to controls on the screen and an emulation of mouse clicks/key presses.

    Qt Quick test is designed for unit test of separate QML components and probably could be used for system test of pure Qml application but not for mixed QML/C++. Right? We thought about conditional loading of TestCase components but this doesn't seem to be a good way.

    With QTest how can we start the application? Do we have to repeat main.cpp logic in initTestCase() ?

    Maybe there are other approaches to automated testing with Qt means without 3rd party frameworks as it's not easy to get approval from management on 3rd party software in our prototype. Snapshot testing doesn't fit our case as controls properties are unpredictably changing.

    Would appreciate any suggestions.



  • How about Squish? It's also used for release test automation of Qt.



  • @jpnurmi said in Can QTest or Qt Quick Test be used for automated system (not unit) testing of QtQuick Control2/C++ application?:

    How about Squish? It's also used for release test automation of Qt.

    Thank you for the suggestion! Yes we noticed Squish. But now we develop an application prototype using QML and until some milestone would like not to use commercial tools. On the other hand we don't need a thorough test coverage yet. We'd like mostly sanity tests to validate. And we want to try Qt test frameworks or implement feeding navigation commands and verification ourselves with Qt C++/QML means.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.