From: Richard Dale Date: 2004-03-17T16:39:32+09:00 Subject: Re: GUI testing on unix Bret Pettichord wrote: > At 01:19 PM 3/16/2004, Simon Strandgaard wrote: >>Just want to play around with UI-testing. I have never tried it before. >>So there isn't any problems to solve yet ;-) >>Maybe write a chapter about UI-testing with ruby. > > Some people use dcop to test Qt applications. But that isn't Ruby. I've recently added dcop support to the 'Korundum' KDE superset of QtRuby. So you could add dcop slots to your ruby application, which would make it easier to hook up to a test environment. Below is a minimal program defining a dcop slot 'mySlot' - it expects a string and returns a QPoint to the caller. The caller could be a test driver program in another process. -- Richard #!/usr/bin/env ruby require 'Korundum' class MyWidget < KDE::PushButton k_dcop 'QPoint mySlot(QString)' def initialize(parent, name) super end def mySlot(greeting) puts "greeting: #{greeting}" return Qt::Point.new(50, 100) end end about = KDE::AboutData.new("dcopslot", "dcopSlotTest", "0.1") KDE::CmdLineArgs.init(ARGV, about) a = KDE::Application.new() hello = MyWidget.new(nil, "mywidget") { setText "DCOP Slot Test" } a.mainWidget = hello hello.caption = a.makeStdCaption("DCOP Slot Test") hello.show() a.exec()