From: Phlip Date: 2004-03-18T01:59:34+09:00 Subject: Re: GUI testing on unix Simon Strandgaard wrote: > Phlip wrote: > > >> I am curious to if there exists any GUI testing packages for unix. > >> What about fxruby, gnome, qt, fltk ? > > > > Write tests in Ruby that create your forms and manipulate the controls thru > > Tk's native interface. > [snip] > > And that test passes. We can now write Test Fixtures that simulate user > > events as close as possible to the real thing, but without going outside Tk, > > or taking shortcuts. But most projects can take those shortcuts. http://www.rubygarden.com/ruby?SvgCanvas > Interesting.. something like that should do it ;-) > > Where can Ruby/Tk be obtained from? Oops. My bad. In my zeal to copy and paste a report I already wrote, I forgot an important point: Your own toolkit can "do it". For example, here's the exact same pattern, but using Gtk+ and C: http://gnomesupport.org/wiki/index.php/TestDrivenDevelopment A RubyGtk version of that would be a straight translation. You need these abilities: - Query Visual State Write test statements that query significant things the user must see - such as an edit field containing "Ignatz Mouse". Frequently check the real thing to ensure the - Simulate a User That's why my last post was so long - RubyTk cannot generate an event on command, unless the window displays, and we don't want it to interrupt our typing. Sometimes your library will make that easy, and sometimes you will just punt and call the function which you know the user input would call. But sometimes, like my last post, you will research your library and write a ton of extra code just to simulate an input event at a level that ensures coverage. - Treat I/O Like a Spigot both of the above techniques rely on temporarily displaying a window, under test, to check that the test is working properly. All Toolkits provide some of those abilities, and all (in theory) let you write test fixtures that supply the rest. But the point is to write the tests using the same language and toolkit as the tested code. Tell what library you use and I'l look at what sample code I have. -- Phlip http://www.xpsd.org/cgi-bin/wiki?TestFirstUserInterfaces