[Gambas-user] Integrate unittest component to Gambas
Jussi Lahtinen
jussi.lahtinen at gmail.com
Fri May 18 15:02:38 CEST 2018
OK. Just popped into my mind, because of the recent (now fixed) bug in
datebox.
Jussi
On Fri, May 18, 2018 at 6:34 AM, Adrien Prokopowicz <
adrien.prokopowicz at gmail.com> wrote:
> Le 13/05/2018 à 20:59, Jussi Lahtinen a écrit :
>
>> How to test GUI widgets automatically?
>>
>>
>> Jussi
>>
>
> (Whoops, looks like your mail got lost in my inbox, sorry about that!)
>
> It seems both GTK[0] and Qt[1] have some utilities to generate mouse and
> keyboard events to any control/widget you may have, so we could make a
> gb.test.gui component that would wrap those calls and expose them to
> automated tests.
>
> Say you have a myButton that sets a myLabel's text to "Clicked!" when
> clicked, the corresponding test code could look like the following:
>
> Assert.Equals("", myLabel.Text)
> myButton.Click()
> Wait
> Assert.Equals("Clicked!", myLabel.Text)
>
> However, I think the setup for these kinds of tests would be quite a bit
> more complex to come up with, since the tested GUI app would probably need
> a virtual framebuffer to render to.
>
> But of course, testing GUI apps aren't really the focus right now, so it
> will wait a bit. I'll be quite happy already when we hit like 80-90% code
> coverage on the interpreter, compiler and the non-GUI components. :-)
>
> [0] https://developer.gnome.org/gtk3/stable/gtk3-Testing.html
> [1] http://doc.qt.io/qt-5/qtest.html
>
>
> --
> Adrien Prokopowicz
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180518/c804bbd9/attachment.html>
More information about the User
mailing list