I guess I need an event filter on the mainWindow to ignore all mouse-clicks and key-strokes while the steps of the test are running in a visually appealing fashion by using:
#and maybe qt.QTimer.sleep(200)
And uninstall the event filter if the test fails or ends successfully
Here is a test, I would like to create the points more slowly and make it look kinda interactive
Hope you can help
It’s probably easier to use
Or you can use
slicer.util.delayDisplay(message, msec) for a similar purpose.
Although making tests for every possible behavior would be impossible (in my opinion).
I would be aiming to have self-tests for a complete (linear) workflow that could teach users to use BoneReconstructionPlanner and achieve the surgical guides (so this could supplement or at least help minimize documentation efforts)
Is this idea common? Has it been done on other extensions I can refer to?
Yes, exactly. No software tests can be exhaustive. The original goal of the SelfTests was exactly to replicate end-to-end use cases in order to flag any regressions that would have an impact on end users. These Application-level tests are in
Applications/SlicerApp/Testing/Python. The tests starting with RSNA for example correspond to the steps of the user tutorials held at that conference one year.
In the future we plan to further integrate the SelfTest scripts with the tutorial infrastructure so that we can more easily maintain tutorials with screenshots in multiple languages. That is, we would use the test to capture screenshots and would run the script once for each language setting.
A useful feature of some selftests that they have buttons for running each section of the test separately. Users than pick and choose which section they want to just watch and which ones they want to do themselves.
To use the self-tests as tutorials, it would be nice to record to video, because that would allow users to easily pause it, rewind, fast-forward, etc. as needed. For the videos it could be better to move text display from the center of the screen to somewhere near the bottom; and to show some animation where the mouse is clicked (and maybe even move the mouse pointer there).