PJSR - Calling callbacks from timer or other callabacks

bitli

Well-known member
TLDR: The real question is at the end
Some context: I am a big fan of automatic testing and provide test scripts for my scripts (VaryParams and ImageFileManager née FTSFileManager). This is very handy to test new releases. This requires that the domain functions be well separated from the GUI, to be able to call them independently.
However I did not automatically test the GUI, I only provided a shell to be able to test the GUI without doing the real work.
I recently implemented a test script on a script (AutoCalibrate) whereI add to go through the GUiI, so I created a subclass of the main dialog, overloaded onExecute, and calls the event callbacks from the overloaded onExecute. This does not require any change to the original script which is included in the test case. To close the window, I starts small timer and call from the timer, otherwise i have a deadlock. This works fine (even if the screen is not really updated during the tests, I can drive the process). I would like to generalize this approach to other scripts, especially to test error handling of the GUI.
The question:
Is there any rule/restriction (beyond obviously avoiding deadlocks) to call callbacks like onClick() from the Javascript timer or from onExecute() ?
 
Back
Top