2. 大綱
• Qt提供的測試工具 – Qt Test vs Qt Quick Test
• Qt Unit Testing –網路範例與相關教學網頁
• Qt GUI Automation Testing – 實作於小型App專案
• 討論 – 使用Qt Quick test實現Qt GUI Automation Testing之可能性
• 延伸討論
3. Qt提供的測試工具 -
Qt Test vs Qt Quick Test
• For Unit testing applications and libraries
– QT Test
• 使用C++ 實現測試專案的架構
• 所有測試專案下的tst_*.cpp 會自動逐一執行一次
– Qt Quick Test
• 使用QML實現測試專案的架構
• 所有測試專案下的tst_*.qml 會自動逐一執行一次
• Main.cpp必須使用QUICK_TEST_MAIN macro (也可使用普通的main函式, 再
return quick_test_main, 參考https://www.slideshare.net/ICSinc/qt-test-
framework, p.50)
4. QtQuick Unit Testing –
相關教學網頁
• Qt Quick Test
• https://doc.qt.io/qt-5.11/qtquicktest-index.html
5. QtQuick Unit Testing –
相關教學網頁
• http://doc.qt.io/qt-5/qttest-qmlmodule.html
6. QtQuick Unit Testing –
相關教學網頁連結列表
• TestCase QML Type
• Introduction to QML Test Cases
• Data-driven Tests
• Benchmarks
• Simulating Keyboard and Mouse Events
• Managing Dynamically Created Test Objects
• 其他(包含Qt Test)
• Qt test – Unit testing framework
• Chapter 3: Simulating GUI Events
• Running Autotests
• Qt Test
• How to create a Qt-Quick Test
• Intention of GUI-Unit Testing in QML
7. • Writing UnitTests for my Qt Application
• (測試邏輯(包裝成static lib)的unit test)
Qt Unit Testing –
網路範例
8. • GUI unit testing with Qt Test – part 1 – introduction
• (和第一個範例雷同)
• https://github.com/vivaladav/BitsOfBytes/tree/master/gui-unit-testing-with-qt-
test-introduction
Qt Unit Testing –
網路範例