Quickly Testing Qt Desktop Applications with Approval Tests
summary
You get a concrete recipe: split the app into a static ui library split so tests link the UI code without changing source, use Catch2 with a custom main that creates QApplication, and apply ApprovalTests.cpp integration to capture table cell text or whole-widget images as golden files. Examples use Qt5 widgets, QTest event helpers and QSignalSpy usage to assert a single emitted signal (value 17) for a GoToLine widget. Fixtures hide fragile findChild access; screenshots are supported but flagged as brittle.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 0:46Speaker background
- 2:25The legacy code challenge
- 3:41Refactoring for testing
- 6:52Automated testing overview
- 8:14Setting up the test runner
- 10:29Testing with color widgets
- 15:39Simulating user interaction
- 22:52Improving test maintainability
- 28:15Separating logic from UI
- 30:15Testing Qt signals and events
- 36:46Introduction to approval tests
- 44:05Visualizing test results
- 46:13Qt testing tools
- 49:09Summary and conclusion
- 50:24Q&A and closing
related talks
49mQuickly and Effectively Testing Qt Desktop Applications
58mIntroduction to Automated Testing for Qt Applications
25mHow to automate Qt GUI Tests
46mBehavior Driven GUI Testing of Embedded, Mobile and Desktop Qt HMIs
25mTest It!
27mTesting Your Patience With Qt
01h 02mQuickly Testing Legacy C++ Code with Approval Tests
29mAre you testing enough - Qt application Quality Assurance
