Best approach for developing a unit testing GUI

Asked by Mychal Miller

My application involves some manual hardware interactions that trigger events in the software system for the purpose of system functional testing. I currently use Python unittest. My current scripts use "popup" and "input" dialogs as informal breakpoints as well as to give the operator instructions for the manual hardware interactions (ie "Manually do XYZ, then click OK").

I've been considering developing a small GUI that would sit in a corner of the screen with a "pause" function, a "play/continue" function, and a text window that I can use to display instructions and possibly some status messages. A progress bar would be great also, but not required.

Is there a recommended way to implement something like this? I'm using HTMLTestRunner to capture/format my unittest results and test-related logging, so everything fed into this GUI would be considered throw-away data.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

There are 2 possibilities:

--- Java swing
Since we have the Java environment available you could implement this window using the Java swing classes (thus is how the Sikuli IDE is built).
And you would run this window in parallel or as a subprocess.

--- Using Sikuli Guide
An experimental feature as an extension to Sikuli, that makes it possible to display text, images, frames and buttons in parallel to a running script. The fascinating feature: the elements can be easily attached to visual objects, that you already deal with in your scripts.
If you want to use this, you have to send me a mail to https://launchpad.net/~raimund-hocke, since it is currently not available officially and has no actual documentation.

--- The real challenge
would be to communicate back the "play/continue/pause" action, since Sikuli currently does not have a feature, to simply pause a script at some point and then continue it.
At least on the Python level, there is no chance to implement something like this without going deep into Java features.

Revision history for this message
Mychal Miller (mychaluva) said :
#2

Question... how "experimental" is the Sikuli Guide? Is it part of the roadmap for Sikuli or is there a big risk of the functionality being unsupported/deprecated going forward.

I can do it in Swing if I need to, but I'm interested in the Sikuli Guide functionality as well.

Also, about the "pause" button. It wouldn't really be a "pause" button, but more of a breakpoint indication. For instance, at the end of a command block I would insert a breakpoint that waits on the user to give input before proceeding with the script. Right now I do this with a popup, but I'd rather not have popups guiding the test flow. I'm not looking to freeze a script during progress, but I may attempt to make it break out of a test and allow restart of that unit test in certain cases.

Thanks

Revision history for this message
Mychal Miller (mychaluva) said :
#3

Just found this: http://sikuli.org/docx/extensions/sikuli-guide/index.html

I really like it so far, I'll code a few guides and see whether they address my need.

Thanks!

Revision history for this message
Best RaiMan (raimund-hocke) said :
#4

About Sikuli Guide see our personal mail communication.

To not freeze the script, you have to put any guidance GUI in a subprocess anyway (no problem with Sikuli/Python).

Revision history for this message
Mychal Miller (mychaluva) said :
#5

Thanks RaiMan, that solved my question.