Testing an GUI

Colin Putney cputney at wiresong.ca
Mon Dec 8 15:28:03 UTC 2003


Quoting Alexandre Bergel <bergel at iam.unibe.ch>:

> Hello,
> 
> I would like to make some testsuite related to an GUI.
> My current idea is simply to instanciate my morph, and sending the mouseDown:
> selector with an appropriate instance of MouseButtonEvent as a message.
> 
> Is there a better way? Something already built-in?

I've had good results by testing at a slightly higher level. Instead of
simulating mouse-clicks I call methods on the morph that would result from
clicks in the appropriate places. To put it another way, I trust Morphic to
process clicks, and just test that the GUI responds to them correctly.

Monticello has a good example of this in MCSnapshotBrowserTest. It does things
like select a class and assert that the correct method categories appear or
select a method and assert that the method source appears in the text pane.

I've done this sort of thing in a few other places (unreleased code) and
occasionally think about factoring it out into a Morphic testing framework, but
it's so simple that there's almost no point.

Colin


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Squeak-dev mailing list