Simple Capture & Replay (C&R) Test
- Show source folder in file explorer before C&R test execution (note: SimpleCRTest.cpp file)
- Change to IDE and start test execution
- The CAPTURE macro (see centre of code window) pops up the capture dialog
- Capturing is started by clicking on "Start" in the capture dialog (Note: it can be stopped and restarted, and comments can be easily added to the recording)
- In the text field on the top the word "hallo" is entered (Note: each key stroke is generating an event -> consecutive events are collected, see below)
- The tree item selection is changed
- The combo box item is changed
- Now the capturing is finished by clicking on "Exit" in the capture dialog
- Since C&R is bootstrapping the GUI test case, finishing the capturing also will show the CppUnit test execution result (Note: this also means that one can place the CAPTURE macro anywhere within an existing test case and re-capture modular little pieces later -> improves maintainability)
- Change to file explorer: the bootstrapping has written the test case directly into backup file (SimpleCRTest.cpp.cr1) by replacing the CAPTURE macro with the recorded events
- Rename test case files to make the bootstrapped test case the new test case
- Change back to IDE and confirm the reloading of the changed test case file (SimpleCRTest.cpp)
- Scroll down bootstrapped test case to show typical test case generation output
- Try to rebuild test suite -> errors -> fix pragmatic code generation of capture phase: removing duplicate container lookups and variable declarations, adding include directories (Note: of course, adding assertions would be also a vital part of this phase)
- Now the test suite rebuild is successful
- Start of bootstrapped test suite execution (replay captured test case like a normal hand written test case) -> all intially recorded events are replayed
- Test suite completes successfully, awesome :-)