The first thing to mention is to define what you want to test as "testing" is a very broad term.
The first thing to mention is to define what you want to test as "testing" is a very broad term.
Ritght!
I want write test to perform about 20 typical user actions. (typical "positive" use cases). This will be purely GUI simulation.
One of that tests should be done like that: (open login window), type username, type passowrd, click Ok, (connection in the background)(close login window)(open main window), type some text, push enter, click icon (open related window), click some icon (in related window), click close button (close related window), push enter, hit alt+f4 (close main window).
Then next similar test should be performed.
Last edited by oficjalne100; 11th March 2012 at 18:37.
Ok! I try to write some automated tests "positive use cases" of my application. And it almost works (I have problem with main menu simulated clicks, but probably it is not related to whole "positive use cases" tests concept). I do it as follow:
1. Write test object - it should create QApplication (or its descendant) in initTestCase() and delete them in cleanupTestCase(), other slots should perform tests (as usual in QTestLib)
1. Detect "--demo" parameter in main(), and remove it from parameters list (or create QStringList with all parameters except "--demo") to avoid fatal error in QTest::qExec
2. Create in main() test object (e.g. called lTest)
3. Call in main(): return QTest::qExec(&lTest, lParams); In that case lParams is mentioned QStringList with main() parameters (except "--demo") converted from plain asci to QString.
Bookmarks